Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
parse_preshader merge fixes
  • Loading branch information
flibitijibibo committed May 29, 2016
1 parent 615cdbb commit ab98d7f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mojoshader.c
Expand Up @@ -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;
Expand All @@ -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)
Expand Down Expand Up @@ -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

Expand All @@ -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
Expand Down

0 comments on commit ab98d7f

Please sign in to comment.