Merge pull request #25196 from santouits/webgl-backslashes

webgl1 in firefox doesn't like backslashes in #define directive
This commit is contained in:
Rémi Verschelde 2019-01-21 23:02:32 +01:00 committed by GitHub
commit 3548b6b6b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -433,19 +433,14 @@ FRAGMENT_SHADER_CODE
#ifdef SHADOW_USE_GRADIENT
#define SHADOW_TEST(m_ofs) \
{ \
highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); \
shadow_attenuation += 1.0 - smoothstep(sd, sd + shadow_gradient, sz); \
}
/* clang-format off */
/* GLSL es 100 doesn't support line continuation characters(backslashes) */
#define SHADOW_TEST(m_ofs) { highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); shadow_attenuation += 1.0 - smoothstep(sd, sd + shadow_gradient, sz); }
#else
#define SHADOW_TEST(m_ofs) \
{ \
highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); \
shadow_attenuation += step(sz, sd); \
}
#define SHADOW_TEST(m_ofs) { highp float sd = SHADOW_DEPTH(shadow_texture, vec2(m_ofs, sh)); shadow_attenuation += step(sz, sd); }
/* clang-format on */
#endif