![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Pixelpipe cache ↔ OpenCL buffer lifecycle helpers. More...
#include "common/atomic.h"#include "common/darktable.h"#include "common/opencl.h"#include "develop/pixelpipe.h"#include "develop/pixelpipe_cache.h"#include <stddef.h>
Include dependency graph for pixelpipe_cache_cl.c:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Functions | |
| static void | _gpu_clear_buffer (void **cl_mem_buffer, dt_pixel_cache_entry_t *cache_entry, void *host_ptr, int cst, const gboolean cache_device) |
No-OpenCL stub for _gpu_clear_buffer(). | |
Pixelpipe cache ↔ OpenCL buffer lifecycle helpers.
This file contains the "plumbing" between:
pixelpipe_cache.[ch]), andCL_MEM_USE_HOST_PTR).The pixelpipe is mostly written as a classic CPU pipeline: each module consumes a packed host buffer and produces a packed host buffer. When OpenCL is enabled, some modules can run GPU kernels using process_cl().
The performance goal is to avoid unnecessary copies between RAM and vRAM:
However, correctness has strict requirements:
When using CL_MEM_USE_HOST_PTR, OpenCL may:
Therefore we must:
CL_MEM_USE_HOST_PTR image is really zero-copy for a given driver/device.cl_mem pointers in our cache-side bookkeeping when we release a buffer.The high-level OpenCL control-flow lives in pixelpipe_hb.c (whether to run on GPU, tiling decisions, CPU fallbacks, etc.). This file focuses on the mechanics of OpenCL buffers:
cl_mem objects inside cache entries for later reuse,cl_mem objects in a safe way,You can't "just" call a CPU fallback when a GPU module fails: the CPU code expects a host buffer. In OpenCL mode, the host buffer can legitimately be NULL (GPU-only intermediate), while the correct data exists only in cl_mem. The fallback path must allocate the host buffer and synchronize it before CPU code can proceed.
|
inlinestatic |
No-OpenCL stub for _gpu_clear_buffer().
The pixelpipe code keeps cl_mem pointers around even when OpenCL is not compiled in, because the control flow is shared. In non-OpenCL builds those pointers must be treated as "always NULL".
This stub keeps the caller code simple and avoids littering the pixelpipe with preprocessor conditionals.
References void().
Referenced by _abort_module_shutdown_cleanup(), and dt_dev_pixelpipe_process().