Blender V4.5
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
54
57
60KERNEL_FILM_CONVERT_FUNCTION(shadow_catcher)
61KERNEL_FILM_CONVERT_FUNCTION(shadow_catcher_matte_with_shadow)
64
65#undef KERNEL_FILM_CONVERT_FUNCTION
66
67/* --------------------------------------------------------------------
68 * Shader evaluation.
69 */
70
73 float *output,
74 const int offset);
77 float *output,
78 const int offset);
80 const ThreadKernelGlobalsCPU *kg,
82 float *output,
83 const int offset);
84
85/* --------------------------------------------------------------------
86 * Adaptive sampling.
87 */
88
90 const ThreadKernelGlobalsCPU *kg,
92 const int x,
93 const int y,
94 const float threshold,
95 const int reset,
96 const int offset,
97 int stride);
98
101 const int y,
102 const int start_x,
103 const int width,
104 const int offset,
105 int stride);
108 const int x,
109 const int start_y,
110 const int height,
111 const int offset,
112 int stride);
113
114/* --------------------------------------------------------------------
115 * Cryptomatte.
116 */
117
120 int pixel_index);
121
122#undef KERNEL_ARCH
void reset()
clear internal cached data and reset random seed
#define ccl_global
#define input
VecBase< float, 4 > float4
#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
#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)