Cycles: Define ccl_local variables in kernel functions

Declaring ccl_local in a device function is not supported
by certain compilers.
This commit is contained in:
Sergey Sharybin
2017-03-08 13:34:29 +01:00
parent 1ff753baa4
commit 1cad64900e
18 changed files with 94 additions and 61 deletions

View File

@@ -40,11 +40,11 @@ CCL_NAMESPACE_BEGIN
* shadow_blocked function must be executed, after this kernel call
* 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) {
local_queue_atomics = 0;
*local_queue_atomics = 0;
}
ccl_barrier(CCL_LOCAL_MEM_FENCE);
@@ -130,7 +130,7 @@ ccl_device void kernel_direct_lighting(KernelGlobals *kg)
QUEUE_SHADOW_RAY_CAST_DL_RAYS,
enqueue_flag,
kernel_split_params.queue_size,
&local_queue_atomics,
local_queue_atomics,
kernel_split_state.queue_data,
kernel_split_params.queue_index);
#endif