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
5
Ansel is free software: you can redistribute it and/or modify
6
it under the terms of the GNU General Public License as published by
7
the Free Software Foundation, either version 3 of the License, or
8
(at your option) any later version.
9
10
Ansel is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
GNU General Public License for more details.
14
15
You should have received a copy of the GNU General Public License
16
along with Ansel. If not, see <http://www.gnu.org/licenses/>.
17
*/
18
36
#ifndef DT_DEVELOP_PIPE_CACHE_POLICY_H
37
#define DT_DEVELOP_PIPE_CACHE_POLICY_H
38
39
#include <glib.h>
40
41
#include "
system/macros.h
"
// IS_NULL_PTR
42
44
typedef
struct
dt_dev_pipe_cache_policy_inputs_t
45
{
47
gboolean
authored_cache
;
49
gboolean
user_requested_cache
;
52
gboolean
supports_opencl
;
54
gboolean
color_picker_on
;
56
gboolean
global_hist_output_on
;
58
gboolean
global_hist_input_on
;
60
gboolean
module_hist_on
;
62
gboolean
active_in_gui
;
64
gboolean
has_autoset
;
65
}
dt_dev_pipe_cache_policy_inputs_t
;
66
78
static
inline
gboolean
dt_dev_pipe_cache_policy_decide
(
const
dt_dev_pipe_cache_policy_inputs_t
*
in
,
79
const
gboolean
inherited_requirement
,
80
gboolean *
upstream_requirement
)
81
{
82
// What THIS node needs from the node before it.
83
const
gboolean
own_input_requirement
84
= !
in
->
supports_opencl
||
in
->active_in_gui ||
in
->module_hist_on
85
||
in
->global_hist_input_on ||
in
->has_autoset;
86
87
// A GPU-capable node that needs no host input of its own must not ERASE a requirement
88
// inherited from further downstream -- a CPU-only module reached through it, or one that is
89
// disabled right now but was enabled a moment ago and left a stale host-less cacheline
90
// behind. This was an `=' once, and an intermediate GPU module silently reset the flag; the
91
// module before it then skipped a readback that a later, non-adjacent consumer needed, and
92
// read the previous life of a rekeyed cacheline. Only reproducible with OpenCL enabled.
93
if
(!
IS_NULL_PTR
(
upstream_requirement
))
94
*
upstream_requirement
=
own_input_requirement
||
inherited_requirement
;
95
96
return
in
->authored_cache ||
in
->user_requested_cache ||
in
->color_picker_on
97
||
in
->global_hist_output_on ||
inherited_requirement
;
98
}
99
100
#endif
// DT_DEVELOP_PIPE_CACHE_POLICY_H
101
102
// clang-format off
103
// modelines: These editor modelines have been set for all relevant files by tools/update_modelines.py
104
// vim: shiftwidth=2 expandtab tabstop=2 cindent
105
// kate: tab-indents: off; indent-width 2; replace-tabs on; indent-mode cstyle; remove-trailing-spaces modified;
106
// 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:65
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:78
dt_dev_pipe_cache_policy_inputs_t
Everything the decision depends on, named.
Definition
pipe_cache_policy.h:45
dt_dev_pipe_cache_policy_inputs_t::color_picker_on
gboolean color_picker_on
Definition
pipe_cache_policy.h:54
dt_dev_pipe_cache_policy_inputs_t::global_hist_output_on
gboolean global_hist_output_on
Definition
pipe_cache_policy.h:56
dt_dev_pipe_cache_policy_inputs_t::authored_cache
gboolean authored_cache
Definition
pipe_cache_policy.h:47
dt_dev_pipe_cache_policy_inputs_t::has_autoset
gboolean has_autoset
Definition
pipe_cache_policy.h:64
dt_dev_pipe_cache_policy_inputs_t::module_hist_on
gboolean module_hist_on
Definition
pipe_cache_policy.h:60
dt_dev_pipe_cache_policy_inputs_t::global_hist_input_on
gboolean global_hist_input_on
Definition
pipe_cache_policy.h:58
dt_dev_pipe_cache_policy_inputs_t::user_requested_cache
gboolean user_requested_cache
Definition
pipe_cache_policy.h:49
dt_dev_pipe_cache_policy_inputs_t::supports_opencl
gboolean supports_opencl
Definition
pipe_cache_policy.h:52
dt_dev_pipe_cache_policy_inputs_t::active_in_gui
gboolean active_in_gui
Definition
pipe_cache_policy.h:62
src
develop
pipe_cache_policy.h
Generated by
1.9.8