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_type_lib.glsl')
-rw-r--r--source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl44
1 files changed, 44 insertions, 0 deletions
diff --git a/source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl b/source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl
index fefc8743691..9022a9d3130 100644
--- a/source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/closure_type_lib.glsl
@@ -30,6 +30,50 @@ struct Closure {
# endif
#endif
+
+/* Metal Default Constructor - Requred for C++ constructor syntax. */
+#ifdef GPU_METAL
+ inline Closure() = default;
+# ifdef VOLUMETRICS
+ /* Explicit Closure constructors -- To support GLSL syntax */
+ inline Closure(vec3 in_absorption, vec3 in_scatter, vec3 in_emission, float in_anisotropy)
+ : absorption(in_absorption),
+ scatter(in_scatter),
+ emission(in_emission),
+ anisotropy(in_anisotropy)
+ {
+ }
+# else
+ /* Explicit Closure constructors -- To support GLSL syntax */
+ inline Closure(vec3 in_radiance,
+ vec3 in_transmittance,
+ float in_holdout,
+ vec4 in_ssr_data,
+ vec2 in_ssr_normal,
+ int in_flag
+# ifdef USE_SSS
+ ,
+ vec3 in_sss_irradiance,
+ vec3 in_sss_albedo,
+ float in_sss_radius
+# endif /* USE_SSS */
+ )
+ : radiance(in_radiance),
+ transmittance(in_transmittance),
+ holdout(in_holdout),
+ ssr_data(in_ssr_data),
+ ssr_normal(in_ssr_normal),
+ flag(in_flag)
+# ifdef USE_SSS
+ ,
+ sss_irradiance(in_sss_irradiance),
+ sss_albedo(in_sss_albedo),
+ sss_radius(in_sss_radius)
+# endif /* USE_SSS */
+ {
+ }
+# endif /* VOLUMETRICS */
+#endif /* GPU_METAL */
};
#ifndef GPU_METAL