Changeset View
Changeset View
Standalone View
Standalone View
intern/cycles/kernel/split/kernel_shadow_blocked.h
| Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | |||||
| * 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 & QUEUE_SHADOW_RAY_CAST_DL_RAYS will be filled with rays marked with flags RAY_SHADOW_RAY_CAST_AO | * QUEUE_SHADOW_RAY_CAST_AO_RAYS & QUEUE_SHADOW_RAY_CAST_DL_RAYS will be filled with rays marked with flags RAY_SHADOW_RAY_CAST_AO | ||||
| * and RAY_SHADOW_RAY_CAST_DL respectively, during kernel entry. | * and RAY_SHADOW_RAY_CAST_DL respectively, during kernel entry. | ||||
| * QUEUE_SHADOW_RAY_CAST_AO_RAYS and QUEUE_SHADOW_RAY_CAST_DL_RAYS will be empty at kernel exit. | * QUEUE_SHADOW_RAY_CAST_AO_RAYS and QUEUE_SHADOW_RAY_CAST_DL_RAYS will be empty at kernel exit. | ||||
| */ | */ | ||||
| ccl_device void kernel_shadow_blocked(KernelGlobals *kg) | ccl_device void kernel_shadow_blocked(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]; | ||||
| unsigned int dl_queue_length = kernel_split_params.queue_index[QUEUE_SHADOW_RAY_CAST_DL_RAYS]; | |||||
| ccl_local unsigned int ao_queue_length; | |||||
| ccl_local unsigned int dl_queue_length; | |||||
| if(lidx == 0) { | |||||
| ao_queue_length = kernel_split_params.queue_index[QUEUE_SHADOW_RAY_CAST_AO_RAYS]; | |||||
| dl_queue_length = kernel_split_params.queue_index[QUEUE_SHADOW_RAY_CAST_DL_RAYS]; | |||||
| } | |||||
| ccl_barrier(CCL_LOCAL_MEM_FENCE); | |||||
| /* flag determining if the current ray is to process shadow ray for AO or DL */ | /* flag determining if the current ray is to process shadow ray for AO or DL */ | ||||
| char shadow_blocked_type = -1; | char shadow_blocked_type = -1; | ||||
| 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 + dl_queue_length) { | if(thread_index < ao_queue_length + dl_queue_length) { | ||||
| if(thread_index < ao_queue_length) { | if(thread_index < ao_queue_length) { | ||||
| ▲ Show 20 Lines • Show All 45 Lines • Show Last 20 Lines | |||||