Skip to content

Commit

Permalink
Fixed output to POSITION0.
Browse files Browse the repository at this point in the history
We have a separate loop to find the POSITION0 input register, so it always
 becomes vertex array #0...but an incorrect test was causing it to ignore
 output registers for POSITION0.

--HG--
branch : trunk
  • Loading branch information
icculus committed Jul 2, 2008
1 parent 8e875f5 commit 8d0fe05
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions mojoshader.c
Expand Up @@ -7335,10 +7335,11 @@ static void process_definitions(Context *ctx)
(TextureType) item->index);
} // for

// ...and attributes... (find POSITION0 here, so it's always first).
// ...and attributes... (find input POSITION0 here, so it's always first).
for (item = ctx->attributes.next; item != NULL; item = item->next)
{
if ((item->usage == MOJOSHADER_USAGE_POSITION) && (item->index == 0))
if ( (item->regtype == REG_TYPE_INPUT) &&
(item->usage == MOJOSHADER_USAGE_POSITION) && (item->index == 0) )
{
ctx->attribute_count++;
ctx->profile->attribute_emitter(ctx, item->regtype, item->regnum,
Expand All @@ -7348,10 +7349,11 @@ static void process_definitions(Context *ctx)
} // if
} // for

// ...and attributes... (everything but POSITION0).
// ...and attributes... (everything but input POSITION0).
for (item = ctx->attributes.next; item != NULL; item = item->next)
{
if ((item->usage != MOJOSHADER_USAGE_POSITION) || (item->index != 0))
if ( (item->regtype != REG_TYPE_INPUT) ||
(item->usage != MOJOSHADER_USAGE_POSITION) || (item->index != 0) )
{
ctx->attribute_count++;
ctx->profile->attribute_emitter(ctx, item->regtype, item->regnum,
Expand Down

0 comments on commit 8d0fe05

Please sign in to comment.