Skip to content
Permalink
Browse files
parse_preshader merge fixes
  • Loading branch information
flibitijibibo committed May 29, 2016
1 parent 615cdbb commit ab98d7f8f5d00acbfd9d89aeb1fab5204c2c87b0

File 1 of 1 in ab98d7f

@@ -10898,7 +10898,7 @@ static void parse_preshader(Context *ctx, const uint32 *tokens, uint32 tokcount)
{
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 @@ static void parse_preshader(Context *ctx, const uint32 *tokens, uint32 tokcount)
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 @@ static void parse_preshader(Context *ctx, const uint32 *tokens, uint32 tokcount)
{
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 @@ static void parse_preshader(Context *ctx, const uint32 *tokens, uint32 tokcount)
{
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

0 comments on commit ab98d7f

Please sign in to comment.