i965/gs: Add dummy source to prepare_channel_masks instruction.
authorMatt Turner <mattst88@gmail.com>
Sun, 30 Mar 2014 00:44:45 +0000 (17:44 -0700)
committerMatt Turner <mattst88@gmail.com>
Tue, 15 Apr 2014 16:24:09 +0000 (09:24 -0700)
The generator uses its destination as a source implicitly, which breaks
some assumptions in dead code elimination. Giving the instruction a
source allows us to reason about it better.

src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp

index 13d6d385a2f2d4c127cf49af7001d7a1a57024fc..1321a94d6581bca1e2ef1323e93431804618075a 100644 (file)
@@ -408,7 +408,8 @@ vec4_gs_visitor::emit_control_data_bits()
          src_reg channel_mask(this, glsl_type::uint_type);
          inst = emit(SHL(dst_reg(channel_mask), one, channel));
          inst->force_writemask_all = true;
-         emit(GS_OPCODE_PREPARE_CHANNEL_MASKS, dst_reg(channel_mask));
+         emit(GS_OPCODE_PREPARE_CHANNEL_MASKS, dst_reg(channel_mask),
+                                               channel_mask);
          emit(GS_OPCODE_SET_CHANNEL_MASKS, mrf_reg, channel_mask);
       }