diff options
Diffstat (limited to 'intern/cycles/kernel/split/kernel_indirect_background.h')
-rw-r--r-- | intern/cycles/kernel/split/kernel_indirect_background.h | 72 |
1 files changed, 37 insertions, 35 deletions
diff --git a/intern/cycles/kernel/split/kernel_indirect_background.h b/intern/cycles/kernel/split/kernel_indirect_background.h index 4cf88a02590..b1c65f61e2c 100644 --- a/intern/cycles/kernel/split/kernel_indirect_background.h +++ b/intern/cycles/kernel/split/kernel_indirect_background.h @@ -18,48 +18,50 @@ CCL_NAMESPACE_BEGIN ccl_device void kernel_indirect_background(KernelGlobals *kg) { - ccl_global char *ray_state = kernel_split_state.ray_state; + ccl_global char *ray_state = kernel_split_state.ray_state; - int thread_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); - int ray_index; + int thread_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); + int ray_index; - if(kernel_data.integrator.ao_bounces != INT_MAX) { - ray_index = get_ray_index(kg, thread_index, - QUEUE_ACTIVE_AND_REGENERATED_RAYS, - kernel_split_state.queue_data, - kernel_split_params.queue_size, - 0); + if (kernel_data.integrator.ao_bounces != INT_MAX) { + ray_index = get_ray_index(kg, + thread_index, + QUEUE_ACTIVE_AND_REGENERATED_RAYS, + kernel_split_state.queue_data, + kernel_split_params.queue_size, + 0); - if(ray_index != QUEUE_EMPTY_SLOT) { - if(IS_STATE(ray_state, ray_index, RAY_ACTIVE)) { - ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; - if(path_state_ao_bounce(kg, state)) { - kernel_split_path_end(kg, ray_index); - } - } - } - } + if (ray_index != QUEUE_EMPTY_SLOT) { + if (IS_STATE(ray_state, ray_index, RAY_ACTIVE)) { + ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; + if (path_state_ao_bounce(kg, state)) { + kernel_split_path_end(kg, ray_index); + } + } + } + } - ray_index = get_ray_index(kg, thread_index, - QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, - kernel_split_state.queue_data, - kernel_split_params.queue_size, - 0); + ray_index = get_ray_index(kg, + thread_index, + QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, + kernel_split_state.queue_data, + kernel_split_params.queue_size, + 0); - if(ray_index == QUEUE_EMPTY_SLOT) { - return; - } + if (ray_index == QUEUE_EMPTY_SLOT) { + return; + } - if(IS_STATE(ray_state, ray_index, RAY_HIT_BACKGROUND)) { - ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; - PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; - ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; - float3 throughput = kernel_split_state.throughput[ray_index]; - ShaderData *sd = kernel_split_sd(sd, ray_index); + if (IS_STATE(ray_state, ray_index, RAY_HIT_BACKGROUND)) { + ccl_global PathState *state = &kernel_split_state.path_state[ray_index]; + PathRadiance *L = &kernel_split_state.path_radiance[ray_index]; + ccl_global Ray *ray = &kernel_split_state.ray[ray_index]; + float3 throughput = kernel_split_state.throughput[ray_index]; + ShaderData *sd = kernel_split_sd(sd, ray_index); - kernel_path_background(kg, state, ray, throughput, sd, L); - kernel_split_path_end(kg, ray_index); - } + kernel_path_background(kg, state, ray, throughput, sd, L); + kernel_split_path_end(kg, ray_index); + } } CCL_NAMESPACE_END |