i965/gen7: Allow URB_WRITE channel masks to be used.
authorPaul Berry <stereotype441@gmail.com>
Sun, 11 Aug 2013 04:57:59 +0000 (21:57 -0700)
committerPaul Berry <stereotype441@gmail.com>
Wed, 11 Sep 2013 18:17:24 +0000 (11:17 -0700)
Previously, brw_urb_WRITE() would unconditionally override the channel
masks in the URB_WRITE message to 0xff (indicating that all channels
should be written to the URB).

In order to support geometry shader EndPrimitive functionality, we'll
need the ability to set the channel masks programatically, so that we
can output just 32 of the control data bits at a time.  So this patch
adds a flag that will prevent brw_urb_WRITE() from overriding them.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_eu.h
src/mesa/drivers/dri/i965/brw_eu_emit.c

index 6ac1c684d21159d00397a1e603abd8d0fd2e1d9c..4d47cdd6221c03cbf13dfd95247ffd690a0ef4d4 100644 (file)
@@ -257,6 +257,12 @@ enum brw_urb_write_flags {
     */
    BRW_URB_WRITE_PER_SLOT_OFFSET = 0x10,
 
+   /**
+    * Indicates that the channel masks in the URB_WRITE message header should
+    * not be overridden to 0xff (gen == 7).
+    */
+   BRW_URB_WRITE_USE_CHANNEL_MASKS = 0x20,
+
    /**
     * Convenient combination of flags: end the thread while simultaneously
     * marking the given URB entry as complete.
index 36c494ee2b3bbb6a849b6ee677689c4567751ed1..a99a3544a2e38d70d7bda3044635909b7c8bf247 100644 (file)
@@ -2224,7 +2224,7 @@ void brw_urb_WRITE(struct brw_compile *p,
 
    gen6_resolve_implied_move(p, &src0, msg_reg_nr);
 
-   if (brw->gen == 7) {
+   if (brw->gen == 7 && !(flags & BRW_URB_WRITE_USE_CHANNEL_MASKS)) {
       /* Enable Channel Masks in the URB_WRITE_HWORD message header */
       brw_push_insn_state(p);
       brw_set_access_mode(p, BRW_ALIGN_1);