Fix T44833: Can't use ccl_local space in non-kernel functions
authorSergey Sharybin <sergey.vfx@gmail.com>
Tue, 26 May 2015 14:12:49 +0000 (19:12 +0500)
committerSergey Sharybin <sergey.vfx@gmail.com>
Tue, 26 May 2015 17:54:02 +0000 (22:54 +0500)
commit84ad20acef4c0db91c9a850e81c7dc0a57aef42a
treec789ed8b455b6870ea12b87a2dc7ed3c28d77102
parent4ffcc6ff56b60d1cc69e12a80c9c2cacd604688f
Fix T44833: Can't use ccl_local space in non-kernel functions

This commit re-shuffles code in split kernel once again and makes it so common
parts which is in the headers is only responsible to making all the work needed
for specified ray index. Getting ray index, checking for it's validity and
enqueuing tasks are now happening in the device specified part of the kernel.

This actually makes sense because enqueuing is indeed device-specified and i.e.
with CUDA we'll want to enqueue kernels from kernel and avoid CPU roundtrip.

TODO:
- Kernel comments are still placed in the common header files, but since queue
  related stuff is not passed to those functions those comments might need to
  be split as well.

  Just currently read them considering that they're also covering the way how
  all devices are invoking the common code path.

- Arguments might need to be wrapped into KernelGlobals, so we don't ened to
  pass all them around as function arguments.
22 files changed:
intern/cycles/kernel/CMakeLists.txt
intern/cycles/kernel/kernels/opencl/kernel_background_buffer_update.cl
intern/cycles/kernel/kernels/opencl/kernel_data_init.cl
intern/cycles/kernel/kernels/opencl/kernel_direct_lighting.cl
intern/cycles/kernel/kernels/opencl/kernel_holdout_emission_blurring_pathtermination_ao.cl
intern/cycles/kernel/kernels/opencl/kernel_lamp_emission.cl
intern/cycles/kernel/kernels/opencl/kernel_next_iteration_setup.cl
intern/cycles/kernel/kernels/opencl/kernel_queue_enqueue.cl
intern/cycles/kernel/kernels/opencl/kernel_scene_intersect.cl
intern/cycles/kernel/kernels/opencl/kernel_shader_eval.cl
intern/cycles/kernel/kernels/opencl/kernel_shadow_blocked.cl
intern/cycles/kernel/split/kernel_background_buffer_update.h
intern/cycles/kernel/split/kernel_data_init.h
intern/cycles/kernel/split/kernel_direct_lighting.h
intern/cycles/kernel/split/kernel_holdout_emission_blurring_pathtermination_ao.h
intern/cycles/kernel/split/kernel_lamp_emission.h
intern/cycles/kernel/split/kernel_next_iteration_setup.h
intern/cycles/kernel/split/kernel_queue_enqueue.h [deleted file]
intern/cycles/kernel/split/kernel_scene_intersect.h
intern/cycles/kernel/split/kernel_shader_eval.h
intern/cycles/kernel/split/kernel_shadow_blocked.h
intern/cycles/kernel/split/kernel_sum_all_radiance.h