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
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-27 20:21:07 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2013-05-27 20:21:07 +0400
commit4bdb54a76e3b15f99f2efc149b9d78aeef3203a4 (patch)
tree24defa9eeb8e4d7d04508fbca6229ffe23e13d9b /intern/cycles/kernel
parent5460e31d56fda5957cf13f77c910d378d4bd85fb (diff)
Cycles OpenCL: patch #35514 by Doug Gale
* Support using devices from all OpenCL platforms, so that you can use e.g. both Intel and NVidia OpenCL implementations if you have them installed. * Fix compile error due to missing fmodf after recent math node change. * Enable advanced shading for Intel OpenCL. * CYCLES_OPENCL_DEBUG environment variable for generating debug symbols so you can debug with gdb. This crashes the compiler with Intel OpenCL on Linux though. To make this work the preprocessed kernel source code is written out, as gdb needs this. * Show OpenCL compiler warnings even if the build succeeded. * Some small fixes to initialize cdDevice to NULL, add missing NULL check when creating buffer and add missing space at end of build options for Apple OpenCL. * Fix crash with multi device + opencl, now e.g. CPU + GPU render should work. I did a few tweaks to the code and also: * Fix viewport render failing sometimes with Apple CPU OpenCL, was not taking workgroup size limits into account properly. * Add compile error when advanced shading in the Blender binary and OpenCL kernel are not in sync.
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r--intern/cycles/kernel/kernel_compat_opencl.h1
-rw-r--r--intern/cycles/kernel/kernel_types.h16
2 files changed, 15 insertions, 2 deletions
diff --git a/intern/cycles/kernel/kernel_compat_opencl.h b/intern/cycles/kernel/kernel_compat_opencl.h
index 6c41bfa5521..66cf0bb996b 100644
--- a/intern/cycles/kernel/kernel_compat_opencl.h
+++ b/intern/cycles/kernel/kernel_compat_opencl.h
@@ -103,6 +103,7 @@
#define atan2f(x, y) atan2(((float)x), ((float)y))
#define fmaxf(x, y) fmax(((float)x), ((float)y))
#define fminf(x, y) fmin(((float)x), ((float)y))
+#define fmodf(x, y) fmod((float)x, (float)y)
/* data lookup defines */
#define kernel_data (*kg->data)
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index 535b9489985..1dcd3a52b6a 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -66,9 +66,11 @@ CCL_NAMESPACE_BEGIN
#ifdef __KERNEL_OPENCL__
+/* keep __KERNEL_ADV_SHADING__ in sync with opencl_kernel_use_advanced_shading! */
+
#ifdef __KERNEL_OPENCL_NVIDIA__
#define __KERNEL_SHADING__
-#define __MULTI_CLOSURE__
+//#define __KERNEL_ADV_SHADING__
#endif
#ifdef __KERNEL_OPENCL_APPLE__
@@ -85,6 +87,11 @@ CCL_NAMESPACE_BEGIN
#define __EXTRA_NODES__
#endif
+#ifdef __KERNEL_OPENCL_INTEL_CPU__
+#define __KERNEL_SHADING__
+#define __KERNEL_ADV_SHADING__
+#endif
+
#endif
/* kernel features */
@@ -122,7 +129,12 @@ CCL_NAMESPACE_BEGIN
#define __OBJECT_MOTION__
#define __HAIR__
#endif
-//#define __SOBOL_FULL_SCREEN__
+
+/* Sanity check */
+
+#if defined(__KERNEL_OPENCL_NEED_ADVANCED_SHADING__) && !defined(__MULTI_CLOSURE__)
+#error "OpenCL: mismatch between advanced shading flags in device_opencl.cpp and kernel_types.h"
+#endif
/* Shader Evaluation */