Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/split/kernel_next_iteration_setup.h
| Show First 20 Lines • Show All 53 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, RAY_REGENERATED, RAY_UPDATE_BUFFER rays. | * QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE, RAY_REGENERATED, RAY_UPDATE_BUFFER rays. | ||||
| * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with RAY_TO_REGENERATE and RAY_UPDATE_BUFFER rays | * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with RAY_TO_REGENERATE and RAY_UPDATE_BUFFER rays | ||||
| * At exit, | * At exit, | ||||
| * QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE, RAY_REGENERATED and more RAY_UPDATE_BUFFER rays. | * QUEUE_ACTIVE_AND_REGENERATED_RAYS will be filled with RAY_ACTIVE, RAY_REGENERATED and more RAY_UPDATE_BUFFER rays. | ||||
| * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with RAY_TO_REGENERATE and more RAY_UPDATE_BUFFER rays | * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be filled with RAY_TO_REGENERATE and more RAY_UPDATE_BUFFER rays | ||||
| */ | */ | ||||
| ccl_device void kernel_next_iteration_setup(KernelGlobals *kg) | ccl_device void kernel_next_iteration_setup(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); | ||||
| if(ccl_global_id(0) == 0 && ccl_global_id(1) == 0) { | if(ccl_global_id(0) == 0 && ccl_global_id(1) == 0) { | ||||
| /* If we are here, then it means that scene-intersect kernel | /* If we are here, then it means that scene-intersect kernel | ||||
| * has already been executed atleast once. From the next time, | * has already been executed atleast once. From the next time, | ||||
| * scene-intersect kernel may operate on queues to fetch ray index | * scene-intersect kernel may operate on queues to fetch ray index | ||||
| */ | */ | ||||
| ▲ Show 20 Lines • Show All 96 Lines • ▼ Show 20 Lines | #ifndef __COMPUTE_DEVICE_GPU__ | ||||
| } | } | ||||
| #endif | #endif | ||||
| /* Enqueue RAY_UPDATE_BUFFER rays. */ | /* Enqueue RAY_UPDATE_BUFFER rays. */ | ||||
| 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, | ||||
| &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 | ||||