diff options
Diffstat (limited to 'intern/cycles/kernel/split/kernel_split_common.h')
-rw-r--r-- | intern/cycles/kernel/split/kernel_split_common.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/intern/cycles/kernel/split/kernel_split_common.h b/intern/cycles/kernel/split/kernel_split_common.h index 21886ee62ee..b52e7bddc82 100644 --- a/intern/cycles/kernel/split/kernel_split_common.h +++ b/intern/cycles/kernel/split/kernel_split_common.h @@ -59,7 +59,12 @@ ccl_device_inline void kernel_split_path_end(KernelGlobals *kg, int ray_index) ccl_global char *ray_state = kernel_split_state.ray_state; #ifdef __BRANCHED_PATH__ - if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT_SHARED)) { + ccl_addr_space SubsurfaceIndirectRays *ss_indirect = &kernel_split_state.ss_rays[ray_index]; + + if(ss_indirect->num_rays) { + ASSIGN_RAY_STATE(ray_state, ray_index, RAY_UPDATE_BUFFER); + } + else if(IS_FLAG(ray_state, ray_index, RAY_BRANCHED_INDIRECT_SHARED)) { int orig_ray = kernel_split_state.branched_state[ray_index].original_ray; PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; |