Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/split/kernel_shadow_blocked_ao.h
| Show All 39 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 QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be same | * state of queues QUEUE_ACTIVE_AND_REGENERATED_RAYS and QUEUE_HITBG_BUFF_UPDATE_TOREGEN_RAYS will be same | ||||
| * before and after this kernel call. | * before and after this kernel call. | ||||
| * QUEUE_SHADOW_RAY_CAST_AO_RAYS will be filled with rays marked with flags RAY_SHADOW_RAY_CAST_AO during kernel entry. | * QUEUE_SHADOW_RAY_CAST_AO_RAYS will be filled with rays marked with flags RAY_SHADOW_RAY_CAST_AO during kernel entry. | ||||
| * QUEUE_SHADOW_RAY_CAST_AO_RAYS will be empty at kernel exit. | * QUEUE_SHADOW_RAY_CAST_AO_RAYS will be empty at kernel exit. | ||||
| */ | */ | ||||
| ccl_device void kernel_shadow_blocked_ao(KernelGlobals *kg) | ccl_device void kernel_shadow_blocked_ao(KernelGlobals *kg) | ||||
| { | { | ||||
| int lidx = ccl_local_id(1) * ccl_local_id(0) + ccl_local_id(0); | unsigned int ao_queue_length = kernel_split_params.queue_index[QUEUE_SHADOW_RAY_CAST_AO_RAYS]; | ||||
| ccl_local unsigned int ao_queue_length; | |||||
| if(lidx == 0) { | |||||
| ao_queue_length = kernel_split_params.queue_index[QUEUE_SHADOW_RAY_CAST_AO_RAYS]; | |||||
| } | |||||
| ccl_barrier(CCL_LOCAL_MEM_FENCE); | |||||
| int ray_index = QUEUE_EMPTY_SLOT; | int ray_index = QUEUE_EMPTY_SLOT; | ||||
| int thread_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); | int thread_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); | ||||
| if(thread_index < ao_queue_length) { | if(thread_index < ao_queue_length) { | ||||
| ray_index = get_ray_index(kg, thread_index, QUEUE_SHADOW_RAY_CAST_AO_RAYS, | ray_index = get_ray_index(kg, thread_index, QUEUE_SHADOW_RAY_CAST_AO_RAYS, | ||||
| kernel_split_state.queue_data, kernel_split_params.queue_size, 1); | kernel_split_state.queue_data, kernel_split_params.queue_size, 1); | ||||
| } | } | ||||
| Show All 29 Lines | |||||