Blender  V3.3
kernel_arch.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2011-2022 Blender Foundation */
3 
4 /* Templated common declaration part of all CPU kernels. */
5 
6 /* --------------------------------------------------------------------
7  * Integrator.
8  */
9 
10 #define KERNEL_INTEGRATOR_FUNCTION(name) \
11  void KERNEL_FUNCTION_FULL_NAME(integrator_##name)(const KernelGlobalsCPU *ccl_restrict kg, \
12  IntegratorStateCPU *state)
13 
14 #define KERNEL_INTEGRATOR_SHADE_FUNCTION(name) \
15  void KERNEL_FUNCTION_FULL_NAME(integrator_##name)(const KernelGlobalsCPU *ccl_restrict kg, \
16  IntegratorStateCPU *state, \
17  ccl_global float *render_buffer)
18 
19 #define KERNEL_INTEGRATOR_INIT_FUNCTION(name) \
20  bool KERNEL_FUNCTION_FULL_NAME(integrator_##name)(const KernelGlobalsCPU *ccl_restrict kg, \
21  IntegratorStateCPU *state, \
22  KernelWorkTile *tile, \
23  ccl_global float *render_buffer)
24 
28 KERNEL_INTEGRATOR_FUNCTION(intersect_shadow);
29 KERNEL_INTEGRATOR_FUNCTION(intersect_subsurface);
30 KERNEL_INTEGRATOR_FUNCTION(intersect_volume_stack);
37 
38 #undef KERNEL_INTEGRATOR_FUNCTION
39 #undef KERNEL_INTEGRATOR_INIT_FUNCTION
40 #undef KERNEL_INTEGRATOR_SHADE_FUNCTION
41 
42 #define KERNEL_FILM_CONVERT_FUNCTION(name) \
43  void KERNEL_FUNCTION_FULL_NAME(film_convert_##name)(const KernelFilmConvert *kfilm_convert, \
44  const float *buffer, \
45  float *pixel, \
46  const int width, \
47  const int buffer_stride, \
48  const int pixel_stride); \
49  void KERNEL_FUNCTION_FULL_NAME(film_convert_half_rgba_##name)( \
50  const KernelFilmConvert *kfilm_convert, \
51  const float *buffer, \
52  half4 *pixel, \
53  const int width, \
54  const int buffer_stride);
55 
58 KERNEL_FILM_CONVERT_FUNCTION(sample_count)
60 
63 
66 KERNEL_FILM_CONVERT_FUNCTION(shadow_catcher)
67 KERNEL_FILM_CONVERT_FUNCTION(shadow_catcher_matte_with_shadow)
70 
71 #undef KERNEL_FILM_CONVERT_FUNCTION
72 
73 /* --------------------------------------------------------------------
74  * Shader evaluation.
75  */
76 
79  float *output,
80  const int offset);
83  float *output,
84  const int offset);
86  const KernelGlobalsCPU *kg,
88  float *output,
89  const int offset);
90 
91 /* --------------------------------------------------------------------
92  * Adaptive sampling.
93  */
94 
96  const KernelGlobalsCPU *kg,
98  int x,
99  int y,
100  float threshold,
101  bool reset,
102  int offset,
103  int stride);
104 
106  ccl_global float *render_buffer,
107  int y,
108  int start_x,
109  int width,
110  int offset,
111  int stride);
113  ccl_global float *render_buffer,
114  int x,
115  int start_y,
116  int height,
117  int offset,
118  int stride);
119 
120 /* --------------------------------------------------------------------
121  * Cryptomatte.
122  */
123 
125  ccl_global float *render_buffer,
126  int pixel_index);
127 
128 #undef KERNEL_ARCH
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei height
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint y
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei width
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei stride
float float4[4]
#define ccl_global
Definition: cuda/compat.h:43
#define KERNEL_FUNCTION_FULL_NAME(name)
ccl_gpu_kernel_postfix ccl_global float int int int int float threshold
ccl_gpu_kernel_postfix ccl_global KernelWorkTile const int ccl_global float * render_buffer
ccl_global KernelShaderEvalInput ccl_global float * output
ccl_gpu_kernel_postfix ccl_global float int int int int float bool int offset
ccl_global KernelShaderEvalInput * input
ccl_gpu_kernel_postfix ccl_global float int int int int float bool reset
clear internal cached data and reset random seed
#define KERNEL_INTEGRATOR_FUNCTION(name)
Definition: kernel_arch.h:10
#define KERNEL_INTEGRATOR_SHADE_FUNCTION(name)
Definition: kernel_arch.h:14
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)
#define KERNEL_FILM_CONVERT_FUNCTION(name)
Definition: kernel_arch.h:42
bool KERNEL_FUNCTION_FULL_NAME() adaptive_sampling_convergence_check(const KernelGlobalsCPU *kg, ccl_global float *render_buffer, int x, int y, float threshold, bool reset, int offset, int stride)
void KERNEL_FUNCTION_FULL_NAME() shader_eval_displace(const KernelGlobalsCPU *kg, const KernelShaderEvalInput *input, float *output, const int offset)
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)
#define KERNEL_INTEGRATOR_INIT_FUNCTION(name)
Definition: kernel_arch.h:19
void KERNEL_FUNCTION_FULL_NAME() shader_eval_curve_shadow_transparency(const KernelGlobalsCPU *kg, const KernelShaderEvalInput *input, float *output, const int offset)
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)