[Bf-blender-cvs] [26620f3f87] master: Cycles: Avoid some ccl_local in various kernels
Sergey Sharybin
noreply at git.blender.org
Thu Mar 16 11:29:49 CET 2017
Commit: 26620f3f871807d6a7dc2f2419dc67a5f196d605
Author: Sergey Sharybin
Date: Tue Mar 14 14:44:52 2017 +0100
Branches: master
https://developer.blender.org/rB26620f3f871807d6a7dc2f2419dc67a5f196d605
Cycles: Avoid some ccl_local in various kernels
===================================================================
M intern/cycles/kernel/split/kernel_do_volume.h
M intern/cycles/kernel/split/kernel_lamp_emission.h
M intern/cycles/kernel/split/kernel_scene_intersect.h
M intern/cycles/kernel/split/kernel_shadow_blocked_ao.h
M intern/cycles/kernel/split/kernel_shadow_blocked_dl.h
===================================================================
diff --git a/intern/cycles/kernel/split/kernel_do_volume.h b/intern/cycles/kernel/split/kernel_do_volume.h
index 18da6e8aa3..b1df45d6bb 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 f61643ccee..c669d79ddc 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 33d0df7a2c..66f549f59b 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 a1eb0d1ecc..4243e18de7 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 2e5629944d..bb8f015796 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;
More information about the Bf-blender-cvs
mailing list