summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-11-20 16:07:31 -0800
committerBrian Paul <[email protected]>2013-11-21 09:08:17 -0700
commit9d1c71e34d5ec225f1d4f12f6d7dad5148ab0e8b (patch)
treec7005c641c91931aca7ecad0d9ff38a928e22d2f /src/gallium/drivers
parent2d5f21ba650cb85ffea0ed6f41ee0d1e6fe5a29a (diff)
svga: remove special-case code for texkil w component
Not actually needed. Fixes piglit ARB_fragment_program/kil-swizzle test. Reviewed-by: José Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/svga/svga_tgsi_insn.c29
1 files changed, 6 insertions, 23 deletions
diff --git a/src/gallium/drivers/svga/svga_tgsi_insn.c b/src/gallium/drivers/svga/svga_tgsi_insn.c
index 0fc385a8df6..086509566fe 100644
--- a/src/gallium/drivers/svga/svga_tgsi_insn.c
+++ b/src/gallium/drivers/svga/svga_tgsi_insn.c
@@ -1391,10 +1391,6 @@ emit_kill_if(struct svga_shader_emitter *emit,
{
const struct tgsi_full_src_register *reg = &insn->Src[0];
struct src_register src0, srcIn;
- /* is the W component tested in another position? */
- const boolean w_tested = (reg->Register.SwizzleW == reg->Register.SwizzleX ||
- reg->Register.SwizzleW == reg->Register.SwizzleY ||
- reg->Register.SwizzleW == reg->Register.SwizzleZ);
const boolean special = (reg->Register.Absolute ||
reg->Register.Negate ||
reg->Register.Indirect ||
@@ -1406,38 +1402,25 @@ emit_kill_if(struct svga_shader_emitter *emit,
src0 = srcIn = translate_src_register( emit, reg );
- if (special || !w_tested) {
+ if (special) {
/* need a temp reg */
temp = get_temp( emit );
}
if (special) {
/* move the source into a temp register */
- submit_op1( emit, inst_token( SVGA3DOP_MOV ),
- writemask( temp, TGSI_WRITEMASK_XYZ ),
- src0 );
+ submit_op1(emit, inst_token(SVGA3DOP_MOV), temp, src0);
src0 = src( temp );
}
- /* do the texkill (on the xyz components) */
+ /* Do the texkill by checking if any of the XYZW components are < 0.
+ * Note that ps_2_0 and later take XYZW in consideration, while ps_1_x
+ * only used XYZ. The MSDN documentation about this is incorrect.
+ */
if (!submit_op0( emit, inst_token( SVGA3DOP_TEXKILL ), dst(src0) ))
return FALSE;
- if (!w_tested) {
- /* need to emit a second texkill to test the W component */
- /* put src.wwww into temp register */
- if (!submit_op1(emit,
- inst_token( SVGA3DOP_MOV ),
- writemask( temp, TGSI_WRITEMASK_XYZ ),
- scalar(srcIn, TGSI_SWIZZLE_W)))
- return FALSE;
-
- /* second texkill */
- if (!submit_op0( emit, inst_token( SVGA3DOP_TEXKILL ), temp ))
- return FALSE;
- }
-
return TRUE;
}