20#if defined(__INTEGRATOR_GPU_PACKED_STATE__) && defined(__KERNEL_GPU__)
21 static_assert(
sizeof(ray->P) ==
sizeof(
float4),
"Bad assumption about float3 padding");
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");
43 "Generated packed_ray struct is misaligned with Ray struct");
58#if defined(__INTEGRATOR_GPU_PACKED_STATE__) && defined(__KERNEL_GPU__)
152#if defined(__INTEGRATOR_GPU_PACKED_STATE__) && defined(__KERNEL_GPU__)
158 "Generated packed_isect struct is misaligned with Intersection struct");
160 "Generated packed_isect struct is misaligned with Intersection struct");
162 "Generated packed_isect struct is misaligned with Intersection struct");
164 "Generated packed_isect struct is misaligned with Intersection struct");
166 "Generated packed_isect struct is misaligned with Intersection struct");
168 "Generated packed_isect struct is misaligned with Intersection struct");
182#if defined(__INTEGRATOR_GPU_PACKED_STATE__) && defined(__KERNEL_GPU__)
248 state, volume_stack, index,
object);
310#if defined(__KERNEL_GPU__)
319# define KERNEL_STRUCT_BEGIN(name) \
323# define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) \
324 if (kernel_integrator_state.parent_struct.name != nullptr) { \
325 kernel_integrator_state.parent_struct.name[to_state] = \
326 kernel_integrator_state.parent_struct.name[state]; \
329# ifdef __INTEGRATOR_GPU_PACKED_STATE__
330# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) \
331 KERNEL_STRUCT_BEGIN(parent_struct) \
332 KERNEL_STRUCT_MEMBER(parent_struct, packed_##parent_struct, packed, feature)
333# define KERNEL_STRUCT_MEMBER_PACKED(parent_struct, type, name, feature)
335# define KERNEL_STRUCT_MEMBER_PACKED KERNEL_STRUCT_MEMBER
336# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) KERNEL_STRUCT_BEGIN(parent_struct)
339# define KERNEL_STRUCT_ARRAY_MEMBER(parent_struct, type, name, feature) \
340 if (kernel_integrator_state.parent_struct[index].name != nullptr) { \
341 kernel_integrator_state.parent_struct[index].name[to_state] = \
342 kernel_integrator_state.parent_struct[index].name[state]; \
345# define KERNEL_STRUCT_END(name) \
350# define KERNEL_STRUCT_END_ARRAY(name, cpu_array_size, gpu_array_size) \
353 while (index < gpu_array_size) \
356# define KERNEL_STRUCT_VOLUME_STACK_SIZE kernel_data.volume_stack_size
360# undef KERNEL_STRUCT_BEGIN
361# undef KERNEL_STRUCT_BEGIN_PACKED
362# undef KERNEL_STRUCT_MEMBER
363# undef KERNEL_STRUCT_MEMBER_PACKED
364# undef KERNEL_STRUCT_ARRAY_MEMBER
365# undef KERNEL_STRUCT_END
366# undef KERNEL_STRUCT_END_ARRAY
367# undef KERNEL_STRUCT_VOLUME_STACK_SIZE
374 integrator_state_copy_only(kg, to_state,
state);
387# define KERNEL_STRUCT_BEGIN(name) \
391# define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) \
392 if (kernel_integrator_state.parent_struct.name != nullptr) { \
393 kernel_integrator_state.parent_struct.name[to_state] = \
394 kernel_integrator_state.parent_struct.name[state]; \
397# ifdef __INTEGRATOR_GPU_PACKED_STATE__
398# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) \
399 KERNEL_STRUCT_BEGIN(parent_struct) \
400 KERNEL_STRUCT_MEMBER(parent_struct, type, packed, feature)
401# define KERNEL_STRUCT_MEMBER_PACKED(parent_struct, type, name, feature)
403# define KERNEL_STRUCT_MEMBER_PACKED KERNEL_STRUCT_MEMBER
404# define KERNEL_STRUCT_BEGIN_PACKED(parent_struct, feature) KERNEL_STRUCT_BEGIN(parent_struct)
407# define KERNEL_STRUCT_ARRAY_MEMBER(parent_struct, type, name, feature) \
408 if (kernel_integrator_state.parent_struct[index].name != nullptr) { \
409 kernel_integrator_state.parent_struct[index].name[to_state] = \
410 kernel_integrator_state.parent_struct[index].name[state]; \
413# define KERNEL_STRUCT_END(name) \
418# define KERNEL_STRUCT_END_ARRAY(name, cpu_array_size, gpu_array_size) \
421 while (index < gpu_array_size) \
424# define KERNEL_STRUCT_VOLUME_STACK_SIZE kernel_data.volume_stack_size
428# undef KERNEL_STRUCT_BEGIN
429# undef KERNEL_STRUCT_BEGIN_PACKED
430# undef KERNEL_STRUCT_MEMBER
431# undef KERNEL_STRUCT_MEMBER_PACKED
432# undef KERNEL_STRUCT_ARRAY_MEMBER
433# undef KERNEL_STRUCT_END
434# undef KERNEL_STRUCT_END_ARRAY
435# undef KERNEL_STRUCT_VOLUME_STACK_SIZE
442 integrator_shadow_state_copy_only(kg, to_state,
state);
454#if defined(__KERNEL_GPU__)
458 integrator_state_copy_only(kg, to_state,
state);
463 to_state->path =
state->path;
464 to_state->ray =
state->ray;
465 to_state->isect =
state->isect;
467 integrator_state_copy_volume_stack(kg, to_state,
state);
474#ifndef __KERNEL_GPU__
554 const uint32_t path_flag)
561 const uint32_t path_flag)
568 const uint32_t path_flag)
575 const uint32_t path_flag)
583 const uint32_t path_flag)
591 const uint32_t path_flag)
ATOMIC_INLINE uint32_t atomic_fetch_and_add_uint32(uint32_t *p, uint32_t x)
ATTR_WARN_UNUSED_RESULT const BMVert * v
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
#define KERNEL_FEATURE_VOLUME
#define KERNEL_FEATURE_NODE_PORTAL
#define ccl_device_forceinline
#define INTEGRATOR_SHADOW_ISECT_SIZE
const ThreadKernelGlobalsCPU * KernelGlobals
#define ccl_device_inline
#define CCL_NAMESPACE_END
#define kernel_integrator_state
ccl_device_forceinline float differential_zero_compact()
IntegratorShadowStateCPU * IntegratorShadowState
#define INTEGRATOR_STATE_ARRAY_WRITE(state, nested_struct, array_index, member)
#define INTEGRATOR_STATE_WRITE(state, nested_struct, member)
#define INTEGRATOR_STATE(state, nested_struct, member)
const IntegratorShadowStateCPU * ConstIntegratorShadowState
#define INTEGRATOR_STATE_ARRAY(state, nested_struct, array_index, member)
IntegratorStateCPU * IntegratorState
const IntegratorStateCPU * ConstIntegratorState
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_ray_self(IntegratorShadowState state, const ccl_private Ray *ccl_restrict ray)
ccl_device_inline int integrator_state_transmission_bounce(ConstIntegratorState state, const int)
ccl_device_forceinline void integrator_state_write_shadow_isect(IntegratorShadowState state, const ccl_private Intersection *ccl_restrict isect, const int index)
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_forceinline void integrator_state_write_shadow_ray(IntegratorShadowState state, const ccl_private Ray *ccl_restrict ray)
ccl_device_inline IntegratorState integrator_state_shadow_catcher_split(KernelGlobals kg, IntegratorState state)
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_inline int integrator_state_diffuse_bounce(ConstIntegratorState state, const int)
CCL_NAMESPACE_BEGIN ccl_device_forceinline void integrator_state_write_ray(IntegratorState state, const ccl_private Ray *ccl_restrict ray)
ccl_device_inline int integrator_state_portal_bounce(KernelGlobals kg, ConstIntegratorState state, const int)
ccl_device_forceinline void integrator_state_write_isect(IntegratorState state, const ccl_private Intersection *ccl_restrict isect)
ccl_device_forceinline void integrator_state_read_shadow_ray_self(ConstIntegratorShadowState state, ccl_private Ray *ccl_restrict ray)