Workaround for AMD GPU OpenCL compiler.
authorHristo Gueorguiev <prem.nirved@gmail.com>
Tue, 25 Apr 2017 18:08:14 +0000 (20:08 +0200)
committerHristo Gueorguiev <prem.nirved@gmail.com>
Tue, 25 Apr 2017 18:08:14 +0000 (20:08 +0200)
intern/cycles/kernel/kernel_subsurface.h
intern/cycles/kernel/split/kernel_split_data_types.h

index f58eef7a368fdbb58e6586918b79fcf9fa1fd527..baf629342b99366baa3a3184b93e2acb2d7407af 100644 (file)
@@ -399,6 +399,12 @@ ccl_device_noinline void subsurface_scatter_multi_setup(
 #else
        Ray *ray = &ss_isect->ray;
 #endif
+
+       /* Workaround for AMD GPU OpenCL compiler. Most probably cache bypass issue. */
+#if defined(__SPLIT_KERNEL__) && defined(__KERNEL_OPENCL_AMD__) && defined(__KERNEL_GPU__)
+       kernel_split_params.dummy_sd_flag = sd->flag;
+#endif
+
        /* Setup new shading point. */
        shader_setup_from_subsurface(kg, sd, &ss_isect->hits[hit], ray);
 
index 748197b718315c187095c7cfef73d79cabf0484f..0af8bfc89d5a5136152eac51f5ad9456ae29877f 100644 (file)
@@ -43,6 +43,9 @@ typedef struct SplitParams {
        ccl_global char *use_queues_flag;
 
        ccl_global float *buffer;
+
+       /* Place for storing sd->flag. AMD GPU OpenCL compiler workaround */
+       int dummy_sd_flag;
 } SplitParams;
 
 /* Global memory variables [porting]; These memory is used for