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
66
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.
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
#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
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.
Everything the decision depends on, named.