18#if defined(__INTEGRATOR_GPU_PACKED_STATE__) && defined(__KERNEL_GPU__)
19 static_assert(
sizeof(ray->P) ==
sizeof(float4),
"Bad assumption about float3 padding");
29 "Generated packed_ray struct is misaligned with Ray struct");
31 "Generated packed_ray struct is misaligned with Ray struct");
33 "Generated packed_ray struct is misaligned with Ray struct");
35 "Generated packed_ray struct is misaligned with Ray struct");
37 "Generated packed_ray struct is misaligned with Ray struct");
39 "Generated packed_ray struct is misaligned with Ray struct");
41 "Generated packed_ray struct is misaligned with Ray struct");
56#if defined(__INTEGRATOR_GPU_PACKED_STATE__) && defined(__KERNEL_GPU__)
131#if defined(__INTEGRATOR_GPU_PACKED_STATE__) && defined(__KERNEL_GPU__)
137 "Generated packed_isect struct is misaligned with Intersection struct");
139 "Generated packed_isect struct is misaligned with Intersection struct");
141 "Generated packed_isect struct is misaligned with Intersection struct");
143 "Generated packed_isect struct is misaligned with Intersection struct");
145 "Generated packed_isect struct is misaligned with Intersection struct");
147 "Generated packed_isect struct is misaligned with Intersection struct");
161#if defined(__INTEGRATOR_GPU_PACKED_STATE__) && defined(__KERNEL_GPU__)
227 state, volume_stack, index,
object);
289#if defined(__KERNEL_GPU__)
298# define KERNEL_STRUCT_BEGIN(name) \
302# define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) \
303 if (kernel_integrator_state.parent_struct.name != nullptr) { \
304 kernel_integrator_state.parent_struct.name[to_state] = \
305 kernel_integrator_state.parent_struct.name[state]; \
308# ifdef __INTEGRATOR_GPU_PACKED_STATE__
309# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) \
310 KERNEL_STRUCT_BEGIN(parent_struct) \
311 KERNEL_STRUCT_MEMBER(parent_struct, packed_##parent_struct, packed, feature)
312# define KERNEL_STRUCT_MEMBER_PACKED(parent_struct, type, name, feature)
314# define KERNEL_STRUCT_MEMBER_PACKED KERNEL_STRUCT_MEMBER
315# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) KERNEL_STRUCT_BEGIN(parent_struct)
318# define KERNEL_STRUCT_ARRAY_MEMBER(parent_struct, type, name, feature) \
319 if (kernel_integrator_state.parent_struct[index].name != nullptr) { \
320 kernel_integrator_state.parent_struct[index].name[to_state] = \
321 kernel_integrator_state.parent_struct[index].name[state]; \
324# define KERNEL_STRUCT_END(name) \
329# define KERNEL_STRUCT_END_ARRAY(name, cpu_array_size, gpu_array_size) \
332 while (index < gpu_array_size) \
335# define KERNEL_STRUCT_VOLUME_STACK_SIZE kernel_data.volume_stack_size
339# undef KERNEL_STRUCT_BEGIN
340# undef KERNEL_STRUCT_BEGIN_PACKED
341# undef KERNEL_STRUCT_MEMBER
342# undef KERNEL_STRUCT_MEMBER_PACKED
343# undef KERNEL_STRUCT_ARRAY_MEMBER
344# undef KERNEL_STRUCT_END
345# undef KERNEL_STRUCT_END_ARRAY
346# undef KERNEL_STRUCT_VOLUME_STACK_SIZE
353 integrator_state_copy_only(kg, to_state,
state);
366# define KERNEL_STRUCT_BEGIN(name) \
370# define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) \
371 if (kernel_integrator_state.parent_struct.name != nullptr) { \
372 kernel_integrator_state.parent_struct.name[to_state] = \
373 kernel_integrator_state.parent_struct.name[state]; \
376# ifdef __INTEGRATOR_GPU_PACKED_STATE__
377# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) \
378 KERNEL_STRUCT_BEGIN(parent_struct) \
379 KERNEL_STRUCT_MEMBER(parent_struct, type, packed, feature)
380# define KERNEL_STRUCT_MEMBER_PACKED(parent_struct, type, name, feature)
382# define KERNEL_STRUCT_MEMBER_PACKED KERNEL_STRUCT_MEMBER
383# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) KERNEL_STRUCT_BEGIN(parent_struct)
386# define KERNEL_STRUCT_ARRAY_MEMBER(parent_struct, type, name, feature) \
387 if (kernel_integrator_state.parent_struct[index].name != nullptr) { \
388 kernel_integrator_state.parent_struct[index].name[to_state] = \
389 kernel_integrator_state.parent_struct[index].name[state]; \
392# define KERNEL_STRUCT_END(name) \
397# define KERNEL_STRUCT_END_ARRAY(name, cpu_array_size, gpu_array_size) \
400 while (index < gpu_array_size) \
403# define KERNEL_STRUCT_VOLUME_STACK_SIZE kernel_data.volume_stack_size
407# undef KERNEL_STRUCT_BEGIN
408# undef KERNEL_STRUCT_BEGIN_PACKED
409# undef KERNEL_STRUCT_MEMBER
410# undef KERNEL_STRUCT_MEMBER_PACKED
411# undef KERNEL_STRUCT_ARRAY_MEMBER
412# undef KERNEL_STRUCT_END
413# undef KERNEL_STRUCT_END_ARRAY
414# undef KERNEL_STRUCT_VOLUME_STACK_SIZE
421 integrator_shadow_state_copy_only(kg, to_state,
state);
433#if defined(__KERNEL_GPU__)
437 integrator_state_copy_only(kg, to_state,
state);
442 to_state->path =
state->path;
443 to_state->ray =
state->ray;
444 to_state->isect =
state->isect;
446 integrator_state_copy_volume_stack(kg, to_state,
state);
453#ifndef __KERNEL_GPU__
ATOMIC_INLINE uint32_t atomic_fetch_and_add_uint32(uint32_t *p, uint32_t x)
ATTR_WARN_UNUSED_RESULT const BMVert * v
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define ccl_device_forceinline
#define ccl_device_inline
#define CCL_NAMESPACE_END
#define kernel_integrator_state
ccl_device_forceinline float differential_zero_compact()
#define KERNEL_FEATURE_VOLUME
#define KERNEL_FEATURE_SHADOW_LINKING
const IntegratorShadowStateCPU *ccl_restrict ConstIntegratorShadowState
#define INTEGRATOR_STATE_ARRAY_WRITE(state, nested_struct, array_index, member)
IntegratorStateCPU *ccl_restrict IntegratorState
#define INTEGRATOR_STATE_WRITE(state, nested_struct, member)
const IntegratorStateCPU *ccl_restrict ConstIntegratorState
#define INTEGRATOR_STATE(state, nested_struct, member)
IntegratorShadowStateCPU *ccl_restrict IntegratorShadowState
#define INTEGRATOR_STATE_ARRAY(state, nested_struct, array_index, member)
ccl_device_forceinline void integrator_state_read_shadow_ray(ConstIntegratorShadowState state, ccl_private Ray *ccl_restrict ray)
ccl_device_inline int integrator_state_bounce(ConstIntegratorState state, const int)
ccl_device_forceinline void integrator_state_write_shadow_isect(IntegratorShadowState state, ccl_private const Intersection *ccl_restrict isect, const int index)
ccl_device_inline int integrator_state_transmission_bounce(ConstIntegratorState state, const int)
ccl_device_forceinline void integrator_state_read_ray(ConstIntegratorState state, ccl_private Ray *ccl_restrict ray)
ccl_device_inline int integrator_state_transparent_bounce(ConstIntegratorState state, const int)
ccl_device_inline IntegratorState integrator_state_shadow_catcher_split(KernelGlobals kg, IntegratorState state)
ccl_device_forceinline void integrator_state_read_shadow_ray_self(KernelGlobals kg, ConstIntegratorShadowState state, ccl_private Ray *ccl_restrict ray)
ccl_device_forceinline void integrator_state_read_shadow_isect(ConstIntegratorShadowState state, ccl_private Intersection *ccl_restrict isect, const int index)
ccl_device_forceinline void integrator_state_read_isect(ConstIntegratorState state, ccl_private Intersection *ccl_restrict isect)
ccl_device_inline int integrator_state_glossy_bounce(ConstIntegratorState state, const int)
ccl_device_forceinline void integrator_state_write_shadow_ray_self(KernelGlobals kg, IntegratorShadowState state, ccl_private const Ray *ccl_restrict ray)
ccl_device_inline int integrator_state_diffuse_bounce(ConstIntegratorState state, const int)
ccl_device_forceinline void integrator_state_write_isect(IntegratorState state, ccl_private const Intersection *ccl_restrict isect)
ccl_device_forceinline void integrator_state_write_shadow_ray(IntegratorShadowState state, ccl_private const Ray *ccl_restrict ray)
CCL_NAMESPACE_BEGIN ccl_device_forceinline void integrator_state_write_ray(IntegratorState state, ccl_private const Ray *ccl_restrict ray)