Ansel
0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
pipe_cache_policy.h
Go to the documentation of this file.
1
/*
2
This file is part of Ansel.
3
Copyright (C) 2026 Aurélien Pierre.
4
Copyright (C) 2026 Guillaume Stutin.
5
6
Ansel is free software: you can redistribute it and/or modify
7
it under the terms of the GNU General Public License as published by
8
the Free Software Foundation, either version 3 of the License, or
9
(at your option) any later version.
10
11
Ansel is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
You should have received a copy of the GNU General Public License
17
along with Ansel. If not, see <http://www.gnu.org/licenses/>.
18
*/
19
37
#ifndef DT_DEVELOP_PIPE_CACHE_POLICY_H
38
#define DT_DEVELOP_PIPE_CACHE_POLICY_H
39
40
#include <glib.h>
41
42
#include "
system/macros.h
"
// IS_NULL_PTR
43
45
typedef
struct
dt_dev_pipe_cache_policy_inputs_t
46
{
48
gboolean
authored_cache
;
50
gboolean
user_requested_cache
;
53
gboolean
supports_opencl
;
55
gboolean
color_picker_on
;
57
gboolean
global_hist_output_on
;
59
gboolean
global_hist_input_on
;
61
gboolean
module_hist_on
;
63
gboolean
active_in_gui
;
65
gboolean
has_autoset
;
66
}
dt_dev_pipe_cache_policy_inputs_t
;
67
79
static
inline
gboolean
dt_dev_pipe_cache_policy_decide
(
const
dt_dev_pipe_cache_policy_inputs_t
*in,
80
const
gboolean
inherited_requirement
,
81
gboolean *
upstream_requirement
)
82
{
83
// What THIS node needs from the node before it.
84
const
gboolean
own_input_requirement
85
= !in->
supports_opencl
|| in->
active_in_gui
|| in->
module_hist_on
86
|| in->
global_hist_input_on
|| in->
has_autoset
;
87
88
// ONE HOP, not transitive. A node's output must reach host RAM when the node that CONSUMES
89
// it reads from RAM -- and that says nothing about the node before it, which publishes to a
90
// consumer of its own. Carried further up (`own || inherited'), the requirement would be
91
// monotone: the seal seeds the walk with TRUE for the displayed final output, so every
92
// enabled node would copy its whole output device->host on every frame.
93
//
94
// A stale host copy is no reason to carry the requirement further: the staleness lives in the
95
// cacheline, and the cache handles it there. A line rekeyed in place reports no host pixels
96
// (dt_pixel_cache_entry_t.host_stale) until they are rewritten for its new hash.
97
if
(!
IS_NULL_PTR
(
upstream_requirement
))
98
*
upstream_requirement
=
own_input_requirement
;
99
100
return
in->
authored_cache
|| in->
user_requested_cache
|| in->
color_picker_on
101
|| in->
global_hist_output_on
||
inherited_requirement
;
102
}
103
104
#endif
// DT_DEVELOP_PIPE_CACHE_POLICY_H
105
106
// clang-format off
107
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
108
// vim: shiftwidth=2 expandtab tabstop=2 cindent
109
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
110
// clang-format on
L
const float L
Definition
colorspaces_inline_conversions.h:494
macros.h
IS_NULL_PTR
#define IS_NULL_PTR(p)
C is way too permissive with !=, == and if(var) checks, which can mean too many things depending on w...
Definition
macros.h:96
dt_dev_pipe_cache_policy_decide
static gboolean dt_dev_pipe_cache_policy_decide(const dt_dev_pipe_cache_policy_inputs_t *in, const gboolean inherited_requirement, gboolean *upstream_requirement)
Decide one node's host-cache requirement, walking the pipe from the end backwards.
Definition
pipe_cache_policy.h:79
dt_dev_pipe_cache_policy_inputs_t
Everything the decision depends on, named.
Definition
pipe_cache_policy.h:46
dt_dev_pipe_cache_policy_inputs_t::color_picker_on
gboolean color_picker_on
Definition
pipe_cache_policy.h:55
dt_dev_pipe_cache_policy_inputs_t::global_hist_output_on
gboolean global_hist_output_on
Definition
pipe_cache_policy.h:57
dt_dev_pipe_cache_policy_inputs_t::authored_cache
gboolean authored_cache
Definition
pipe_cache_policy.h:48
dt_dev_pipe_cache_policy_inputs_t::has_autoset
gboolean has_autoset
Definition
pipe_cache_policy.h:65
dt_dev_pipe_cache_policy_inputs_t::module_hist_on
gboolean module_hist_on
Definition
pipe_cache_policy.h:61
dt_dev_pipe_cache_policy_inputs_t::global_hist_input_on
gboolean global_hist_input_on
Definition
pipe_cache_policy.h:59
dt_dev_pipe_cache_policy_inputs_t::user_requested_cache
gboolean user_requested_cache
Definition
pipe_cache_policy.h:50
dt_dev_pipe_cache_policy_inputs_t::supports_opencl
gboolean supports_opencl
Definition
pipe_cache_policy.h:53
dt_dev_pipe_cache_policy_inputs_t::active_in_gui
gboolean active_in_gui
Definition
pipe_cache_policy.h:63
src
develop
pipe_cache_policy.h
Generated by
1.9.8