16#ifdef __SHADOW_LINKING__
18# define SHADOW_LINK_MAX_INTERSECTION_COUNT 1024
30 const int object_receiver,
38 const float old_tmin = ray->tmin;
47 for (
int i = 0; i < SHADOW_LINK_MAX_INTERSECTION_COUNT; i++) {
71 *linked_isect = current_isect;
80 if (blocker_set == 0) {
81 ray->tmax = current_isect.t;
90 if (transparent_bounce >=
kernel_data.integrator.transparent_max_bounce) {
91 ray->tmax = current_isect.t;
98 if (volume_bounce >=
kernel_data.integrator.max_volume_bounce) {
99 ray->tmax = current_isect.t;
109 ray->tmin = old_tmin;
147 num_hits = shadow_linking_pick_mesh_intersection(
148 kg,
state, ray, object_receiver, linked_isect, &lcg_state, num_hits);
192 if (!shadow_linking_pick_light_intersection(kg,
state, &ray, &isect)) {
200 shadow_linking_store_last_primitives(
state);
220#ifdef __SHADOW_LINKING__
221 if (shadow_linking_intersect(kg,
state)) {
225 kernel_assert(!
"integrator_intersect_dedicated_light is not supposed to be scheduled");
ccl_device_forceinline float intersection_t_offset(const float t)
ccl_device_forceinline int intersection_get_shader(KernelGlobals kg, ccl_private const Intersection *ccl_restrict isect)
#define kernel_assert(cond)
const KernelGlobalsCPU *ccl_restrict KernelGlobals
#define kernel_data_fetch(name, index)
#define ccl_optional_struct_init
#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, ccl_private const Ray *ray, const uint visibility, ccl_private Intersection *isect)
ccl_device int lights_intersect_shadow_linked(KernelGlobals kg, ccl_private const 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 bool light_link_object_match(KernelGlobals kg, const int object_receiver, const int object_emitter)
ccl_device_inline int light_link_receiver_forward(KernelGlobals kg, IntegratorState state)
@ SD_HAS_TRANSPARENT_SHADOW
#define LIGHT_LINK_MASK_ALL
@ DEVICE_KERNEL_INTEGRATOR_SHADE_DEDICATED_LIGHT
@ DEVICE_KERNEL_INTEGRATOR_INTERSECT_DEDICATED_LIGHT
#define PROFILING_INIT(kg, event)
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)
ccl_device_inline uint path_state_ray_visibility(ConstIntegratorState state)
ccl_device_forceinline void integrator_shade_surface_next_kernel(KernelGlobals kg, IntegratorState state)
IntegratorStateCPU *ccl_restrict IntegratorState
#define INTEGRATOR_STATE_WRITE(state, nested_struct, member)
#define INTEGRATOR_STATE(state, nested_struct, member)
ccl_device_forceinline void integrator_path_next(KernelGlobals kg, 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, ccl_private const Intersection *ccl_restrict isect)
unsigned __int64 uint64_t
@ PROFILING_INTERSECT_DEDICATED_LIGHT