Blender V5.0
kernel_arch.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5/* Templated common declaration part of all CPU kernels. */
6
7/* --------------------------------------------------------------------
8 * Integrator.
9 */
10
11#define KERNEL_INTEGRATOR_FUNCTION(name) \
12 void KERNEL_FUNCTION_FULL_NAME(integrator_##name)( \
13 const ThreadKernelGlobalsCPU *ccl_restrict kg, IntegratorStateCPU *state)
14
15#define KERNEL_INTEGRATOR_SHADE_FUNCTION(name) \
16 void KERNEL_FUNCTION_FULL_NAME(integrator_##name)( \
17 const ThreadKernelGlobalsCPU *ccl_restrict kg, \
18 IntegratorStateCPU *state, \
19 ccl_global float *render_buffer)
20
21#define KERNEL_INTEGRATOR_INIT_FUNCTION(name) \
22 bool KERNEL_FUNCTION_FULL_NAME(integrator_##name)( \
23 const ThreadKernelGlobalsCPU *ccl_restrict kg, \
24 IntegratorStateCPU *state, \
25 KernelWorkTile *tile, \
26 ccl_global float *render_buffer)
27
31
32#undef KERNEL_INTEGRATOR_FUNCTION
33#undef KERNEL_INTEGRATOR_INIT_FUNCTION
34#undef KERNEL_INTEGRATOR_SHADE_FUNCTION
35
36#define KERNEL_FILM_CONVERT_FUNCTION(name) \
37 void KERNEL_FUNCTION_FULL_NAME(film_convert_##name)(const KernelFilmConvert *kfilm_convert, \
38 const float *buffer, \
39 float *pixel, \
40 const int width, \
41 const int buffer_stride, \
42 const int pixel_stride); \
43 void KERNEL_FUNCTION_FULL_NAME(film_convert_half_rgba_##name)( \
44 const KernelFilmConvert *kfilm_convert, \
45 const float *buffer, \
46 half4 *pixel, \
47 const int width, \
48 const int buffer_stride);
49
53KERNEL_FILM_CONVERT_FUNCTION(volume_majorant)
55
59
62KERNEL_FILM_CONVERT_FUNCTION(shadow_catcher)
63KERNEL_FILM_CONVERT_FUNCTION(shadow_catcher_matte_with_shadow)
66
67#undef KERNEL_FILM_CONVERT_FUNCTION
68
69/* --------------------------------------------------------------------
70 * Shader evaluation.
71 */
72
75 float *output,
76 const int offset);
79 float *output,
80 const int offset);
82 const ThreadKernelGlobalsCPU *kg,
84 float *output,
85 const int offset);
88 float *output,
89 const int offset);
90
91/* --------------------------------------------------------------------
92 * Adaptive sampling.
93 */
94
96 const ThreadKernelGlobalsCPU *kg,
98 const int x,
99 const int y,
100 const float threshold,
101 const int reset,
102 const int offset,
103 int stride);
104
107 const int y,
108 const int start_x,
109 const int width,
110 const int offset,
111 int stride);
114 const int x,
115 const int start_y,
116 const int height,
117 const int offset,
118 int stride);
119
120/* --------------------------------------------------------------------
121 * Cryptomatte.
122 */
123
126 int pixel_index);
127
128/* --------------------------------------------------------------------
129 * Volume Scattering Probability Guiding.
130 */
131
134 const int y,
135 const int center_x,
136 const int min_x,
137 const int max_x,
138 const int offset,
139 int stride);
142 const int x,
143 const int center_y,
144 const int height,
145 const int offset,
146 int stride);
147
148#undef KERNEL_ARCH
void reset()
clear internal cached data and reset random seed
#define ccl_global
#define input
#define output
#define KERNEL_FUNCTION_FULL_NAME(name)
ccl_gpu_kernel_postfix ccl_global KernelWorkTile const int ccl_global float * render_buffer
#define KERNEL_INTEGRATOR_SHADE_FUNCTION(name)
Definition kernel_arch.h:15
void KERNEL_FUNCTION_FULL_NAME volume_guiding_filter_x(const ThreadKernelGlobalsCPU *kg, ccl_global float *render_buffer, const int y, const int center_x, const int min_x, const int max_x, const int offset, int stride)
void KERNEL_FUNCTION_FULL_NAME volume_guiding_filter_y(const ThreadKernelGlobalsCPU *kg, ccl_global float *render_buffer, const int x, const int center_y, const int height, const int offset, int stride)
#define KERNEL_FILM_CONVERT_FUNCTION(name)
Definition kernel_arch.h:36
void KERNEL_FUNCTION_FULL_NAME shader_eval_background(const ThreadKernelGlobalsCPU *kg, const KernelShaderEvalInput *input, float *output, const int offset)
bool KERNEL_FUNCTION_FULL_NAME adaptive_sampling_convergence_check(const ThreadKernelGlobalsCPU *kg, ccl_global float *render_buffer, const int x, const int y, const float threshold, const int reset, const int offset, int stride)
void KERNEL_FUNCTION_FULL_NAME cryptomatte_postprocess(const ThreadKernelGlobalsCPU *kg, ccl_global float *render_buffer, int pixel_index)
#define KERNEL_INTEGRATOR_INIT_FUNCTION(name)
Definition kernel_arch.h:21
void KERNEL_FUNCTION_FULL_NAME shader_eval_displace(const ThreadKernelGlobalsCPU *kg, const KernelShaderEvalInput *input, float *output, const int offset)
void KERNEL_FUNCTION_FULL_NAME adaptive_sampling_filter_x(const ThreadKernelGlobalsCPU *kg, ccl_global float *render_buffer, const int y, const int start_x, const int width, const int offset, int stride)
void KERNEL_FUNCTION_FULL_NAME adaptive_sampling_filter_y(const ThreadKernelGlobalsCPU *kg, ccl_global float *render_buffer, const int x, const int start_y, const int height, const int offset, int stride)
void KERNEL_FUNCTION_FULL_NAME shader_eval_curve_shadow_transparency(const ThreadKernelGlobalsCPU *kg, const KernelShaderEvalInput *input, float *output, const int offset)
void KERNEL_FUNCTION_FULL_NAME shader_eval_volume_density(const ThreadKernelGlobalsCPU *kg, const KernelShaderEvalInput *input, float *output, const int offset)