Mesa (broadwell): force overrides for SBE

Kenneth Graunke kwg at kemper.freedesktop.org
Sat Feb 1 01:10:14 UTC 2014


Module: Mesa
Branch: broadwell
Commit: 6764162c3838c9face68ce603a1bb0c308707557
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6764162c3838c9face68ce603a1bb0c308707557

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Fri Jan 31 16:49:05 2014 -0800

force overrides for SBE

---

 src/mesa/drivers/dri/i965/brw_defines.h   |    1 +
 src/mesa/drivers/dri/i965/gen8_sf_state.c |   15 +++++++++++----
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h
index 31f9767..75d09fc 100644
--- a/src/mesa/drivers/dri/i965/brw_defines.h
+++ b/src/mesa/drivers/dri/i965/brw_defines.h
@@ -1683,6 +1683,7 @@ enum brw_message_target {
 #define _3DSTATE_SBE				0x781F /* GEN7+ */
 /* DW1 */
 # define GEN8_SBE_FORCE_URB_ENTRY_READ_LENGTH           (1 << 29)
+# define GEN8_SBE_FORCE_URB_ENTRY_READ_OFFSET           (1 << 28)
 # define GEN7_SBE_SWIZZLE_CONTROL_MODE			(1 << 28)
 # define GEN7_SBE_NUM_OUTPUTS_SHIFT			22
 # define GEN7_SBE_SWIZZLE_ENABLE			(1 << 21)
diff --git a/src/mesa/drivers/dri/i965/gen8_sf_state.c b/src/mesa/drivers/dri/i965/gen8_sf_state.c
index 040261f..a5cd9f8 100644
--- a/src/mesa/drivers/dri/i965/gen8_sf_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_sf_state.c
@@ -40,7 +40,6 @@ upload_sbe(struct brw_context *brw)
    uint32_t point_sprite_enables;
    uint32_t flat_enables;
 
-   /* TODO: There are also some Primitive ID bits in here... */
    uint32_t dw1 =
       GEN7_SBE_SWIZZLE_ENABLE |
       num_outputs << GEN7_SBE_NUM_OUTPUTS_SHIFT;
@@ -66,10 +65,19 @@ upload_sbe(struct brw_context *brw)
                             &flat_enables,
                             &urb_entry_read_length);
 
-   /* XXX: should move to 3DSTATE_VS */
+   /* Typically, the URB entry read length and offset should be programmed in
+    * 3DSTATE_VS and 3DSTATE_GS; SBE inherits it from the last active stage
+    * which produces geometry.  However, we don't know the proper value until
+    * we call calculate_attr_overrides().
+    *
+    * To fit with our existing code, we override the inherited values and
+    * specify it here directly, as we did on previous generations.
+    */
    dw1 |=
       urb_entry_read_length << GEN7_SBE_URB_ENTRY_READ_LENGTH_SHIFT |
-      GEN8_SBE_FORCE_URB_ENTRY_READ_LENGTH;
+      BRW_SF_URB_ENTRY_READ_OFFSET << GEN8_SBE_URB_ENTRY_READ_OFFSET_SHIFT |
+      GEN8_SBE_FORCE_URB_ENTRY_READ_LENGTH |
+      GEN8_SBE_FORCE_URB_ENTRY_READ_OFFSET;
 
    BEGIN_BATCH(4);
    OUT_BATCH(_3DSTATE_SBE << 16 | (4 - 2));
@@ -113,7 +121,6 @@ upload_sf(struct brw_context *brw)
 
    /* _NEW_LINE */
    uint32_t line_width_u3_7 = U_FIXED(CLAMP(ctx->Line.Width, 0.0, 7.99), 7);
-   /* TODO(gen8): line width of 0 is not allowed when MSAA enabled */
    if (line_width_u3_7 == 0)
       line_width_u3_7 = 1;
    dw2 |= line_width_u3_7 << GEN6_SF_LINE_WIDTH_SHIFT;




More information about the mesa-commit mailing list