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:
Diffstat (limited to 'source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl')
-rw-r--r--source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl21
1 files changed, 18 insertions, 3 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl b/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl
index 311887cf2f5..a96d8ad3dac 100644
--- a/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl
@@ -157,7 +157,15 @@
#define ClosureInputDummy ClosureOutput
#define ClosureOutputDummy ClosureOutput
#define ClosureEvalDummy ClosureOutput
-#define CLOSURE_EVAL_DUMMY ClosureOutput(vec3(0))
+#ifdef GPU_METAL
+/* C++ struct initialization. */
+# define CLOSURE_EVAL_DUMMY \
+ { \
+ vec3(0) \
+ }
+#else
+# define CLOSURE_EVAL_DUMMY ClosureOutput(vec3(0))
+#endif
#define CLOSURE_INPUT_Dummy_DEFAULT CLOSURE_EVAL_DUMMY
#define closure_Dummy_eval_init(cl_in, cl_common, cl_out) CLOSURE_EVAL_DUMMY
#define closure_Dummy_planar_eval(cl_in, cl_eval, cl_common, data, cl_out)
@@ -180,8 +188,15 @@ struct ClosureInputCommon {
/** Custom occlusion value set by the user. */
float occlusion;
};
-
-#define CLOSURE_INPUT_COMMON_DEFAULT ClosureInputCommon(1.0)
+#ifdef GPU_METAL
+/* C++ struct initialization. */
+# define CLOSURE_INPUT_COMMON_DEFAULT \
+ { \
+ 1.0 \
+ }
+#else
+# define CLOSURE_INPUT_COMMON_DEFAULT ClosureInputCommon(1.0)
+#endif
struct ClosureEvalCommon {
/** Result of SSAO. */