Assembler: support ps_1_1 TEX instruction.
authorRyan C. Gordon <icculus@icculus.org>
Wed, 24 Apr 2013 21:49:39 -0400
changeset 1130 80fc68215dec
parent 1129 908551a4334c
child 1131 133cf29e30ed
Assembler: support ps_1_1 TEX instruction.
mojoshader_assembler.c
--- a/mojoshader_assembler.c	Wed Apr 17 23:32:53 2013 -0400
+++ b/mojoshader_assembler.c	Wed Apr 24 21:49:39 2013 -0400
@@ -1143,8 +1143,12 @@
     const char *origtoken = ctx->token;
     const unsigned int origtokenlen = ctx->tokenlen;
 
+    // "TEX" is only meaningful in ps_1_1.
+    if ((!shader_version_atleast(ctx, 1, 4)) && (check_token_segment(ctx, "TEX")))
+        controls = 0;
+
     // This might need to be TEXLD instead of TEXLDP.
-    if (check_token_segment(ctx, "TEXLDP"))
+    else if (check_token_segment(ctx, "TEXLDP"))
         controls = CONTROL_TEXLDP;
 
     // This might need to be TEXLD instead of TEXLDB.