i965/gs: Add a flag allowing URB write messages to use a per-slot offset.
authorPaul Berry <stereotype441@gmail.com>
Thu, 21 Mar 2013 16:11:12 +0000 (09:11 -0700)
committerPaul Berry <stereotype441@gmail.com>
Fri, 23 Aug 2013 18:03:12 +0000 (11:03 -0700)
This will be used by geometry shaders to implement the EmitVertex()
function, since it requires writing data to a dynamically-determined
offset within the geometry shader's URB entry.

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

index ae4cab56637b56843c9539aad01219e2c5a50b2f..9053ea2f86b6b36c32abceb5f6c2f8af1b2c01bb 100644 (file)
@@ -251,6 +251,12 @@ enum brw_urb_write_flags {
     */
    BRW_URB_WRITE_COMPLETE = 0x8,
 
+   /**
+    * Indicates that an additional offset (which may be different for the two
+    * vec4 slots) is stored in the message header (gen == 7).
+    */
+   BRW_URB_WRITE_PER_SLOT_OFFSET = 0x10,
+
    /**
     * Convenient combination of flags: end the thread while simultaneously
     * marking the given URB entry as complete.
index 622b22f79818ddbd615db237db7c0660453eeb0d..b55b57e2e82480a4ba65e1eab0a771716ec4ecda 100644 (file)
@@ -531,8 +531,8 @@ static void brw_set_urb_message( struct brw_compile *p,
       insn->bits3.urb_gen7.offset = offset;
       assert(swizzle_control != BRW_URB_SWIZZLE_TRANSPOSE);
       insn->bits3.urb_gen7.swizzle_control = swizzle_control;
-      /* per_slot_offset = 0 makes it ignore offsets in message header */
-      insn->bits3.urb_gen7.per_slot_offset = 0;
+      insn->bits3.urb_gen7.per_slot_offset =
+         flags & BRW_URB_WRITE_PER_SLOT_OFFSET ? 1 : 0;
       insn->bits3.urb_gen7.complete = flags & BRW_URB_WRITE_COMPLETE ? 1 : 0;
    } else if (brw->gen >= 5) {
       insn->bits3.urb_gen5.opcode = 0; /* URB_WRITE */