Skip to content

Commit

Permalink
Fixed TEXKILL instruction in arb1/nvX profiles.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Sep 6, 2008
1 parent 94974eb commit 1032f2f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion mojoshader.c
Expand Up @@ -4830,7 +4830,13 @@ static void emit_ARB1_MOVA(Context *ctx)

static void emit_ARB1_TEXKILL(Context *ctx)
{
// !!! FIXME: d3d kills on xyz, arb1 kills on xyzw. Fix the swizzle!
// d3d kills on xyz, arb1 kills on xyzw. Fix the swizzle.
// We just map the x component to w. If it's negative, the fragment
// would discard anyhow, otherwise, it'll pass through okay. This saves
// us a temp register.
const int origswiz = ctx->source_args[0].swizzle;
ctx->source_args[0].swizzle = (origswiz & 0x3F) | ((origswiz & 0x3) << 6);
ctx->source_args[0].swizzle_w = ctx->source_args[0].swizzle_x;
const char *src0 = make_ARB1_srcarg_string(ctx, 0);
output_line(ctx, "KIL %s;", src0);
} // emit_ARB1_TEXKILL
Expand Down

0 comments on commit 1032f2f

Please sign in to comment.