blender/intern/cycles/kernel
Sergey Sharybin 23bf3b09dd Cycles: Fix usage of memory barriers in split kernel
On user level this fixes dead-lock of OpenCL render on Intel Iris GPUs.
Note that this patch does not include change in the logic which allows
or disallows OpenCL platforms to be used, that will happen after the
kernel fix is known to be fine for the currently officially supported
platforms.

The dead-lock was caused by wrong usage of memory barriers: as per the
OpenCL specification the barrier is to be executed by the entire work
group. This means, that the following code is invalid:

  void foo() {
    if (some_condition) {
      return;
    }
    barrier(CLK_LOCAL_MEM_FENCE);
  }

  void bar() {
    foo();
  }

The Cycles code was mentioning this as an invalid code on CPU, while in
fact this is invalid as per specification. From the implementation side
this change removes the ifdefs around the CPU-only barrier logic, and
is implementing similar logic in the shader setup kernel.

Tested on NUC8i7HVK NUC.

The root cause of the dead-lock was identified by Max Dmitrichenko.

There is no measurable difference in performance of currently supported
OpenCL platforms.

Differential Revision: https://developer.blender.org/D9039
2020-10-07 10:17:56 +02:00
..
bvh Fix T77106: Cycles crash baking with AO shader node 2020-06-02 06:25:08 +02:00
closure Cycles: Refactor microfacet BSDFs to remove separate anisotropy code 2020-06-25 10:06:52 +02:00
filter Cleanup: extra semicolons, comma use, undeclared vars 2020-02-11 12:04:50 +11:00
geom Fix T74939: Random Walk subsurface appearance in OptiX does not match other engines 2020-03-26 13:00:09 +01:00
kernels Fix T76947: Optix realtime denoiser progressively reduces brightness of very bright objects 2020-05-27 15:17:47 +02:00
osl Fix T77915: Cycles OSL microfacet closure not working in custom shaders 2020-06-25 10:07:09 +02:00
shaders Shading: add Roughness input to Noise and Wave texture nodes 2020-04-09 21:48:03 +02:00
split Cycles: Fix usage of memory barriers in split kernel 2020-10-07 10:17:56 +02:00
svm Cycles: Refactor microfacet BSDFs to remove separate anisotropy code 2020-06-25 10:06:52 +02:00
CMakeLists.txt Cycles: mark CUDA 10.2 as officially supported 2020-05-05 15:06:49 +02:00
kernel.h Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
kernel_accumulate.h Cycles: move sss and diffuse transmission into diffuse pass 2020-02-25 11:44:47 +01:00
kernel_adaptive_sampling.h Fix T76925: more Cycles OpenCL compile errors with some drivers on Linux 2020-05-25 17:06:10 +02:00
kernel_bake.h Cycles: move sss and diffuse transmission into diffuse pass 2020-02-25 11:44:47 +01:00
kernel_camera.h Cycles: fixes for building kernel without certain features 2019-08-26 10:10:35 +02:00
kernel_color.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_compat_cpu.h Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
kernel_compat_cuda.h Fix T75895: Unable to Compile Cycles on NAVI/Linux 2020-04-30 15:04:40 +02:00
kernel_compat_opencl.h Fix T76469: OpenCL 1.2 Compilation 2020-05-07 14:34:50 +02:00
kernel_compat_optix.h Fix T75895: Unable to Compile Cycles on NAVI/Linux 2020-04-30 15:04:40 +02:00
kernel_differential.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_emission.h Cycles: move sss and diffuse transmission into diffuse pass 2020-02-25 11:44:47 +01:00
kernel_film.h Fix T76925: Cycles OpenCL compile error with some drivers on Linux 2020-05-22 21:50:24 +02:00
kernel_globals.h Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
kernel_id_passes.h Cleanup: comments (long lines) in cycles 2019-05-01 21:41:07 +10:00
kernel_jitter.h Fix T74423: Cycles rendering artifacts with CUDA 10.2 2020-04-22 16:40:52 +02:00
kernel_light.h Cycles: GPU code generation optimizations for direct lighting 2019-08-26 10:26:53 +02:00
kernel_math.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_montecarlo.h Cleanup: comments (long lines) in cycles 2019-05-01 21:41:07 +10:00
kernel_passes.h Cleanup: refactor adaptive sampling to more easily change some parameters 2020-04-07 20:29:48 +02:00
kernel_path.h Fix T76925: more Cycles OpenCL compile errors with some drivers on Linux 2020-05-25 17:06:10 +02:00
kernel_path_branched.h Fix T76925: more Cycles OpenCL compile errors with some drivers on Linux 2020-05-25 17:06:10 +02:00
kernel_path_common.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_path_state.h Cycles: Track specular throughput to account for reflection color in denoising albedo pass 2020-02-06 03:37:48 +01:00
kernel_path_subsurface.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_path_surface.h Cycles: perform clamping per light contribution instead of whole path 2019-12-12 13:04:43 +01:00
kernel_path_volume.h Cycles: perform clamping per light contribution instead of whole path 2019-12-12 13:04:43 +01:00
kernel_profiling.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_projection.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_queues.h Cleanup: spelling, repeated words 2019-11-25 00:55:11 +11:00
kernel_random.h Fix T74423: Cycles rendering artifacts with CUDA 10.2 2020-04-22 16:40:52 +02:00
kernel_shader.h Cleanup: tweak Cycles #includes in preparation for clang-format sorting 2020-03-06 14:44:42 +01:00
kernel_shadow.h Fix T72470: OptiX render fails with scene with many translucent planes on Linux. 2020-01-10 15:47:51 +01:00
kernel_subsurface.h Fix T74939: Random Walk subsurface appearance in OptiX does not match other engines 2020-03-26 13:00:09 +01:00
kernel_textures.h Cycles: change volume step size controls, auto adjust based on voxel size 2020-03-18 11:23:05 +01:00
kernel_types.h Cleanup: refactor adaptive sampling to more easily change some parameters 2020-04-07 20:29:48 +02:00
kernel_volume.h Volumes: add render settings for volume datablock 2020-03-18 11:23:05 +01:00
kernel_work_stealing.h Fix T76925: more Cycles OpenCL compile errors with some drivers on Linux 2020-05-25 17:06:10 +02:00
kernel_write_passes.h Cycles: support for custom shader AOVs 2019-12-10 20:44:46 +01:00