Skip to content

Commit

Permalink
Moved some DCL stuff from parse_args() to state() implementation.
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
icculus committed Apr 4, 2008
1 parent 90ee232 commit ce1cc9a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions mojoshader.c
Expand Up @@ -2678,8 +2678,6 @@ static int parse_args_DCL(Context *ctx)
if ((token & reserved_mask) != 0)
return fail(ctx, "reserved bits in DCL dword aren't zero");

set_defined_register(ctx, regtype, regnum);

return 3;
} // parse_args_DCL

Expand Down Expand Up @@ -2798,6 +2796,13 @@ static void state_DEFB(Context *ctx)
set_defined_register(ctx, regtype, regnum);
} // state_DEFB

static void state_DCL(Context *ctx)
{
const RegisterType regtype = ctx->dest_args[0].regtype;
const int regnum = ctx->dest_args[0].regnum;
set_defined_register(ctx, regtype, regnum);
} // state_DCL

static void state_FRC(Context *ctx)
{
if (!shader_version_atleast(ctx, 2, 0))
Expand Down Expand Up @@ -3037,7 +3042,7 @@ static const Instruction instructions[] =
INSTRUCTION_STATE(RET, 0, NULL, MOJOSHADER_TYPE_ANY),
INSTRUCTION_STATE(ENDLOOP, 0, NULL, MOJOSHADER_TYPE_ANY),
INSTRUCTION_STATE(LABEL, 1, S, MOJOSHADER_TYPE_ANY),
INSTRUCTION(DCL, 2, DCL, MOJOSHADER_TYPE_ANY),
INSTRUCTION_STATE(DCL, 2, DCL, MOJOSHADER_TYPE_ANY),
INSTRUCTION(POW, 3, DSS, MOJOSHADER_TYPE_ANY),
INSTRUCTION(CRS, 3, DSS, MOJOSHADER_TYPE_ANY),
INSTRUCTION(SGN, 4, DSSS, MOJOSHADER_TYPE_ANY),
Expand Down

0 comments on commit ce1cc9a

Please sign in to comment.