glsl: for SM1.1, don't add incorrect gl_TexCoord defines.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 13 Oct 2020 01:03:20 -0400
changeset 1308 ff7fe8bdbb8f
parent 1307 f7efdb215d49
child 1309 b7f37f047a81
glsl: for SM1.1, don't add incorrect gl_TexCoord defines. We handled this elsewhere.
profiles/mojoshader_profile_glsl.c
--- a/profiles/mojoshader_profile_glsl.c	Tue Oct 13 01:02:07 2020 -0400
+++ b/profiles/mojoshader_profile_glsl.c	Tue Oct 13 01:03:20 2020 -0400
@@ -1057,13 +1057,15 @@
             {
                 // ps_1_1 does a different hack for this attribute.
                 //  Refer to emit_GLSL_global()'s REG_TYPE_ADDRESS code.
-                if (shader_version_atleast(ctx, 1, 4) && (index < 4)) // gl_TexCoord[4+] is unreliable!
+                if (!shader_version_atleast(ctx, 1, 4))
+                    usage_str = "";  // just make sure this isn't NULL.
+                else if (index < 4)  // gl_TexCoord[4+] is unreliable!
                 {
                     snprintf(index_str, sizeof (index_str), "%u", (uint) index);
                     usage_str = "gl_TexCoord";
                     arrayleft = "[";
                     arrayright = "]";
-                } // if
+                } // else if
             } // if
 
             else if (usage == MOJOSHADER_USAGE_COLOR)