Skip to content

Commit

Permalink
Whoops, need to do register reference upkeep for dest and source args.
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
icculus committed Apr 3, 2008
1 parent 8269904 commit f332e60
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions mojoshader.c
Expand Up @@ -2266,6 +2266,17 @@ static const Profile profiles[] =
PROFILE_EMITTER_GLSL(op) \
}

static void register_reference_upkeep(Context *ctx, const RegisterType regtype)
{
// !!! FIXME: make sure there were def/dcl for all referenced vars?
switch (regtype)
{
case REG_TYPE_ADDRESS: ctx->flags |= CTX_FLAGS_USED_ADDR_REG; break;
case REG_TYPE_PREDICATE: ctx->flags |= CTX_FLAGS_USED_PRED_REG; break;
default: break; // don't care.
} // switch
} // register_reference_upkeep


static int parse_destination_token(Context *ctx, DestArgInfo *info)
{
Expand Down Expand Up @@ -2343,6 +2354,7 @@ static int parse_destination_token(Context *ctx, DestArgInfo *info)
if ((info->regtype < 0) || (info->regtype > REG_TYPE_MAX))
return fail(ctx, "Register type is out of range");

register_reference_upkeep(ctx, info->regtype);
return 1;
} // parse_destination_token

Expand Down Expand Up @@ -2389,14 +2401,7 @@ static int parse_source_token(Context *ctx, SourceArgInfo *info)
if ( ((SourceMod) info->src_mod) >= SRCMOD_TOTAL )
return fail(ctx, "Unknown source modifier");

// !!! FIXME: make sure there were def/dcl for all referenced vars?
switch (info->regtype)
{
case REG_TYPE_ADDRESS: ctx->flags |= CTX_FLAGS_USED_ADDR_REG; break;
case REG_TYPE_PREDICATE: ctx->flags |= CTX_FLAGS_USED_PRED_REG; break;
default: break; // don't care.
} // switch

register_reference_upkeep(ctx, info->regtype);
return 1;
} // parse_source_token

Expand Down

0 comments on commit f332e60

Please sign in to comment.