[Mesa-dev] [PATCH 12/14] i965/blorp/gen7+: Skip disabling already disabled stages

Topi Pohjolainen topi.pohjolainen at intel.com
Wed May 25 16:08:47 UTC 2016


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/gen7_blorp.c | 16 ++++++++++++++++
 src/mesa/drivers/dri/i965/gen8_blorp.c | 12 ++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.c b/src/mesa/drivers/dri/i965/gen7_blorp.c
index 3a12bb5..2e57d6b 100644
--- a/src/mesa/drivers/dri/i965/gen7_blorp.c
+++ b/src/mesa/drivers/dri/i965/gen7_blorp.c
@@ -273,6 +273,10 @@ gen7_blorp_emit_vs_disable(struct brw_context *brw)
 static void
 gen7_blorp_emit_hs_disable(struct brw_context *brw)
 {
+   if (!brw->tess_eval_program &&
+       !(gen7_hs_state.dirty.brw & brw->ctx.NewDriverState))
+      return;
+
    BEGIN_BATCH(7);
    OUT_BATCH(_3DSTATE_CONSTANT_HS << 16 | (7 - 2));
    OUT_BATCH(0);
@@ -302,6 +306,10 @@ gen7_blorp_emit_hs_disable(struct brw_context *brw)
 void
 gen7_blorp_emit_te_disable(struct brw_context *brw)
 {
+   if (!brw->tess_eval_program &&
+       !(gen7_te_state.dirty.brw & brw->ctx.NewDriverState))
+      return;
+
    BEGIN_BATCH(4);
    OUT_BATCH(_3DSTATE_TE << 16 | (4 - 2));
    OUT_BATCH(0);
@@ -328,6 +336,10 @@ gen7_blorp_emit_ds_disable(struct brw_context *brw)
    OUT_BATCH(0);
    ADVANCE_BATCH();
 
+   if (!brw->tess_eval_program &&
+       !(gen7_ds_state.dirty.brw & brw->ctx.NewDriverState))
+      return;
+
    BEGIN_BATCH(6);
    OUT_BATCH(_3DSTATE_DS << 16 | (6 - 2));
    OUT_BATCH(0);
@@ -355,6 +367,10 @@ gen7_blorp_emit_gs_disable(struct brw_context *brw)
    OUT_BATCH(0);
    ADVANCE_BATCH();
 
+   if (!brw->geometry_program &&
+       !(gen7_gs_state.dirty.brw & brw->ctx.NewDriverState))
+      return;
+
    /**
     * From Graphics BSpec: 3D-Media-GPGPU Engine > 3D Pipeline Stages >
     * Geometry > Geometry Shader > State:
diff --git a/src/mesa/drivers/dri/i965/gen8_blorp.c b/src/mesa/drivers/dri/i965/gen8_blorp.c
index c0384b4..10d6b1b 100644
--- a/src/mesa/drivers/dri/i965/gen8_blorp.c
+++ b/src/mesa/drivers/dri/i965/gen8_blorp.c
@@ -213,6 +213,10 @@ gen8_blorp_emit_vs_disable(struct brw_context *brw)
 static void
 gen8_blorp_emit_hs_disable(struct brw_context *brw)
 {
+   if (!brw->tess_eval_program &&
+       !(gen8_hs_state.dirty.brw & brw->ctx.NewDriverState))
+      return;
+
    BEGIN_BATCH(9);
    OUT_BATCH(_3DSTATE_HS << 16 | (9 - 2));
    OUT_BATCH(0);
@@ -233,6 +237,10 @@ gen8_blorp_emit_hs_disable(struct brw_context *brw)
 static void
 gen8_blorp_emit_ds_disable(struct brw_context *brw)
 {
+   if (!brw->tess_eval_program &&
+       !(gen8_ds_state.dirty.brw & brw->ctx.NewDriverState))
+      return;
+
    const int ds_pkt_len = brw->gen >= 9 ? 11 : 9;
    BEGIN_BATCH(ds_pkt_len);
    OUT_BATCH(_3DSTATE_DS << 16 | (ds_pkt_len - 2));
@@ -248,6 +256,10 @@ gen8_blorp_emit_ds_disable(struct brw_context *brw)
 static void
 gen8_blorp_emit_gs_disable(struct brw_context *brw)
 {
+   if (!brw->geometry_program &&
+       !(gen8_gs_state.dirty.brw & brw->ctx.NewDriverState))
+      return;
+
    BEGIN_BATCH(10);
    OUT_BATCH(_3DSTATE_GS << 16 | (10 - 2));
    OUT_BATCH(0);
-- 
2.5.5



More information about the mesa-dev mailing list