37# define STUB_ASSERT(arch, name) \
38 assert(!(#name " kernel stub for architecture " #arch " was called!"))
49# define KERNEL_INVOKE(name, ...) (STUB_ASSERT(KERNEL_ARCH, name), 0)
51# define KERNEL_INVOKE(name, ...) integrator_##name(__VA_ARGS__)
56#define DEFINE_INTEGRATOR_INIT_KERNEL(name) \
57 bool KERNEL_FUNCTION_FULL_NAME(integrator_##name)(const ThreadKernelGlobalsCPU *kg, \
58 IntegratorStateCPU *state, \
59 KernelWorkTile *tile, \
60 ccl_global float *render_buffer) \
65 (void)render_buffer; \
66 return KERNEL_INVOKE( \
67 name, kg, state, tile, render_buffer, tile->x, tile->y, tile->start_sample); \
70#define DEFINE_INTEGRATOR_SHADE_KERNEL(name) \
71 void KERNEL_FUNCTION_FULL_NAME(integrator_##name)(const ThreadKernelGlobalsCPU *kg, \
72 IntegratorStateCPU *state, \
73 ccl_global float *render_buffer) \
77 (void)render_buffer; \
78 KERNEL_INVOKE(name, kg, state, render_buffer); \
163 const float threshold,
235 const int pixel_index)
303# define KERNEL_FILM_CONVERT_FUNCTION(name, is_float) \
304 void KERNEL_FUNCTION_FULL_NAME(film_convert_##name)(const KernelFilmConvert *kfilm_convert, \
305 const float *buffer, \
308 const int buffer_stride, \
309 const int pixel_stride) \
311 STUB_ASSERT(KERNEL_ARCH, film_convert_##name); \
312 (void)kfilm_convert; \
316 (void)buffer_stride; \
317 (void)pixel_stride; \
319 void KERNEL_FUNCTION_FULL_NAME(film_convert_half_rgba_##name)( \
320 const KernelFilmConvert *kfilm_convert, \
321 const float *buffer, \
324 const int buffer_stride) \
326 STUB_ASSERT(KERNEL_ARCH, film_convert_##name); \
327 (void)kfilm_convert; \
331 (void)buffer_stride; \
336# define KERNEL_FILM_CONVERT_FUNCTION(name, is_float) \
337 void KERNEL_FUNCTION_FULL_NAME(film_convert_##name)(const KernelFilmConvert *kfilm_convert, \
338 const float *buffer, \
341 const int buffer_stride, \
342 const int pixel_stride) \
344 for (int i = 0; i < width; i++, buffer += buffer_stride, pixel += pixel_stride) { \
345 film_get_pass_pixel_##name(kfilm_convert, buffer, pixel); \
348 void KERNEL_FUNCTION_FULL_NAME(film_convert_half_rgba_##name)( \
349 const KernelFilmConvert *kfilm_convert, \
350 const float *buffer, \
353 const int buffer_stride) \
355 for (int i = 0; i < width; i++, buffer += buffer_stride, pixel++) { \
356 float pixel_rgba[4] = {0.0f, 0.0f, 0.0f, 1.0f}; \
357 film_get_pass_pixel_##name(kfilm_convert, buffer, pixel_rgba); \
359 pixel_rgba[1] = pixel_rgba[0]; \
360 pixel_rgba[2] = pixel_rgba[0]; \
362 film_apply_pass_pixel_overlays_rgba(kfilm_convert, buffer, pixel_rgba); \
363 *pixel = float4_to_half4_display( \
364 make_float4(pixel_rgba[0], pixel_rgba[1], pixel_rgba[2], pixel_rgba[3])); \
387#undef KERNEL_FILM_CONVERT_FUNCTION
390#undef DEFINE_INTEGRATOR_SHADE_KERNEL
391#undef DEFINE_INTEGRATOR_INIT_KERNEL
void reset()
clear internal cached data and reset random seed
ccl_device_inline void film_cryptomatte_post(KernelGlobals kg, ccl_global float *render_buffer, const int pixel_index)
#define KERNEL_FILM_CONVERT_FUNCTION(name)
#define CCL_NAMESPACE_END
ccl_device void kernel_volume_density_evaluate(KernelGlobals kg, ccl_global const KernelShaderEvalInput *input, ccl_global float *output, const int offset)
ccl_device void kernel_curve_shadow_transparency_evaluate(KernelGlobals kg, const ccl_global KernelShaderEvalInput *input, ccl_global float *output, const int offset)
CCL_NAMESPACE_BEGIN ccl_device void kernel_displace_evaluate(KernelGlobals kg, const ccl_global KernelShaderEvalInput *input, ccl_global float *output, const int offset)
ccl_device void kernel_background_evaluate(KernelGlobals kg, const ccl_global KernelShaderEvalInput *input, ccl_global float *output, const int offset)
#define KERNEL_FUNCTION_FULL_NAME(name)
ccl_gpu_kernel_postfix ccl_global KernelWorkTile const int ccl_global float * render_buffer
ccl_device void film_adaptive_sampling_filter_y(KernelGlobals kg, ccl_global float *render_buffer, const int x, const int start_y, const int height, const int offset, const int stride)
ccl_device void film_adaptive_sampling_filter_x(KernelGlobals kg, ccl_global float *render_buffer, const int y, const int start_x, const int width, const int offset, const int stride)
ccl_device bool film_adaptive_sampling_convergence_check(KernelGlobals kg, ccl_global float *render_buffer, const int x, const int y, const float threshold, const int reset, const int offset, const int stride)
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)
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)
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)
#define DEFINE_INTEGRATOR_INIT_KERNEL(name)
#define KERNEL_FILM_CONVERT_FUNCTION(name, is_float)
#define DEFINE_INTEGRATOR_SHADE_KERNEL(name)
void KERNEL_FUNCTION_FULL_NAME volume_guiding_filter_y(const ThreadKernelGlobalsCPU *kg, ccl_global float *render_buffer, const int x, const int min_y, const int max_y, const int offset, const int stride)
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, const int stride)