parse_preshader merge fixes
authorEthan Lee <flibitijibibo@flibitijibibo.com>
Sun, 29 May 2016 13:31:18 -0400
changeset 1178 03f0ef912406
parent 1177 ba7a3f39add4
child 1179 6dd73a80629b
parse_preshader merge fixes
mojoshader.c
--- a/mojoshader.c	Sun May 29 03:51:36 2016 -0400
+++ b/mojoshader.c	Sun May 29 13:31:18 2016 -0400
@@ -10898,7 +10898,7 @@
             {
                 case 1:  // literal from CLIT block.
                 {
-                    if ((item + inst->element_count) >= preshader->literal_count)
+                    if (item > preshader->literal_count)
                     {
                         fail(ctx, "Bogus preshader literal index.");
                         break;
@@ -10916,7 +10916,7 @@
                         const uint32 base = sym->register_index * 4;
                         const uint32 count = sym->register_count * 4;
                         assert(sym->register_set==MOJOSHADER_SYMREGSET_FLOAT4);
-                        if ( (base <= item) && ((base + count) >= (item + inst->element_count)) )
+                        if ( (base <= item) && ((base + count) > item) )
                             break;
                     } // for
                     if (i == ctabdata.symbol_count)
@@ -10955,7 +10955,7 @@
                     {
                         const uint32 base = output_map[(i*2)] * 4;
                         const uint32 count = output_map[(i*2)+1] * 4;
-                        if ( (base <= item) && ((base + count) >= (item + inst->element_count)) )
+                        if ( (base <= item) && ((base + count) > item) )
                             break;
                     } // for
 
@@ -10972,7 +10972,7 @@
                 {
                     operand->type = MOJOSHADER_PRESHADEROPERAND_TEMP;
                     if (item >= preshader->temp_count)
-                        preshader->temp_count = item + inst->element_count;
+                        preshader->temp_count = item + 1;
                     break;
                 } // case
             } // switch