i965: Move blorp resolve setup into brw_blorp_blit_miptrees().
authorEric Anholt <eric@anholt.net>
Tue, 30 Apr 2013 17:48:09 +0000 (10:48 -0700)
committerEric Anholt <eric@anholt.net>
Mon, 6 May 2013 21:33:27 +0000 (14:33 -0700)
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?

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_blorp_blit.cpp
src/mesa/drivers/dri/intel/intel_mipmap_tree.c

index d4b1fda80cdd95024dd757ed8742d0c0a8372178..32da1415fd252d59af1933dc871fcee7a353eb14 100644 (file)
@@ -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);
 }
 
index c5f9f1fc8afc28c3d8d4347002acbefb2bfa59d3..89702282576b8ff14cdac77b59ab7d6664ce92c3 100644 (file)
@@ -1288,9 +1288,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 */,
@@ -1338,13 +1335,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.
-    */
 }
 
 /**
@@ -1364,7 +1354,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 *