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 <brecht@blender.org>2022-07-25 18:38:03 +0300
committerBrecht Van Lommel <brecht@blender.org>2022-07-25 18:43:35 +0300
commitf26aa186b26f46dad08536d95b126afb42abd2f3 (patch)
tree564cb2e4efbf4d5f9756f68499d2d8824d8a1329 /intern/cycles/kernel/types.h
parent793d2031395246fb2421d130742e0fe61ab2b29c (diff)
Cleanup: remove __KERNEL_CPU__
This was tested in some places to check if code was being compiled for the CPU, however this is only defined in the kernel. Checking __KERNEL_GPU__ always works.
Diffstat (limited to 'intern/cycles/kernel/types.h')
-rw-r--r--intern/cycles/kernel/types.h26
1 files changed, 11 insertions, 15 deletions
diff --git a/intern/cycles/kernel/types.h b/intern/cycles/kernel/types.h
index d809f6fc2bd..7762c95275e 100644
--- a/intern/cycles/kernel/types.h
+++ b/intern/cycles/kernel/types.h
@@ -19,10 +19,6 @@
#include "kernel/svm/types.h"
-#ifndef __KERNEL_GPU__
-# define __KERNEL_CPU__
-#endif
-
CCL_NAMESPACE_BEGIN
/* Constants */
@@ -51,10 +47,10 @@ CCL_NAMESPACE_BEGIN
#define INTEGRATOR_SHADOW_ISECT_SIZE_CPU 1024U
#define INTEGRATOR_SHADOW_ISECT_SIZE_GPU 4U
-#ifdef __KERNEL_CPU__
-# define INTEGRATOR_SHADOW_ISECT_SIZE INTEGRATOR_SHADOW_ISECT_SIZE_CPU
-#else
+#ifdef __KERNEL_GPU__
# define INTEGRATOR_SHADOW_ISECT_SIZE INTEGRATOR_SHADOW_ISECT_SIZE_GPU
+#else
+# define INTEGRATOR_SHADOW_ISECT_SIZE INTEGRATOR_SHADOW_ISECT_SIZE_CPU
#endif
/* Kernel features */
@@ -91,12 +87,12 @@ CCL_NAMESPACE_BEGIN
#define __BRANCHED_PATH__
/* Device specific features */
-#ifdef __KERNEL_CPU__
+#ifndef __KERNEL_GPU__
# ifdef WITH_OSL
# define __OSL__
# endif
# define __VOLUME_RECORD_ALL__
-#endif /* __KERNEL_CPU__ */
+#endif /* !__KERNEL_GPU__ */
/* MNEE currently causes "Compute function exceeds available temporary registers"
* on Metal, disabled for now. */
@@ -722,7 +718,7 @@ typedef struct ccl_align(16) ShaderClosure
{
SHADER_CLOSURE_BASE;
-#ifdef __KERNEL_CPU__
+#ifndef __KERNEL_GPU__
float pad[2];
#endif
float data[10];
@@ -1540,15 +1536,15 @@ enum KernelFeatureFlag : uint32_t {
/* Must be constexpr on the CPU to avoid compile errors because the state types
* are different depending on the main, shadow or null path. For GPU we don't have
* C++17 everywhere so can't use it. */
-#ifdef __KERNEL_CPU__
+#ifdef __KERNEL_GPU__
+# define IF_KERNEL_FEATURE(feature) if ((node_feature_mask & (KERNEL_FEATURE_##feature)) != 0U)
+# define IF_KERNEL_NODES_FEATURE(feature) \
+ if ((node_feature_mask & (KERNEL_FEATURE_NODE_##feature)) != 0U)
+#else
# define IF_KERNEL_FEATURE(feature) \
if constexpr ((node_feature_mask & (KERNEL_FEATURE_##feature)) != 0U)
# define IF_KERNEL_NODES_FEATURE(feature) \
if constexpr ((node_feature_mask & (KERNEL_FEATURE_NODE_##feature)) != 0U)
-#else
-# define IF_KERNEL_FEATURE(feature) if ((node_feature_mask & (KERNEL_FEATURE_##feature)) != 0U)
-# define IF_KERNEL_NODES_FEATURE(feature) \
- if ((node_feature_mask & (KERNEL_FEATURE_NODE_##feature)) != 0U)
#endif
CCL_NAMESPACE_END