Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/split/kernel_buffer_update.h
| Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
| * State of queues when this kernel is called : | * State of queues when this kernel is called : | ||||
| * At entry, | * At entry, | ||||
| * QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE rays | * QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE rays | ||||
| * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with RAY_UPDATE_BUFFER, RAY_HIT_BACKGROUND, RAY_TO_REGENERATE rays | * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with RAY_UPDATE_BUFFER, RAY_HIT_BACKGROUND, RAY_TO_REGENERATE rays | ||||
| * At exit, | * At exit, | ||||
| * QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE and RAY_REGENERATED rays | * QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE and RAY_REGENERATED rays | ||||
| * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be empty | * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be empty | ||||
| */ | */ | ||||
| ccl_device void kernel_buffer_update(KernelGlobals *kg) | ccl_device void kernel_buffer_update(KernelGlobals *kg, | ||||
| ccl_local_param unsigned int *local_queue_atomics) | |||||
| { | { | ||||
| ccl_local unsigned int local_queue_atomics; | |||||
| 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); | ||||
| if(ray_index == 0) { | if(ray_index == 0) { | ||||
| /* We will empty this queue in this kernel. */ | /* We will empty this queue in this kernel. */ | ||||
| kernel_split_params.queue_index[QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS] = 0; | kernel_split_params.queue_index[QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS] = 0; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 129 Lines • ▼ Show 20 Lines | #endif | ||||
| /* Enqueue RAY_REGENERATED rays into QUEUE_ACTIVE_AND_REGENERATED_RAYS; | /* Enqueue RAY_REGENERATED rays into QUEUE_ACTIVE_AND_REGENERATED_RAYS; | ||||
| * These rays will be made active during next SceneIntersectkernel. | * These rays will be made active during next SceneIntersectkernel. | ||||
| */ | */ | ||||
| enqueue_ray_index_local(ray_index, | enqueue_ray_index_local(ray_index, | ||||
| QUEUE_ACTIVE_AND_REGENERATED_RAYS, | QUEUE_ACTIVE_AND_REGENERATED_RAYS, | ||||
| enqueue_flag, | enqueue_flag, | ||||
| kernel_split_params.queue_size, | kernel_split_params.queue_size, | ||||
| &local_queue_atomics, | local_queue_atomics, | ||||
| kernel_split_state.queue_data, | kernel_split_state.queue_data, | ||||
| kernel_split_params.queue_index); | kernel_split_params.queue_index); | ||||
| } | } | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||