These correspond to the NV and ARB-style fragment program KIL instructions.
The former is really supposed to examine the NV condition codes but Mesa's
GLSL compiler always emits unconditional KIL instructions.
"OPCODE_COS",
"OPCODE_DDX",
"OPCODE_DDY",
- "OPCODE_KIL",
+ "OPCODE_KILP",
"OPCODE_PK2H",
"OPCODE_PK2US",
"OPCODE_PK4B",
"OPCODE_IFC",
"OPCODE_BREAKC",
"OPCODE_TXP",
+ "OPCODE_KIL",
"OPCODE_END"
};
"COS",
"DDX",
"DDY",
- "KIL",
+ "KILP",
"PK2H",
"PK2US",
"PK4B",
"IFC",
"BREAKC",
"TXP",
+ "KIL",
"END"
};
store_dest (mach, VAL, &inst->FullDstRegisters[INDEX], inst, CHAN )
+/**
+ * Execute ARB-style KIL which is predicated by a src register.
+ * Kill fragment if any of the four values is less than zero.
+ */
static void
-exec_kil (struct tgsi_exec_machine *mach,
+exec_kilp(struct tgsi_exec_machine *mach,
const struct tgsi_full_instruction *inst)
{
GLuint uniquemask;
}
+static void
+exec_kil(struct tgsi_exec_machine *mach,
+ const struct tgsi_full_instruction *inst)
+{
+ /* for enabled ExecMask bits, set the killed bit */
+ mach->Temps[TEMP_KILMASK_I].xyzw[TEMP_KILMASK_C].u[0] |= mach->ExecMask;
+}
+
/*
}
break;
+ case TGSI_OPCODE_KILP:
+ exec_kilp (mach, inst);
+ break;
+
case TGSI_OPCODE_KIL:
exec_kil (mach, inst);
break;
#define TGSI_OPCODE_EX2 TGSI_OPCODE_EXPBASE2
#define TGSI_OPCODE_FLR TGSI_OPCODE_FLOOR
#define TGSI_OPCODE_FRC TGSI_OPCODE_FRAC
-#define TGSI_OPCODE_KIL 39
+#define TGSI_OPCODE_KILP 39 /* predicated kill */
#define TGSI_OPCODE_LG2 TGSI_OPCODE_LOGBASE2
/* TGSI_OPCODE_LIT */
#define TGSI_OPCODE_LRP TGSI_OPCODE_LERP
/* TGSI_OPCODE_MOVA */
/* TGSI_OPCODE_LOGP */
-#define TGSI_OPCODE_END 133 /* aka HALT */
+#define TGSI_OPCODE_KIL 133 /* unpredicated kill */
+#define TGSI_OPCODE_END 134 /* aka HALT */
-#define TGSI_OPCODE_LAST 134
+#define TGSI_OPCODE_LAST 135
#define TGSI_SAT_NONE 0 /* do not saturate */
#define TGSI_SAT_ZERO_ONE 1 /* clamp to [0,1] */
fullinst->Instruction.Opcode = TGSI_OPCODE_INT;\r
break;\r
case OPCODE_KIL:\r
+ /* predicated w/ a register */\r
+ fullinst->Instruction.Opcode = TGSI_OPCODE_KILP;\r
+ break;\r
+ case OPCODE_KIL_NV:\r
+ /* unpredicated */\r
+ assert(inst->DstReg.CondMask == COND_TR);\r
fullinst->Instruction.Opcode = TGSI_OPCODE_KIL;\r
break;\r
case OPCODE_LG2:\r