Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/split/kernel_shader_setup.h
| Show All 27 Lines | ccl_device void kernel_shader_setup(KernelGlobals *kg, | ||||
| /* Enqeueue RAY_TO_REGENERATE rays into QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS queue. */ | /* Enqeueue RAY_TO_REGENERATE rays into QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS queue. */ | ||||
| if (ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { | if (ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { | ||||
| *local_queue_atomics = 0; | *local_queue_atomics = 0; | ||||
| } | } | ||||
| ccl_barrier(CCL_LOCAL_MEM_FENCE); | ccl_barrier(CCL_LOCAL_MEM_FENCE); | ||||
| int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); | int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); | ||||
| int queue_index = kernel_split_params.queue_index[QUEUE_ACTIVE_AND_REGENERATED_RAYS]; | int queue_index = kernel_split_params.queue_index[QUEUE_ACTIVE_AND_REGENERATED_RAYS]; | ||||
| if (ray_index >= queue_index) { | if (ray_index < queue_index) { | ||||
| return; | |||||
| } | |||||
| ray_index = get_ray_index(kg, | ray_index = get_ray_index(kg, | ||||
| ray_index, | ray_index, | ||||
| QUEUE_ACTIVE_AND_REGENERATED_RAYS, | QUEUE_ACTIVE_AND_REGENERATED_RAYS, | ||||
| kernel_split_state.queue_data, | kernel_split_state.queue_data, | ||||
| kernel_split_params.queue_size, | kernel_split_params.queue_size, | ||||
| 0); | 0); | ||||
| } else { | |||||
| if (ray_index == QUEUE_EMPTY_SLOT) { | ray_index = QUEUE_EMPTY_SLOT; | ||||
| return; | |||||
| } | } | ||||
| char enqueue_flag = (IS_STATE(kernel_split_state.ray_state, ray_index, RAY_TO_REGENERATE)) ? 1 : | char enqueue_flag = (IS_STATE(kernel_split_state.ray_state, ray_index, RAY_TO_REGENERATE)) ? 1 : | ||||
| 0; | 0; | ||||
| enqueue_ray_index_local(ray_index, | enqueue_ray_index_local(ray_index, | ||||
| QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, | QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS, | ||||
| enqueue_flag, | enqueue_flag, | ||||
| kernel_split_params.queue_size, | kernel_split_params.queue_size, | ||||
| Show All 21 Lines | |||||