Mesa (master): i915: Correctly generate unconditional KIL instructions

Ian Romanick idr at kemper.freedesktop.org
Wed Dec 1 20:04:34 UTC 2010


Module: Mesa
Branch: master
Commit: c92550be64abd454560556599cd95b237f4375b1
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c92550be64abd454560556599cd95b237f4375b1

Author: Ian Romanick <ian.d.romanick at intel.com>
Date:   Wed Dec  1 11:57:33 2010 -0800

i915: Correctly generate unconditional KIL instructions

Fixes piglit test glsl-fs-discard-03.

NOTE: This is a candidate for the 7.9 branch.

---

 src/mesa/drivers/dri/i915/i915_fragprog.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/src/mesa/drivers/dri/i915/i915_fragprog.c b/src/mesa/drivers/dri/i915/i915_fragprog.c
index c00ee41..7a9fb7f 100644
--- a/src/mesa/drivers/dri/i915/i915_fragprog.c
+++ b/src/mesa/drivers/dri/i915/i915_fragprog.c
@@ -569,10 +569,14 @@ upload_program(struct i915_fragment_program *p)
 	 if (inst->DstReg.CondMask == COND_TR) {
 	    tmp = i915_get_utemp(p);
 
+	    /* The KIL instruction discards the fragment if any component of
+	     * the source is < 0.  Emit an immediate operand of {-1}.xywz.
+	     */
 	    i915_emit_texld(p, get_live_regs(p, inst),
 			    tmp, A0_DEST_CHANNEL_ALL,
 			    0, /* use a dummy dest reg */
-			    swizzle(tmp, ONE, ONE, ONE, ONE), /* always */
+			    negate(swizzle(tmp, ONE, ONE, ONE, ONE),
+				   1, 1, 1, 1),
 			    T0_TEXKILL);
 	 } else {
 	    p->error = 1;




More information about the mesa-commit mailing list