Navigation Menu

Skip to content

Commit

Permalink
Added real SRCMOD_ABS/SRCMOD_ABSNEGATE support in nv2 profile.
Browse files Browse the repository at this point in the history
--HG--
branch : trunk
  • Loading branch information
icculus committed Jun 18, 2008
1 parent b146067 commit 4274c9a
Showing 1 changed file with 16 additions and 8 deletions.
24 changes: 16 additions & 8 deletions mojoshader.c
Expand Up @@ -3424,14 +3424,22 @@ static const char *make_ARB1_srcarg_string_in_buf(Context *ctx,
premod_str = "-";
// fall through.
case SRCMOD_ABS:
regtype_str = allocate_ARB1_scratch_reg_name(ctx);
regnum_str[0] = '\0'; // move value to scratch register.
rel_lbracket = ""; // scratch register won't use array.
rel_rbracket = "";
rel_offset[0] = '\0';
rel_swizzle[0] = '\0';
rel_regtype_str = "";
output_line(ctx, "ABS %s, %s;", regtype_str, buf);
if (ctx->support_nv2) // GL_NV_vertex_program2_option adds this.
{
premod_str = (arg->src_mod == SRCMOD_ABSNEGATE) ? "-|" : "|";
postmod_str = "|";
} // if
else
{
regtype_str = allocate_ARB1_scratch_reg_name(ctx);
regnum_str[0] = '\0'; // move value to scratch register.
rel_lbracket = ""; // scratch register won't use array.
rel_rbracket = "";
rel_offset[0] = '\0';
rel_swizzle[0] = '\0';
rel_regtype_str = "";
output_line(ctx, "ABS %s, %s;", regtype_str, buf);
} // else
break;

case SRCMOD_NOT:
Expand Down

0 comments on commit 4274c9a

Please sign in to comment.