Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2015-03-03 16:48:37 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2015-03-03 16:48:37 +0300
commited5df501924fcee1050eeaced84219f8e42002cf (patch)
treec955cffbf3bb911600182cc9d45c64920c93d80d /intern
parent19656233dd46092ba4036e5145c3a9aa9162597c (diff)
Cycles: Fix/workaround for toggling world MIS causing CUDA to fail
Seems it's just another issue with the compiler, worked around by explicitly telling not to inline some function. In theory we can unify this with CPU, but we're quite close to the release so better be safe than sorry.
Diffstat (limited to 'intern')
-rw-r--r--intern/cycles/kernel/kernel_light.h21
1 files changed, 19 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_light.h b/intern/cycles/kernel/kernel_light.h
index 846ec801f77..76fa754b5fa 100644
--- a/intern/cycles/kernel/kernel_light.h
+++ b/intern/cycles/kernel/kernel_light.h
@@ -37,7 +37,16 @@ typedef struct LightSample {
#ifdef __BACKGROUND_MIS__
-ccl_device float3 background_light_sample(KernelGlobals *kg, float randu, float randv, float *pdf)
+/* TODO(sergey): In theory it should be all fine to use noinline for all
+ * devices, but we're so close to the release so better not screw things
+ * up for CPU at least.
+ */
+#ifdef __KERNEL_GPU__
+ccl_device_noinline
+#else
+ccl_device
+#endif
+float3 background_light_sample(KernelGlobals *kg, float randu, float randv, float *pdf)
{
/* for the following, the CDF values are actually a pair of floats, with the
* function value as X and the actual CDF as Y. The last entry's function
@@ -113,7 +122,15 @@ ccl_device float3 background_light_sample(KernelGlobals *kg, float randu, float
return -equirectangular_to_direction(u, v);
}
-ccl_device float background_light_pdf(KernelGlobals *kg, float3 direction)
+/* TODO(sergey): Same as above, after the release we should consider using
+ * 'noinline' for all devices.
+ */
+#ifdef __KERNEL_GPU__
+ccl_device_noinline
+#else
+ccl_device
+#endif
+float background_light_pdf(KernelGlobals *kg, float3 direction)
{
float2 uv = direction_to_equirectangular(direction);
int res = kernel_data.integrator.pdf_background_res;