For SM1.1 TEX, don't add texcoord attributes.
authorRyan C. Gordon <icculus@icculus.org>
Mon, 20 Jul 2020 14:50:10 -0400
changeset 1282 a9b48833d3b6
parent 1281 cfa04188aee2
child 1283 c198fe1c469a
For SM1.1 TEX, don't add texcoord attributes. Other parts of the system will generate the tX registers as global variables, assign gl_TexCoord[X] to them, and overwrite them with the sampled pixels during the TEX instruction. Setting these as texcoord attributes causes it to _also_ generate a generic vertex attribute and cause all sorts of problems.
mojoshader.c
--- a/mojoshader.c	Sun Jul 19 23:44:13 2020 -0400
+++ b/mojoshader.c	Mon Jul 20 14:50:10 2020 -0400
@@ -1937,8 +1937,6 @@
         if (info->regtype != REG_TYPE_TEXTURE)
             fail(ctx, "TEX param must be a texture register");
         add_sampler(ctx, sampler, TEXTURE_TYPE_2D, 0);
-        add_attribute_register(ctx, REG_TYPE_TEXTURE, sampler,
-                               MOJOSHADER_USAGE_TEXCOORD, sampler, 0xF, 0);
     } // else
 } // state_TEXLD