i965: Add support for KIL_NV in brw_wm_emit.c

I ran into this lack of support when writing a shader that always discarded
the fragments.
This commit is contained in:
Eric Anholt
2009-09-03 09:11:44 -07:00
parent 9216b4e7be
commit 8f7f22ca1d
2 changed files with 19 additions and 0 deletions
+18
View File
@@ -908,6 +908,20 @@ static void emit_kil( struct brw_wm_compile *c,
}
}
/* KIL_NV kills the pixels that are currently executing, not based on a test
* of the arguments.
*/
static void emit_kil_nv( struct brw_wm_compile *c )
{
struct brw_compile *p = &c->func;
struct brw_reg r0uw = retype(brw_vec1_grf(0, 0), BRW_REGISTER_TYPE_UW);
brw_push_insn_state(p);
brw_set_mask_control(p, BRW_MASK_DISABLE);
brw_NOT(p, c->emit_mask_reg, brw_mask_reg(1)); //IMASK
brw_AND(p, r0uw, c->emit_mask_reg, r0uw);
brw_pop_insn_state(p);
}
static void fire_fb_write( struct brw_wm_compile *c,
GLuint base_reg,
@@ -1387,6 +1401,10 @@ void brw_wm_emit( struct brw_wm_compile *c )
emit_kil(c, args[0]);
break;
case OPCODE_KIL_NV:
emit_kil_nv(c);
break;
default:
_mesa_printf("Unsupported opcode %i (%s) in fragment shader\n",
inst->opcode, inst->opcode < MAX_OPCODE ?
+1
View File
@@ -270,6 +270,7 @@ void brw_wm_pass1( struct brw_wm_compile *c )
case OPCODE_DST:
case WM_FRONTFACING:
case OPCODE_KIL_NV:
default:
break;
}