[Bf-blender-cvs] [9d26e32ea28] master: Workaround for AMD GPU OpenCL compiler.

Hristo Gueorguiev noreply at git.blender.org
Tue Apr 25 20:08:51 CEST 2017


Commit: 9d26e32ea28b35bf51b27828f7b58fe479a29a68
Author: Hristo Gueorguiev
Date:   Tue Apr 25 20:08:14 2017 +0200
Branches: master
https://developer.blender.org/rB9d26e32ea28b35bf51b27828f7b58fe479a29a68

Workaround for AMD GPU OpenCL compiler.

===================================================================

M	intern/cycles/kernel/kernel_subsurface.h
M	intern/cycles/kernel/split/kernel_split_data_types.h

===================================================================

diff --git a/intern/cycles/kernel/kernel_subsurface.h b/intern/cycles/kernel/kernel_subsurface.h
index f58eef7a368..baf629342b9 100644
--- a/intern/cycles/kernel/kernel_subsurface.h
+++ b/intern/cycles/kernel/kernel_subsurface.h
@@ -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);
 
diff --git a/intern/cycles/kernel/split/kernel_split_data_types.h b/intern/cycles/kernel/split/kernel_split_data_types.h
index 748197b7183..0af8bfc89d5 100644
--- a/intern/cycles/kernel/split/kernel_split_data_types.h
+++ b/intern/cycles/kernel/split/kernel_split_data_types.h
@@ -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




More information about the Bf-blender-cvs mailing list