i965: Fix up gen6 samplers for their usage by brw_wm_emit.c
authorEric Anholt <eric@anholt.net>
Fri, 3 Dec 2010 22:30:38 +0000 (14:30 -0800)
committerEric Anholt <eric@anholt.net>
Mon, 6 Dec 2010 08:14:22 +0000 (00:14 -0800)
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

index e7e72e6b58cce78945b779b4e93fe1134fab1e69..8782f726398641d7f885270fbf8c2acf3a5b4b34 100644 (file)
@@ -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);