[Bf-blender-cvs] [c8fc23fdbe0] master: Fix T63698: Eevee crash after recent clang-format changes

Brecht Van Lommel noreply at git.blender.org
Sun Apr 21 11:39:13 CEST 2019


Commit: c8fc23fdbe09c33f5342ed51735dab50fe4f071b
Author: Brecht Van Lommel
Date:   Sun Apr 21 11:32:48 2019 +0200
Branches: master
https://developer.blender.org/rBc8fc23fdbe09c33f5342ed51735dab50fe4f071b

Fix T63698: Eevee crash after recent clang-format changes

Some GLSL compilers seem to not have problems with \ to break preprocessor
directives. I couldn't find other places with similar code, but fixing this
case by case is not ideal and the same issue may come up again.

===================================================================

M	source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl

===================================================================

diff --git a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
index fdaec58977f..9ed0ab9a5d4 100644
--- a/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
+++ b/source/blender/draw/engines/eevee/shaders/bsdf_common_lib.glsl
@@ -870,8 +870,10 @@ Closure closure_emission(vec3 rgb)
   return cl;
 }
 
-#  if defined(MESH_SHADER) && !defined(USE_ALPHA_HASH) && !defined(USE_ALPHA_CLIP) && \
-      !defined(SHADOW_SHADER) && !defined(USE_MULTIPLY)
+/* Breaking this across multiple lines causes issues for some older GLSL compilers. */
+/* clang-format off */
+#  if defined(MESH_SHADER) && !defined(USE_ALPHA_HASH) && !defined(USE_ALPHA_CLIP) && !defined(SHADOW_SHADER) && !defined(USE_MULTIPLY)
+/* clang-format on */
 layout(location = 0) out vec4 fragColor;
 layout(location = 1) out vec4 ssrNormals;
 layout(location = 2) out vec4 ssrData;



More information about the Bf-blender-cvs mailing list