From 47dcaddad36ef892a65aa541c9768be45b83afde Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Tue, 29 Oct 2019 16:31:56 -0400 Subject: [PATCH] Fix USAGE_FOG for glsles, index values > 0 --- profiles/mojoshader_profile_glsl.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/profiles/mojoshader_profile_glsl.c b/profiles/mojoshader_profile_glsl.c index dca623bf..9142f0e3 100644 --- a/profiles/mojoshader_profile_glsl.c +++ b/profiles/mojoshader_profile_glsl.c @@ -951,7 +951,14 @@ void emit_GLSL_attribute(Context *ctx, RegisterType regtype, int regnum, } // else if break; case MOJOSHADER_USAGE_FOG: - usage_str = "gl_FogFragCoord"; +#if SUPPORT_PROFILE_GLSLES + if (support_glsles(ctx)) + break; // GLSL ES does not have gl_FogFragCoord +#endif + if (index == 0) + { + usage_str = "gl_FogFragCoord"; + } // if break; case MOJOSHADER_USAGE_TEXCOORD: #if SUPPORT_PROFILE_GLSLES