i965/blorp: Reconfigure base state address only if needed
authorTopi Pohjolainen <topi.pohjolainen@intel.com>
Fri, 15 Apr 2016 21:10:40 +0000 (00:10 +0300)
committerTopi Pohjolainen <topi.pohjolainen@intel.com>
Sat, 23 Apr 2016 04:09:39 +0000 (07:09 +0300)
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/gen6_blorp.cpp
src/mesa/drivers/dri/i965/gen7_blorp.cpp
src/mesa/drivers/dri/i965/gen8_blorp.cpp

index cc7cbd5b46c6579da464b846b1e6c3fb6b74cc74..5c0fa0c144a6e640ae929c21bacb3281e122b094 100644 (file)
@@ -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,
index a44c186f5c361f15f1978166a2d4b032fccb33cd..1520469e131d3e1e78018ed0388b2e1adf16bb56 100644 (file)
@@ -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,
index 1bd9b97bb8fa7ef408c597d715a398b364724855..d8ad5ea1b5f6cf31a0e93e3715e9843450cefe26 100644 (file)
@@ -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);