Mesa (master): i965: Fix up gen6 samplers for their usage by brw_wm_emit.c

Eric Anholt anholt at kemper.freedesktop.org
Mon Dec 6 00:15:45 PST 2010


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

Author: Eric Anholt <eric at anholt.net>
Date:   Fri Dec  3 14:30:38 2010 -0800

i965: Fix up gen6 samplers for their usage by brw_wm_emit.c

We were trying to do the implied move even when we'd already manually
moved the real header in place.

---

 src/mesa/drivers/dri/i965/brw_eu_emit.c |   16 +++++++++-------
 1 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c
index e7e72e6..8782f72 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_emit.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c
@@ -1947,13 +1947,15 @@ void brw_SAMPLE(struct brw_compile *p,
        * and the first message register index comes from src0.
        */
       if (intel->gen >= 6) {
-	  brw_push_insn_state(p);
-	  brw_set_mask_control( p, BRW_MASK_DISABLE );
-	  brw_set_compression_control(p, BRW_COMPRESSION_NONE);
-	  /* m1 contains header? */
-	  brw_MOV(p, brw_message_reg(msg_reg_nr), src0);
-	  brw_pop_insn_state(p);
-	  src0 = brw_message_reg(msg_reg_nr);
+	 if (src0.file != BRW_ARCHITECTURE_REGISTER_FILE ||
+	     src0.nr != BRW_ARF_NULL) {
+	    brw_push_insn_state(p);
+	    brw_set_mask_control( p, BRW_MASK_DISABLE );
+	    brw_set_compression_control(p, BRW_COMPRESSION_NONE);
+	    brw_MOV(p, brw_message_reg(msg_reg_nr), src0);
+	    brw_pop_insn_state(p);
+	 }
+	 src0 = brw_message_reg(msg_reg_nr);
       }
 
       insn = next_insn(p, BRW_OPCODE_SEND);



More information about the mesa-commit mailing list