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@gmail.com>2019-03-16 18:45:50 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-03-17 14:01:19 +0300
commit9873005ecd7c21e3a6d371833a64b3ce722a48ea (patch)
tree6eaa2055354fb3f451de2bfef3662caf5e5a8b31 /intern/cycles/kernel
parente17f7af0ce7e045e287b517f775a282a7d7cc8c1 (diff)
Cleanup: simplify kernel features definition.
No functional changes, logic here got too complex after many changes over the years.
Diffstat (limited to 'intern/cycles/kernel')
-rw-r--r--intern/cycles/kernel/kernel_compat_opencl.h2
-rw-r--r--intern/cycles/kernel/kernel_types.h106
2 files changed, 34 insertions, 74 deletions
diff --git a/intern/cycles/kernel/kernel_compat_opencl.h b/intern/cycles/kernel/kernel_compat_opencl.h
index 21a95098894..3bf8cdebf4a 100644
--- a/intern/cycles/kernel/kernel_compat_opencl.h
+++ b/intern/cycles/kernel/kernel_compat_opencl.h
@@ -125,7 +125,7 @@
#define fmodf(x, y) fmod((float)(x), (float)(y))
#define sinhf(x) sinh(((float)(x)))
-#ifndef __CL_USE_NATIVE__
+#if !(defined(__KERNEL_OPENCL_AMD__) || defined(__KERNEL_OPENCL_INTEL_CPU__))
# define sinf(x) native_sin(((float)(x)))
# define cosf(x) native_cos(((float)(x)))
# define tanf(x) native_tan(((float)(x)))
diff --git a/intern/cycles/kernel/kernel_types.h b/intern/cycles/kernel/kernel_types.h
index e0bf9b054ac..4b1c8e82dfa 100644
--- a/intern/cycles/kernel/kernel_types.h
+++ b/intern/cycles/kernel/kernel_types.h
@@ -83,76 +83,6 @@ CCL_NAMESPACE_BEGIN
# define SHADER_SORT_LOCAL_SIZE 1
#endif
-
-/* Device capabilities */
-#ifdef __KERNEL_CPU__
-# ifdef __KERNEL_SSE2__
-# define __QBVH__
-# endif
-# define __KERNEL_SHADING__
-# define __BRANCHED_PATH__
-# ifdef WITH_OSL
-# define __OSL__
-# endif
-# define __PRINCIPLED__
-# define __SUBSURFACE__
-# define __CMJ__
-# define __VOLUME__
-# define __VOLUME_SCATTER__
-# define __SHADOW_RECORD_ALL__
-# define __VOLUME_DECOUPLED__
-# define __VOLUME_RECORD_ALL__
-#endif /* __KERNEL_CPU__ */
-
-#ifdef __KERNEL_CUDA__
-# define __KERNEL_SHADING__
-# define __VOLUME__
-# define __VOLUME_SCATTER__
-# define __SUBSURFACE__
-# define __PRINCIPLED__
-# define __SHADOW_RECORD_ALL__
-# define __CMJ__
-# ifndef __SPLIT_KERNEL__
-# define __BRANCHED_PATH__
-# endif
-#endif /* __KERNEL_CUDA__ */
-
-#ifdef __KERNEL_OPENCL__
-
-# if defined(__KERNEL_OPENCL_AMD__) || defined(__KERNEL_OPENCL_INTEL_CPU__)
-# define __CL_USE_NATIVE__
-# endif
-
-/* Preview kernel is used as a small kernel when the optimized kernel is still being compiled. */
-# ifdef __KERNEL_OPENCL_PREVIEW__
-# define __AO__
-# define __PASSES__
-# define __HAIR__
-# else
-
-# define __KERNEL_SHADING__
-# define __PRINCIPLED__
-# define __CMJ__
-
-# ifdef __KERNEL_OPENCL_NVIDIA__
-# define __SUBSURFACE__
-# define __VOLUME__
-# define __VOLUME_SCATTER__
-# define __SHADOW_RECORD_ALL__
-# define __BRANCHED_PATH__
-# endif /* __KERNEL_OPENCL_NVIDIA__ */
-
-# ifdef __KERNEL_OPENCL_AMD__
-# define __SUBSURFACE__
-# define __VOLUME__
-# define __VOLUME_SCATTER__
-# define __SHADOW_RECORD_ALL__
-# define __BRANCHED_PATH__
-# endif /* __KERNEL_OPENCL_AMD__ */
-
-# endif /* KERNEL_OPENCL_PREVIEW__ */
-#endif /* __KERNEL_OPENCL__ */
-
/* Kernel features */
#define __SOBOL__
#define __INSTANCING__
@@ -169,8 +99,12 @@ CCL_NAMESPACE_BEGIN
#define __SHADOW_TRICKS__
#define __DENOISING_FEATURES__
#define __SHADER_RAYTRACE__
+#define __AO__
+#define __PASSES__
+#define __HAIR__
-#ifdef __KERNEL_SHADING__
+/* Without these we get an AO render, used by OpenCL preview kernel. */
+#ifndef __KERNEL_AO_PREVIEW__
# define __SVM__
# define __EMISSION__
# define __TEXTURES__
@@ -178,16 +112,42 @@ CCL_NAMESPACE_BEGIN
# define __HOLDOUT__
# define __MULTI_CLOSURE__
# define __TRANSPARENT_SHADOWS__
-# define __PASSES__
# define __BACKGROUND_MIS__
# define __LAMP_MIS__
-# define __AO__
# define __CAMERA_MOTION__
# define __OBJECT_MOTION__
# define __HAIR__
# define __BAKING__
+# define __PRINCIPLED__
+# define __SUBSURFACE__
+# define __VOLUME__
+# define __VOLUME_SCATTER__
+# define __CMJ__
+# define __SHADOW_RECORD_ALL__
+# define __BRANCHED_PATH__
#endif
+/* Device specific features */
+#ifdef __KERNEL_CPU__
+# ifdef __KERNEL_SSE2__
+# define __QBVH__
+# endif
+# ifdef WITH_OSL
+# define __OSL__
+# endif
+# define __VOLUME_DECOUPLED__
+# define __VOLUME_RECORD_ALL__
+#endif /* __KERNEL_CPU__ */
+
+#ifdef __KERNEL_CUDA__
+# ifdef __SPLIT_KERNEL__
+# undef __BRANCHED_PATH__
+# endif
+#endif /* __KERNEL_CUDA__ */
+
+#ifdef __KERNEL_OPENCL__
+#endif /* __KERNEL_OPENCL__ */
+
/* Scene-based selective features compilation. */
#ifdef __NO_CAMERA_MOTION__
# undef __CAMERA_MOTION__