45#if defined(__KERNEL_HIPRT__)
46# define BVH_PAYLOAD_SUBCLASS(cls, base_cls) struct cls : base_cls
47# define BVH_PAYLOAD_SUBCLASS_DEFINE(base_cls)
48# define BVH_PAYLOAD_BASE(obj) (obj)
50# define BVH_PAYLOAD_SUBCLASS(cls, base_cls) struct cls
51# define BVH_PAYLOAD_SUBCLASS_DEFINE(base_cls) base_cls base;
52# define BVH_PAYLOAD_BASE(obj) ((obj).base)
58#if !defined(__KERNEL_OPTIX__)
66#if defined(__KERNEL_HIPRT__)
74#if defined(__KERNEL_OPTIX__)
75# define BVH_SHADOW_ALL_PAYLOAD_SUBCLASS(cls, base_cls) struct cls
76# define BVH_SHADOW_ALL_PAYLOAD_SUBCLASS_DEFINE(base_cls)
78# define BVH_SHADOW_ALL_PAYLOAD_SUBCLASS(cls, base_cls) BVH_PAYLOAD_SUBCLASS(cls, base_cls)
79# define BVH_SHADOW_ALL_PAYLOAD_SUBCLASS_DEFINE(base_cls) BVH_PAYLOAD_SUBCLASS_DEFINE(base_cls)
88#if defined(__KERNEL_HIPRT__)
89 using UIntType = uint;
91 using UIntType = uint16_t;
98 UIntType max_transparent_hits;
101 UIntType num_transparent_hits = 0;
105 float max_record_isect_t;
108 UIntType record_isect_index = 0;
115 UIntType num_recorded_hits = 0;
130template<u
int perform_
intersection_tests, u
int enabled_primitive_types = PRIMITIVE_ALL>
136 const uint ray_visibility,
140#if defined(__VISIBILITY_FLAG__)
148#if defined(__SHADOW_LINKING__)
162#if !defined(__TRANSPARENT_SHADOWS__)
179 uint num_recorded_hits = payload.num_recorded_hits;
192# if !defined(__KERNEL_OPTIX__)
206 if (payload.num_transparent_hits > payload.max_transparent_hits) {
213# if defined(__HAIR__)
239 num_recorded_hits += 1;
240 payload.num_recorded_hits = num_recorded_hits;
243 if (num_recorded_hits <= max_record_hits || isect.
t < payload.max_record_isect_t) {
246 if (num_recorded_hits >= max_record_hits) {
249 uint record_isect_index = 0;
251 for (uint i = 1; i < max_record_hits; ++i) {
253 if (isect_t > tmax_hits) {
254 record_isect_index = i;
258 payload.max_record_isect_t = tmax_hits;
259 payload.record_isect_index = record_isect_index;
262 payload.record_isect_index = num_recorded_hits;
278template<
bool do_visibility_check = true>
284 const uint ray_visibility)
286#ifdef __VISIBILITY_FLAG__
287 if constexpr (do_visibility_check) {
ccl_device_forceinline int intersection_get_shader_flags(KernelGlobals kg, const int prim, const int type)
ccl_device_inline bool intersection_skip_shadow_link(KernelGlobals kg, const ccl_ray_data RaySelfPrimitives &self, const int isect_object)
ccl_device_inline bool intersection_skip_self_shadow(const ccl_ray_data RaySelfPrimitives &self, const int object, const int prim)
ccl_device_inline bool intersection_skip_self(const ccl_ray_data RaySelfPrimitives &self, const int object, const int prim)
#define CURVE_SHADOW_TRANSPARENCY_CUTOFF
ccl_device_forceinline bool intersection_skip_shadow_already_recoded(IntegratorShadowState state, const int object, const int prim, const uint num_hits)
ccl_device_inline float3 intersection_curve_shadow_transparency(KernelGlobals kg, const int object, const int prim, const int type, const float u)
#define ccl_device_forceinline
#define kernel_data_fetch(name, index)
#define INTEGRATOR_SHADOW_ISECT_SIZE
#define CCL_NAMESPACE_END
float reduce_max(float2 a)
ccl_device_forceinline bool bvh_shadow_all_anyhit_filter(KernelGlobals kg, IntegratorShadowState state, ccl_ray_data BVHShadowAllPayload &ccl_restrict payload, const ccl_ray_data RaySelfPrimitives &ccl_restrict ray_self, const uint ray_visibility, const Intersection isect)
#define BVH_SHADOW_ALL_PAYLOAD_SUBCLASS_DEFINE(base_cls)
ccl_device_forceinline bool bvh_volume_anyhit_triangle_filter(KernelGlobals kg, const int object, const int prim, const ccl_ray_data RaySelfPrimitives &ccl_restrict ray_self, const uint ray_visibility)
@ ISECT_TEST_VISIBILITY_FLAG
@ ISECT_TEST_SHADOW_LINKING
#define BVH_SHADOW_ALL_PAYLOAD_SUBCLASS(cls, base_cls)
@ SD_HAS_TRANSPARENT_SHADOW
ccl_device_inline float3 one_float3()
CCL_NAMESPACE_BEGIN ccl_device_inline float3 zero_float3()
IntegratorShadowStateCPU * IntegratorShadowState
#define INTEGRATOR_STATE_ARRAY(state, nested_struct, array_index, member)
ccl_device_forceinline void integrator_state_write_shadow_isect(IntegratorShadowState state, const ccl_private Intersection *ccl_restrict isect, const int index)
RaySelfPrimitives ray_self