[Mesa-dev] [PATCH 13/14] i965: Do not flush texture and data port caches for clears

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


Clears don't sample or blend colors and therefore this is
unnecessary. This was a difference between blorp and meta clears.

This also drops the flushes for gen6_blorp_hiz_exec() which is used
for depth clears and resolves.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/brw_blorp.c         | 9 ---------
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp  | 9 +++++++++
 src/mesa/drivers/dri/i965/brw_blorp_clear.cpp | 2 ++
 3 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp.c b/src/mesa/drivers/dri/i965/brw_blorp.c
index 7a5f1d2..0d55b70 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp.c
+++ b/src/mesa/drivers/dri/i965/brw_blorp.c
@@ -287,15 +287,6 @@ brw_blorp_exec(struct brw_context *brw, const struct brw_blorp_params *params)
    const uint32_t estimated_max_batch_usage = brw->gen >= 8 ? 1800 : 1500;
    bool check_aperture_failed_once = false;
 
-   /* Flush the sampler and render caches.  We definitely need to flush the
-    * sampler cache so that we get updated contents from the render cache for
-    * the glBlitFramebuffer() source.  Also, we are sometimes warned in the
-    * docs to flush the cache between reinterpretations of the same surface
-    * data with different formats, which blorp does for stencil and depth
-    * data.
-    */
-   brw_emit_mi_flush(brw);
-
    brw_select_pipeline(brw, BRW_RENDER_PIPELINE);
 
 retry:
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index 633c438..8dc00bc 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -1971,6 +1971,15 @@ brw_blorp_blit_miptrees(struct brw_context *brw,
 
    params.src.swizzle = src_swizzle;
 
+   /* Flush the sampler and render caches.  We definitely need to flush the
+    * sampler cache so that we get updated contents from the render cache for
+    * the glBlitFramebuffer() source.  Also, we are sometimes warned in the
+    * docs to flush the cache between reinterpretations of the same surface
+    * data with different formats, which blorp does for stencil and depth
+    * data.
+    */
+   brw_emit_mi_flush(brw);
+
    brw_blorp_exec(brw, &params);
 
    intel_miptree_slice_set_needs_hiz_resolve(dst_mt, dst_level, dst_layer);
diff --git a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
index 3848e3e..041cd5e 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_clear.cpp
@@ -350,6 +350,8 @@ brw_blorp_resolve_color(struct brw_context *brw, struct intel_mipmap_tree *mt)
 
    brw_blorp_params_get_clear_kernel(brw, &params, true, true);
 
+   brw_emit_mi_flush(brw);
+
    brw_blorp_exec(brw, &params);
    mt->fast_clear_state = INTEL_FAST_CLEAR_STATE_RESOLVED;
 }
-- 
2.5.5



More information about the mesa-dev mailing list