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>2020-03-26 01:11:19 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-03-26 01:14:50 +0300
commitd554cf8dd9ff45a2aa2680d46e23402177a361a5 (patch)
tree685eb7739cb7848a742f0a15461808ddfef45f54 /source/blender/draw
parent6681a33a6f9978239b2ee37065c3fab6cd372277 (diff)
Fix T75090: crash with old NVIDIA drivers after overlay refactor
Work around GLSL compiler bug with backslash in preprocessor macros.
Diffstat (limited to 'source/blender/draw')
-rw-r--r--source/blender/draw/intern/shaders/common_smaa_lib.glsl15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/blender/draw/intern/shaders/common_smaa_lib.glsl b/source/blender/draw/intern/shaders/common_smaa_lib.glsl
index 45d9f54d943..a3f592ba5dd 100644
--- a/source/blender/draw/intern/shaders/common_smaa_lib.glsl
+++ b/source/blender/draw/intern/shaders/common_smaa_lib.glsl
@@ -529,8 +529,9 @@
# define SMAATexturePass2D(tex) tex
# define SMAASampleLevelZero(tex, coord) tex2Dlod(tex, float4(coord, 0.0, 0.0))
# define SMAASampleLevelZeroPoint(tex, coord) tex2Dlod(tex, float4(coord, 0.0, 0.0))
-# define SMAASampleLevelZeroOffset(tex, coord, offset) \
- tex2Dlod(tex, float4(coord + offset * SMAA_RT_METRICS.xy, 0.0, 0.0))
+/* clang-format off */
+# define SMAASampleLevelZeroOffset(tex, coord, offset) tex2Dlod(tex, float4(coord + offset * SMAA_RT_METRICS.xy, 0.0, 0.0))
+/* clang-format on */
# define SMAASample(tex, coord) tex2D(tex, coord)
# define SMAASamplePoint(tex, coord) tex2D(tex, coord)
# define SMAASampleOffset(tex, coord, offset) tex2D(tex, coord + offset * SMAA_RT_METRICS.xy)
@@ -554,8 +555,9 @@ SamplerState PointSampler
# define SMAATexturePass2D(tex) tex
# define SMAASampleLevelZero(tex, coord) tex.SampleLevel(LinearSampler, coord, 0)
# define SMAASampleLevelZeroPoint(tex, coord) tex.SampleLevel(PointSampler, coord, 0)
-# define SMAASampleLevelZeroOffset(tex, coord, offset) \
- tex.SampleLevel(LinearSampler, coord, 0, offset)
+/* clang-format off */
+# define SMAASampleLevelZeroOffset(tex, coord, offset) tex.SampleLevel(LinearSampler, coord, 0, offset)
+/* clang-format on */
# define SMAASample(tex, coord) tex.Sample(LinearSampler, coord)
# define SMAASamplePoint(tex, coord) tex.Sample(PointSampler, coord)
# define SMAASampleOffset(tex, coord, offset) tex.Sample(LinearSampler, coord, offset)
@@ -597,10 +599,11 @@ SamplerState PointSampler
# define bool4 bvec4
#endif
-#if !defined(SMAA_HLSL_3) && !defined(SMAA_HLSL_4) && !defined(SMAA_HLSL_4_1) && \
- !defined(SMAA_GLSL_3) && !defined(SMAA_GLSL_4) && !defined(SMAA_CUSTOM_SL)
+/* clang-format off */
+#if !defined(SMAA_HLSL_3) && !defined(SMAA_HLSL_4) && !defined(SMAA_HLSL_4_1) && !defined(SMAA_GLSL_3) && !defined(SMAA_GLSL_4) && !defined(SMAA_CUSTOM_SL)
# error you must define the shading language: SMAA_HLSL_*, SMAA_GLSL_* or SMAA_CUSTOM_SL
#endif
+/* clang-format on */
//-----------------------------------------------------------------------------
// Misc functions