Mesa (master): i965: Never enable the GS on Gen6.

Kenneth Graunke kwg at kemper.freedesktop.org
Tue Apr 12 15:30:23 PDT 2011


Module: Mesa
Branch: master
Commit: 35b3f597bd1729da4483857cc0e88e81fb2a2419
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=35b3f597bd1729da4483857cc0e88e81fb2a2419

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Apr 11 11:00:03 2011 -0700

i965: Never enable the GS on Gen6.

Prior to Gen6, we use the GS for breaking down quads, quad-strips,
and line loops.  On Gen6, earlier stages already take care of this,
so we never need the GS.

Since this code is likely completely untested, remove it for now.
We can write new code when enabling real geometry shaders.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
Reviewed-by: Eric Anholt <eric at anholt.net>

---

 src/mesa/drivers/dri/i965/gen6_gs_state.c |   48 +++++++++-------------------
 1 files changed, 16 insertions(+), 32 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen6_gs_state.c b/src/mesa/drivers/dri/i965/gen6_gs_state.c
index 7296c7c..c1d0a73 100644
--- a/src/mesa/drivers/dri/i965/gen6_gs_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_gs_state.c
@@ -44,38 +44,22 @@ upload_gs_state(struct brw_context *brw)
    OUT_BATCH(0);
    ADVANCE_BATCH();
 
-   if (brw->gs.prog_bo) {
-      BEGIN_BATCH(7);
-      OUT_BATCH(_3DSTATE_GS << 16 | (7 - 2));
-      OUT_RELOC(brw->gs.prog_bo, I915_GEM_DOMAIN_INSTRUCTION, 0, 0);
-      OUT_BATCH(GEN6_GS_SPF_MODE |
-		(0 << GEN6_GS_SAMPLER_COUNT_SHIFT) |
-		(0 << GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT));
-      OUT_BATCH(0); /* scratch space base offset */
-      OUT_BATCH((1 << GEN6_GS_DISPATCH_START_GRF_SHIFT) |
-		(brw->gs.prog_data->urb_read_length << GEN6_GS_URB_READ_LENGTH_SHIFT) |
-		(0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT));
-      OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) |
-		GEN6_GS_STATISTICS_ENABLE |
-		GEN6_GS_RENDERING_ENABLE);
-      OUT_BATCH(GEN6_GS_ENABLE);
-      ADVANCE_BATCH();
-   } else {
-      BEGIN_BATCH(7);
-      OUT_BATCH(_3DSTATE_GS << 16 | (7 - 2));
-      OUT_BATCH(0); /* prog_bo */
-      OUT_BATCH((0 << GEN6_GS_SAMPLER_COUNT_SHIFT) |
-		(0 << GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT));
-      OUT_BATCH(0); /* scratch space base offset */
-      OUT_BATCH((1 << GEN6_GS_DISPATCH_START_GRF_SHIFT) |
-		(0 << GEN6_GS_URB_READ_LENGTH_SHIFT) |
-		(0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT));
-      OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) |
-		GEN6_GS_STATISTICS_ENABLE |
-		GEN6_GS_RENDERING_ENABLE);
-      OUT_BATCH(0);
-      ADVANCE_BATCH();
-   }
+   // GS should never be used on Gen6.  Disable it.
+   assert(brw->gs.prog_bo == NULL);
+   BEGIN_BATCH(7);
+   OUT_BATCH(_3DSTATE_GS << 16 | (7 - 2));
+   OUT_BATCH(0); /* prog_bo */
+   OUT_BATCH((0 << GEN6_GS_SAMPLER_COUNT_SHIFT) |
+	     (0 << GEN6_GS_BINDING_TABLE_ENTRY_COUNT_SHIFT));
+   OUT_BATCH(0); /* scratch space base offset */
+   OUT_BATCH((1 << GEN6_GS_DISPATCH_START_GRF_SHIFT) |
+	     (0 << GEN6_GS_URB_READ_LENGTH_SHIFT) |
+	     (0 << GEN6_GS_URB_ENTRY_READ_OFFSET_SHIFT));
+   OUT_BATCH((0 << GEN6_GS_MAX_THREADS_SHIFT) |
+	     GEN6_GS_STATISTICS_ENABLE |
+	     GEN6_GS_RENDERING_ENABLE);
+   OUT_BATCH(0);
+   ADVANCE_BATCH();
 }
 
 const struct brw_tracked_state gen6_gs_state = {



More information about the mesa-commit mailing list