* Kill fragment if any of the four values is less than zero.
*/
static void
-exec_kilp(struct tgsi_exec_machine *mach,
- const struct tgsi_full_instruction *inst)
+exec_kil(struct tgsi_exec_machine *mach,
+ const struct tgsi_full_instruction *inst)
{
uint uniquemask;
uint chan_index;
mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0] |= kilmask;
}
+/**
+ * Execute NVIDIA-style KIL which is predicated by a condition code.
+ * Kill fragment if the condition code is TRUE.
+ */
+static void
+exec_kilp(struct tgsi_exec_machine *mach,
+ const struct tgsi_full_instruction *inst)
+{
+ uint kilmask = 0; /* bit 0 = pixel 0, bit 1 = pixel 1, etc */
+
+ /* TODO: build kilmask from CC mask */
+
+ mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0] |= kilmask;
+}
+
/*
* Fetch a texel using STR texture coordinates.
break;
case TGSI_OPCODE_KIL:
- /* for enabled ExecMask bits, set the killed bit */
- mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0] |= mach->ExecMask;
+ exec_kil (mach, inst);
break;
case TGSI_OPCODE_PK2H:
*/
static void
-emit_kilp(
+emit_kil(
struct x86_function *func,
const struct tgsi_full_src_register *reg )
{
static void
-emit_kil(
+emit_kilp(
struct x86_function *func )
{
/* XXX todo / fix me */
case TGSI_OPCODE_KILP:
/* predicated kill */
- emit_kilp( func, &inst->FullSrcRegisters[0] );
+ emit_kilp( func );
+ return 0; /* XXX fix me */
break;
case TGSI_OPCODE_KIL:
- /* unconditional kill */
- emit_kil( func );
- return 0; /* XXX fix me */
+ /* conditional kill */
+ emit_kil( func, &inst->FullSrcRegisters[0] );
break;
case TGSI_OPCODE_PK2H: