From 410f63c108e8ad3e30646d50c61a2abaf3bdc3fc Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 13 Oct 2020 01:03:20 -0400 Subject: [PATCH] glsl: for SM1.1, don't add incorrect gl_TexCoord defines. We handled this elsewhere. --- profiles/mojoshader_profile_glsl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/profiles/mojoshader_profile_glsl.c b/profiles/mojoshader_profile_glsl.c index 0e48d4a..0059f33 100644 --- a/profiles/mojoshader_profile_glsl.c +++ b/profiles/mojoshader_profile_glsl.c @@ -1057,13 +1057,15 @@ void emit_GLSL_attribute(Context *ctx, RegisterType regtype, int regnum, { // 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)