Skip to content

Commit

Permalink
Corrected state_IF() to handle IF PRED format.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Dec 10, 2008
1 parent 601e737 commit 72fe350
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mojoshader.c
Expand Up @@ -6160,8 +6160,11 @@ static void state_SINCOS(Context *ctx)

static void state_IF(Context *ctx)
{
if (ctx->source_args[0].regtype != REG_TYPE_CONSTBOOL)
fail(ctx, "IF src0 must be CONSTBOOL");
const RegisterType regtype = ctx->source_args[0].regtype;
if ((regtype != REG_TYPE_PREDICATE) && (regtype != REG_TYPE_CONSTBOOL))
fail(ctx, "IF src0 must be CONSTBOOL or PREDICATE");
else if (!replicate_swizzle(ctx->source_args[0].swizzle))
fail(ctx, "IF src0 must have replicate swizzle");
// !!! FIXME: track if nesting depth.
} // state_IF

Expand Down

0 comments on commit 72fe350

Please sign in to comment.