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); \
101 uint cache_miss_unused =
false;
118 uint cache_miss_unused =
false;
136 uint cache_miss_unused =
false;
153 uint cache_miss_unused =
false;
167 const float threshold,
239 const int pixel_index)
307# define KERNEL_FILM_CONVERT_FUNCTION(name, is_float) \
308 void KERNEL_FUNCTION_FULL_NAME(film_convert_##name)(const KernelFilmConvert *kfilm_convert, \
309 const float *buffer, \
312 const int buffer_stride, \
313 const int pixel_stride) \
315 STUB_ASSERT(KERNEL_ARCH, film_convert_##name); \
316 (void)kfilm_convert; \
320 (void)buffer_stride; \
321 (void)pixel_stride; \
323 void KERNEL_FUNCTION_FULL_NAME(film_convert_half_rgba_##name)( \
324 const KernelFilmConvert *kfilm_convert, \
325 const float *buffer, \
328 const int buffer_stride) \
330 STUB_ASSERT(KERNEL_ARCH, film_convert_##name); \
331 (void)kfilm_convert; \
335 (void)buffer_stride; \
340# define KERNEL_FILM_CONVERT_FUNCTION(name, is_float) \
341 void KERNEL_FUNCTION_FULL_NAME(film_convert_##name)(const KernelFilmConvert *kfilm_convert, \
342 const float *buffer, \
345 const int buffer_stride, \
346 const int pixel_stride) \
348 for (int i = 0; i < width; i++, buffer += buffer_stride, pixel += pixel_stride) { \
349 film_get_pass_pixel_##name(kfilm_convert, buffer, pixel); \
352 void KERNEL_FUNCTION_FULL_NAME(film_convert_half_rgba_##name)( \
353 const KernelFilmConvert *kfilm_convert, \
354 const float *buffer, \
357 const int buffer_stride) \
359 for (int i = 0; i < width; i++, buffer += buffer_stride, pixel++) { \
360 float pixel_rgba[4] = {0.0f, 0.0f, 0.0f, 1.0f}; \
361 film_get_pass_pixel_##name(kfilm_convert, buffer, pixel_rgba); \
363 pixel_rgba[1] = pixel_rgba[0]; \
364 pixel_rgba[2] = pixel_rgba[0]; \
366 film_apply_pass_pixel_overlays_rgba(kfilm_convert, buffer, pixel_rgba); \
367 *pixel = float4_to_half4_display( \
368 make_float4(pixel_rgba[0], pixel_rgba[1], pixel_rgba[2], pixel_rgba[3])); \
391#undef KERNEL_FILM_CONVERT_FUNCTION
394#undef DEFINE_INTEGRATOR_SHADE_KERNEL
395#undef DEFINE_INTEGRATOR_INIT_KERNEL
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, ccl_global uint *cache_miss, const int offset)
ccl_device void kernel_background_evaluate(KernelGlobals kg, const ccl_global KernelShaderEvalInput *input, ccl_global float *output, ccl_global uint *cache_miss, const int offset)
ccl_device void kernel_curve_shadow_transparency_evaluate(KernelGlobals kg, const ccl_global KernelShaderEvalInput *input, ccl_global float *output, ccl_global uint *cache_miss, const int offset)
CCL_NAMESPACE_BEGIN ccl_device void kernel_displace_evaluate(KernelGlobals kg, const ccl_global KernelShaderEvalInput *input, ccl_global float *output, ccl_global uint *cache_miss, 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 DEFINE_INTEGRATOR_SHADE_KERNEL(name)