Fix USAGE_FOG for glsles, index values > 0
authorEthan Lee <flibitijibibo@flibitijibibo.com>
Tue, 29 Oct 2019 16:31:56 -0400
changeset 1215 8e9fb483f4d4
parent 1214 5887634ea695
child 1216 9d725de6c61c
Fix USAGE_FOG for glsles, index values > 0
profiles/mojoshader_profile_glsl.c
--- a/profiles/mojoshader_profile_glsl.c	Sun Aug 25 13:00:18 2019 -0400
+++ b/profiles/mojoshader_profile_glsl.c	Tue Oct 29 16:31:56 2019 -0400
@@ -951,7 +951,14 @@
                     } // 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