[Mesa-dev] [PATCH 09/16] i965/miptree: Add color resolve end-of-pipe-sync before sharing

Topi Pohjolainen topi.pohjolainen at gmail.com
Fri Feb 17 19:32:12 UTC 2017


Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
 src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
index 717a320..b0148d2 100644
--- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
@@ -2332,6 +2332,8 @@ void
 intel_miptree_make_shareable(struct brw_context *brw,
                              struct intel_mipmap_tree *mt)
 {
+   bool need_sync = false;
+
    /* MCS buffers are also used for multisample buffers, but we can't resolve
     * away a multisample MCS buffer because it's an integral part of how the
     * pixel data is stored.  Fortunately this code path should never be
@@ -2340,7 +2342,7 @@ intel_miptree_make_shareable(struct brw_context *brw,
    assert(mt->msaa_layout == INTEL_MSAA_LAYOUT_NONE || mt->num_samples <= 1);
 
    if (mt->mcs_buf) {
-      intel_miptree_all_slices_resolve_color(brw, mt, 0);
+      need_sync |= intel_miptree_all_slices_resolve_color(brw, mt, 0);
       mt->aux_disable |= (INTEL_AUX_DISABLE_CCS | INTEL_AUX_DISABLE_MCS);
       drm_intel_bo_unreference(mt->mcs_buf->bo);
       free(mt->mcs_buf);
@@ -2369,6 +2371,11 @@ intel_miptree_make_shareable(struct brw_context *brw,
        */
       exec_list_make_empty(&mt->hiz_map);
    }
+
+   if (need_sync) {
+      brw_end_of_pipe_sync(brw);
+      brw_render_cache_set_clear(brw);
+   }
 }
 
 
-- 
2.5.5



More information about the mesa-dev mailing list