19#ifdef __SHADOW_LINKING__
21# define SHADOW_LINK_MAX_INTERSECTION_COUNT 1024
33 const int object_receiver,
41 const float old_tmin = ray->tmin;
50 for (
int i = 0;
i < SHADOW_LINK_MAX_INTERSECTION_COUNT;
i++) {
74 *linked_isect = current_isect;
83 if (blocker_set == 0) {
84 ray->tmax = current_isect.t;
92 ++volume_bounds_bounce;
94 ray->tmax = current_isect.t;
100 ++transparent_bounce;
101 if (transparent_bounce >=
kernel_data.integrator.transparent_max_bounce) {
102 ray->tmax = current_isect.t;
112 ray->tmin = old_tmin;
150 num_hits = shadow_linking_pick_mesh_intersection(
151 kg,
state, ray, object_receiver, linked_isect, &lcg_state, num_hits);
194 if (!shadow_linking_pick_light_intersection(kg,
state, &ray, &isect)) {
202 shadow_linking_store_last_primitives(
state);
221#ifdef __SHADOW_LINKING__
222 if (shadow_linking_intersect(kg,
state)) {
226 kernel_assert(!
"integrator_intersect_dedicated_light is not supposed to be scheduled");
unsigned long long int uint64_t
ccl_device_forceinline float intersection_t_offset(const float t)
ccl_device_forceinline int intersection_get_shader(KernelGlobals kg, const ccl_private Intersection *ccl_restrict isect)
#define kernel_assert(cond)
#define VOLUME_BOUNDS_MAX
#define ccl_optional_struct_init
#define kernel_data_fetch(name, index)
const ThreadKernelGlobalsCPU * KernelGlobals
#define LIGHT_LINK_MASK_ALL
#define CCL_NAMESPACE_END
CCL_NAMESPACE_BEGIN ccl_device void integrator_intersect_dedicated_light(KernelGlobals kg, IntegratorState state)
ccl_device_intersect bool scene_intersect(KernelGlobals kg, const ccl_private Ray *ray, const uint visibility, ccl_private Intersection *isect)
ccl_device_inline bool light_link_object_match(KernelGlobals kg, const int object_receiver, const int object_emitter)
ccl_device int lights_intersect_shadow_linked(KernelGlobals kg, const ccl_private Ray *ccl_restrict ray, ccl_private Intersection *ccl_restrict isect, const int last_prim, const int last_object, const int last_type, const uint32_t path_flag, const int receiver_forward, ccl_private uint *lcg_state, const int num_hits)
ccl_device_inline int light_link_receiver_forward(KernelGlobals kg, IntegratorState state)
@ SD_HAS_TRANSPARENT_SHADOW
@ DEVICE_KERNEL_INTEGRATOR_SHADE_DEDICATED_LIGHT
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_DEDICATED_LIGHT
ccl_device_inline uint lcg_state_init(const uint rng_hash, const uint rng_offset, const uint sample, const uint scramble)
ccl_device float lcg_step_float(T rng)
#define PROFILING_INIT(kg, event)
ccl_device_inline uint path_state_ray_visibility(ConstIntegratorState state)
@ PROFILING_INTERSECT_DEDICATED_LIGHT
ccl_device_forceinline void integrator_shade_surface_next_kernel(IntegratorState state)
#define INTEGRATOR_STATE_WRITE(state, nested_struct, member)
#define INTEGRATOR_STATE(state, nested_struct, member)
IntegratorStateCPU * IntegratorState
ccl_device_forceinline void integrator_path_next(IntegratorState state, const DeviceKernel current_kernel, const DeviceKernel next_kernel)
ccl_device_forceinline void integrator_state_read_ray(ConstIntegratorState state, ccl_private Ray *ccl_restrict ray)
ccl_device_forceinline void integrator_state_write_isect(IntegratorState state, const ccl_private Intersection *ccl_restrict isect)