[Mesa-dev] [v2 6/7] i965/blorp: Reconfigure base state address only if needed

Topi Pohjolainen topi.pohjolainen at intel.com
Fri Apr 22 18:05:28 UTC 2016


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/gen6_blorp.cpp | 3 ++-
 src/mesa/drivers/dri/i965/gen7_blorp.cpp | 3 ++-
 src/mesa/drivers/dri/i965/gen8_blorp.cpp | 4 +++-
 3 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/gen6_blorp.cpp b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
index cc7cbd5..5c0fa0c 100644
--- a/src/mesa/drivers/dri/i965/gen6_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen6_blorp.cpp
@@ -989,7 +989,8 @@ gen6_blorp_exec(struct brw_context *brw,
    /* Emit workaround flushes when we switch from drawing to blorping. */
    brw_emit_post_sync_nonzero_flush(brw);
 
-   brw_state_base_address.emit(brw);
+   if (brw_state_base_address.dirty.brw & brw->ctx.NewDriverState)
+      brw_state_base_address.emit(brw);
 
    gen6_emit_3dstate_multisample(brw, params->dst.num_samples);
    gen6_emit_3dstate_sample_mask(brw,
diff --git a/src/mesa/drivers/dri/i965/gen7_blorp.cpp b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
index a44c186..1520469 100644
--- a/src/mesa/drivers/dri/i965/gen7_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen7_blorp.cpp
@@ -814,7 +814,8 @@ gen7_blorp_exec(struct brw_context *brw,
 
    uint32_t prog_offset = params->get_wm_prog(brw, &prog_data);
 
-   brw_state_base_address.emit(brw);
+   if (brw_state_base_address.dirty.brw & brw->ctx.NewDriverState)
+      brw_state_base_address.emit(brw);
 
    gen6_emit_3dstate_multisample(brw, params->dst.num_samples);
    gen6_emit_3dstate_sample_mask(brw,
diff --git a/src/mesa/drivers/dri/i965/gen8_blorp.cpp b/src/mesa/drivers/dri/i965/gen8_blorp.cpp
index 1bd9b97..d8ad5ea 100644
--- a/src/mesa/drivers/dri/i965/gen8_blorp.cpp
+++ b/src/mesa/drivers/dri/i965/gen8_blorp.cpp
@@ -635,7 +635,9 @@ gen8_blorp_exec(struct brw_context *brw, const brw_blorp_params *params)
 
    uint32_t prog_offset = params->get_wm_prog(brw, &prog_data);
 
-   gen8_upload_state_base_address(brw);
+   if (gen8_state_base_address.dirty.brw & brw->ctx.NewDriverState)
+      gen8_upload_state_base_address(brw);
+
    gen7_blorp_emit_cc_viewport(brw);
    gen7_l3_state.emit(brw);
 
-- 
2.5.5



More information about the mesa-dev mailing list