Blender V4.3
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)(const KernelGlobalsCPU *ccl_restrict kg, \
13 IntegratorStateCPU *state)
14
15#define KERNEL_INTEGRATOR_SHADE_FUNCTION(name) \
16 void KERNEL_FUNCTION_FULL_NAME(integrator_##name)(const KernelGlobalsCPU *ccl_restrict kg, \
17 IntegratorStateCPU *state, \
18 ccl_global float *render_buffer)
19
20#define KERNEL_INTEGRATOR_INIT_FUNCTION(name) \
21 bool KERNEL_FUNCTION_FULL_NAME(integrator_##name)(const KernelGlobalsCPU *ccl_restrict kg, \
22 IntegratorStateCPU *state, \
23 KernelWorkTile *tile, \
24 ccl_global float *render_buffer)
25
30KERNEL_INTEGRATOR_FUNCTION(intersect_subsurface);
31KERNEL_INTEGRATOR_FUNCTION(intersect_volume_stack);
32KERNEL_INTEGRATOR_FUNCTION(intersect_dedicated_light);
38KERNEL_INTEGRATOR_SHADE_FUNCTION(shade_dedicated_light);
40
41#undef KERNEL_INTEGRATOR_FUNCTION
42#undef KERNEL_INTEGRATOR_INIT_FUNCTION
43#undef KERNEL_INTEGRATOR_SHADE_FUNCTION
44
45#define KERNEL_FILM_CONVERT_FUNCTION(name) \
46 void KERNEL_FUNCTION_FULL_NAME(film_convert_##name)(const KernelFilmConvert *kfilm_convert, \
47 const float *buffer, \
48 float *pixel, \
49 const int width, \
50 const int buffer_stride, \
51 const int pixel_stride); \
52 void KERNEL_FUNCTION_FULL_NAME(film_convert_half_rgba_##name)( \
53 const KernelFilmConvert *kfilm_convert, \
54 const float *buffer, \
55 half4 *pixel, \
56 const int width, \
57 const int buffer_stride);
58
63
66
69KERNEL_FILM_CONVERT_FUNCTION(shadow_catcher)
70KERNEL_FILM_CONVERT_FUNCTION(shadow_catcher_matte_with_shadow)
73
74#undef KERNEL_FILM_CONVERT_FUNCTION
75
76/* --------------------------------------------------------------------
77 * Shader evaluation.
78 */
79
81 const KernelShaderEvalInput *input,
82 float *output,
83 const int offset);
85 const KernelShaderEvalInput *input,
86 float *output,
87 const int offset);
89 const KernelGlobalsCPU *kg,
90 const KernelShaderEvalInput *input,
91 float *output,
92 const int offset);
93
94/* --------------------------------------------------------------------
95 * Adaptive sampling.
96 */
97
99 const KernelGlobalsCPU *kg,
101 int x,
102 int y,
103 float threshold,
104 int reset,
105 int offset,
106 int stride);
107
110 int y,
111 int start_x,
112 int width,
113 int offset,
114 int stride);
117 int x,
118 int start_y,
119 int height,
120 int offset,
121 int stride);
122
123/* --------------------------------------------------------------------
124 * Cryptomatte.
125 */
126
129 int pixel_index);
130
131#undef KERNEL_ARCH
#define output
void reset()
clear internal cached data and reset random seed
#define ccl_global
#define KERNEL_FUNCTION_FULL_NAME(name)
ccl_gpu_kernel_postfix ccl_global KernelWorkTile const int ccl_global float * render_buffer
#define KERNEL_INTEGRATOR_FUNCTION(name)
Definition kernel_arch.h:11
#define KERNEL_INTEGRATOR_SHADE_FUNCTION(name)
Definition kernel_arch.h:15
#define KERNEL_FILM_CONVERT_FUNCTION(name)
Definition kernel_arch.h:45
void KERNEL_FUNCTION_FULL_NAME adaptive_sampling_filter_x(const KernelGlobalsCPU *kg, ccl_global float *render_buffer, int y, int start_x, int width, int offset, int stride)
void KERNEL_FUNCTION_FULL_NAME cryptomatte_postprocess(const KernelGlobalsCPU *kg, ccl_global float *render_buffer, int pixel_index)
void KERNEL_FUNCTION_FULL_NAME shader_eval_background(const KernelGlobalsCPU *kg, const KernelShaderEvalInput *input, float *output, const int offset)
void KERNEL_FUNCTION_FULL_NAME shader_eval_displace(const KernelGlobalsCPU *kg, const KernelShaderEvalInput *input, float *output, const int offset)
#define KERNEL_INTEGRATOR_INIT_FUNCTION(name)
Definition kernel_arch.h:20
bool KERNEL_FUNCTION_FULL_NAME adaptive_sampling_convergence_check(const KernelGlobalsCPU *kg, ccl_global float *render_buffer, int x, int y, float threshold, int reset, int offset, int stride)
void KERNEL_FUNCTION_FULL_NAME adaptive_sampling_filter_y(const KernelGlobalsCPU *kg, ccl_global float *render_buffer, int x, int start_y, int height, int offset, int stride)
void KERNEL_FUNCTION_FULL_NAME shader_eval_curve_shadow_transparency(const KernelGlobalsCPU *kg, const KernelShaderEvalInput *input, float *output, const int offset)