diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-03-14 16:44:52 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-03-16 13:27:17 +0300 |
commit | 26620f3f871807d6a7dc2f2419dc67a5f196d605 (patch) | |
tree | b973d2d8dc4424b99bc5974a7ece947a90234aed /intern | |
parent | 4833a71621c3948e5ef24f5d0b2b6596b07b38e5 (diff) |
Cycles: Avoid some ccl_local in various kernels
Diffstat (limited to 'intern')
5 files changed, 5 insertions, 24 deletions
diff --git a/intern/cycles/kernel/split/kernel_do_volume.h b/intern/cycles/kernel/split/kernel_do_volume.h index 18da6e8aa3a..b1df45d6bb2 100644 --- a/intern/cycles/kernel/split/kernel_do_volume.h +++ b/intern/cycles/kernel/split/kernel_do_volume.h @@ -25,10 +25,7 @@ ccl_device void kernel_do_volume(KernelGlobals *kg) kernel_split_params.queue_index[QUEUE_ACTIVE_AND_REGENERATED_RAYS] = 0; } /* Fetch use_queues_flag. */ - ccl_local char local_use_queues_flag; - if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { - local_use_queues_flag = *kernel_split_params.use_queues_flag; - } + char local_use_queues_flag = *kernel_split_params.use_queues_flag; ccl_barrier(CCL_LOCAL_MEM_FENCE); int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); diff --git a/intern/cycles/kernel/split/kernel_lamp_emission.h b/intern/cycles/kernel/split/kernel_lamp_emission.h index f61643cceef..c669d79ddcd 100644 --- a/intern/cycles/kernel/split/kernel_lamp_emission.h +++ b/intern/cycles/kernel/split/kernel_lamp_emission.h @@ -29,10 +29,7 @@ ccl_device void kernel_lamp_emission(KernelGlobals *kg) } #endif /* Fetch use_queues_flag. */ - ccl_local char local_use_queues_flag; - if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { - local_use_queues_flag = *kernel_split_params.use_queues_flag; - } + char local_use_queues_flag = *kernel_split_params.use_queues_flag; ccl_barrier(CCL_LOCAL_MEM_FENCE); int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); diff --git a/intern/cycles/kernel/split/kernel_scene_intersect.h b/intern/cycles/kernel/split/kernel_scene_intersect.h index 33d0df7a2cb..66f549f59b7 100644 --- a/intern/cycles/kernel/split/kernel_scene_intersect.h +++ b/intern/cycles/kernel/split/kernel_scene_intersect.h @@ -26,10 +26,7 @@ CCL_NAMESPACE_BEGIN ccl_device void kernel_scene_intersect(KernelGlobals *kg) { /* Fetch use_queues_flag */ - ccl_local char local_use_queues_flag; - if(ccl_local_id(0) == 0 && ccl_local_id(1) == 0) { - local_use_queues_flag = *kernel_split_params.use_queues_flag; - } + char local_use_queues_flag = *kernel_split_params.use_queues_flag; ccl_barrier(CCL_LOCAL_MEM_FENCE); int ray_index = ccl_global_id(1) * ccl_global_size(0) + ccl_global_id(0); diff --git a/intern/cycles/kernel/split/kernel_shadow_blocked_ao.h b/intern/cycles/kernel/split/kernel_shadow_blocked_ao.h index a1eb0d1eccd..4243e18de72 100644 --- a/intern/cycles/kernel/split/kernel_shadow_blocked_ao.h +++ b/intern/cycles/kernel/split/kernel_shadow_blocked_ao.h @@ -19,12 +19,7 @@ CCL_NAMESPACE_BEGIN /* Shadow ray cast for AO. */ ccl_device void kernel_shadow_blocked_ao(KernelGlobals *kg) { - int lidx = ccl_local_id(1) * ccl_local_id(0) + ccl_local_id(0); - - ccl_local unsigned int ao_queue_length; - if(lidx == 0) { - ao_queue_length = kernel_split_params.queue_index[QUEUE_SHADOW_RAY_CAST_AO_RAYS]; - } + unsigned int 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; diff --git a/intern/cycles/kernel/split/kernel_shadow_blocked_dl.h b/intern/cycles/kernel/split/kernel_shadow_blocked_dl.h index 2e5629944dc..bb8f0157965 100644 --- a/intern/cycles/kernel/split/kernel_shadow_blocked_dl.h +++ b/intern/cycles/kernel/split/kernel_shadow_blocked_dl.h @@ -19,12 +19,7 @@ CCL_NAMESPACE_BEGIN /* Shadow ray cast for direct visible light. */ ccl_device void kernel_shadow_blocked_dl(KernelGlobals *kg) { - int lidx = ccl_local_id(1) * ccl_local_id(0) + ccl_local_id(0); - - ccl_local unsigned int dl_queue_length; - if(lidx == 0) { - dl_queue_length = kernel_split_params.queue_index[QUEUE_SHADOW_RAY_CAST_DL_RAYS]; - } + unsigned int dl_queue_length = kernel_split_params.queue_index[QUEUE_SHADOW_RAY_CAST_DL_RAYS]; ccl_barrier(CCL_LOCAL_MEM_FENCE); int ray_index = QUEUE_EMPTY_SLOT; |