Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/split/kernel_direct_lighting.h
| Show All 34 Lines | |||||
| * State of queues when this kernel is called: | * State of queues when this kernel is called: | ||||
| * - State of queues QUEUE_ACTIVE_AND_REGENERATED_RAYS and | * - State of queues QUEUE_ACTIVE_AND_REGENERATED_RAYS and | ||||
| * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be same before and after this | * QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be same before and after this | ||||
| * kernel call. | * kernel call. | ||||
| * - QUEUE_SHADOW_RAY_CAST_DL_RAYS queue will be filled with rays for which a | * - QUEUE_SHADOW_RAY_CAST_DL_RAYS queue will be filled with rays for which a | ||||
| * shadow_blocked function must be executed, after this kernel call | * shadow_blocked function must be executed, after this kernel call | ||||
| * Before this kernel call the QUEUE_SHADOW_RAY_CAST_DL_RAYS will be empty. | * Before this kernel call the QUEUE_SHADOW_RAY_CAST_DL_RAYS will be empty. | ||||
| */ | */ | ||||
| ccl_device void kernel_direct_lighting(KernelGlobals *kg) | ccl_device void kernel_direct_lighting(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); | ||||
| char enqueue_flag = 0; | char enqueue_flag = 0; | ||||
| 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); | ||||
| ray_index = get_ray_index(kg, ray_index, | ray_index = get_ray_index(kg, ray_index, | ||||
| QUEUE_ACTIVE_AND_REGENERATED_RAYS, | QUEUE_ACTIVE_AND_REGENERATED_RAYS, | ||||
| kernel_split_state.queue_data, | kernel_split_state.queue_data, | ||||
| ▲ Show 20 Lines • Show All 69 Lines • ▼ Show 20 Lines | |||||
| #endif | #endif | ||||
| #ifdef __EMISSION__ | #ifdef __EMISSION__ | ||||
| /* Enqueue RAY_SHADOW_RAY_CAST_DL rays. */ | /* Enqueue RAY_SHADOW_RAY_CAST_DL rays. */ | ||||
| enqueue_ray_index_local(ray_index, | enqueue_ray_index_local(ray_index, | ||||
| QUEUE_SHADOW_RAY_CAST_DL_RAYS, | QUEUE_SHADOW_RAY_CAST_DL_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); | ||||
| #endif | #endif | ||||
| } | } | ||||
| CCL_NAMESPACE_END | CCL_NAMESPACE_END | ||||