[Mesa-dev] [PATCH 1/6] i965: Move blorp resolve setup into brw_blorp_blit_miptrees().

Eric Anholt eric at anholt.net
Tue Apr 30 12:56:32 PDT 2013


There was some comment about trying to avoid marking resolves in
updownsample, but if the downsample is never actually rendered to, then
the required resolve tracked in the downsample will never be executed, so
who cares?
---
 src/mesa/drivers/dri/i965/brw_blorp_blit.cpp   | 12 +++++-------
 src/mesa/drivers/dri/intel/intel_mipmap_tree.c | 11 -----------
 2 files changed, 5 insertions(+), 18 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
index d4b1fda..32da141 100644
--- a/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
+++ b/src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
@@ -132,6 +132,9 @@ brw_blorp_blit_miptrees(struct intel_context *intel,
                         int dst_x1, int dst_y1,
                         bool mirror_x, bool mirror_y)
 {
+   intel_miptree_slice_resolve_depth(intel, src_mt, src_level, src_layer);
+   intel_miptree_slice_resolve_depth(intel, dst_mt, dst_level, dst_layer);
+
    brw_blorp_blit_params params(brw_context(&intel->ctx),
                                 src_mt, src_level, src_layer,
                                 dst_mt, dst_level, dst_layer,
@@ -140,6 +143,8 @@ brw_blorp_blit_miptrees(struct intel_context *intel,
                                 dst_x1, dst_y1,
                                 mirror_x, mirror_y);
    brw_blorp_exec(intel, &params);
+
+   intel_miptree_slice_set_needs_hiz_resolve(dst_mt, dst_level, dst_layer);
 }
 
 static void
@@ -154,12 +159,6 @@ do_blorp_blit(struct intel_context *intel, GLbitfield buffer_bit,
    struct intel_mipmap_tree *src_mt = find_miptree(buffer_bit, src_irb);
    struct intel_mipmap_tree *dst_mt = find_miptree(buffer_bit, dst_irb);
 
-   /* Get ready to blit.  This includes depth resolving the src and dst
-    * buffers if necessary.
-    */
-   intel_renderbuffer_resolve_depth(intel, src_irb);
-   intel_renderbuffer_resolve_depth(intel, dst_irb);
-
    /* Do the blit */
    brw_blorp_blit_miptrees(intel,
                            src_mt, src_irb->mt_level, src_irb->mt_layer,
@@ -167,7 +166,6 @@ do_blorp_blit(struct intel_context *intel, GLbitfield buffer_bit,
                            srcX0, srcY0, dstX0, dstY0, dstX1, dstY1,
                            mirror_x, mirror_y);
 
-   intel_renderbuffer_set_needs_hiz_resolve(dst_irb);
    intel_renderbuffer_set_needs_downsample(dst_irb);
 }
 
diff --git a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
index 12a4a22..586599e 100644
--- a/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/intel/intel_mipmap_tree.c
@@ -1289,9 +1289,6 @@ intel_miptree_updownsample(struct intel_context *intel,
    int dst_x0 = 0;
    int dst_y0 = 0;
 
-   intel_miptree_slice_resolve_depth(intel, src, 0, 0);
-   intel_miptree_slice_resolve_depth(intel, dst, 0, 0);
-
    brw_blorp_blit_miptrees(intel,
                            src, 0 /* level */, 0 /* layer */,
                            dst, 0 /* level */, 0 /* layer */,
@@ -1339,13 +1336,6 @@ intel_miptree_downsample(struct intel_context *intel,
                               mt->logical_width0,
                               mt->logical_height0);
    mt->need_downsample = false;
-
-   /* Strictly speaking, after a downsample on a depth miptree, a hiz
-    * resolve is needed on the singlesample miptree. However, since the
-    * singlesample miptree is never rendered to, the hiz resolve will never
-    * occur. Therefore we do not mark the needed hiz resolve after
-    * downsampling.
-    */
 }
 
 /**
@@ -1365,7 +1355,6 @@ intel_miptree_upsample(struct intel_context *intel,
                               mt->singlesample_mt, mt,
                               mt->logical_width0,
                               mt->logical_height0);
-   intel_miptree_slice_set_needs_hiz_resolve(mt, 0, 0);
 }
 
 void *
-- 
1.8.3.rc0



More information about the mesa-dev mailing list