Remove the last external user of intel_miptree::fast_color_clear in
favor of the setter function.
---
 src/mesa/drivers/dri/i965/brw_clear.c | 47 +++--------------------------------
 1 file changed, 4 insertions(+), 43 deletions(-)

diff --git a/src/mesa/drivers/dri/i965/brw_clear.c 
b/src/mesa/drivers/dri/i965/brw_clear.c
index fedd31a4317..bfcc943255b 100644
--- a/src/mesa/drivers/dri/i965/brw_clear.c
+++ b/src/mesa/drivers/dri/i965/brw_clear.c
@@ -172,49 +172,10 @@ brw_fast_clear_depth(struct gl_context *ctx)
 
    const uint32_t num_layers = depth_att->Layered ? depth_irb->layer_count : 1;
 
-   /* If we're clearing to a new clear value, then we need to ensure that the
-    * old clear blocks will be overwritten.
-    */
-   if (mt->fast_clear_color.f32[0] != clear_value) {
-      for (uint32_t level = mt->first_level; level <= mt->last_level; level++) 
{
-         if (!intel_miptree_level_has_hiz(mt, level))
-            continue;
-
-         const unsigned level_layers = brw_get_num_logical_layers(mt, level);
-
-         for (uint32_t layer = 0; layer < level_layers; layer++) {
-            if (level == depth_irb->mt_level &&
-                layer >= depth_irb->mt_layer &&
-                layer < depth_irb->mt_layer + num_layers) {
-               /* We're going to clear this layer anyway. */
-               continue;
-            }
-
-            enum isl_aux_state aux_state =
-               intel_miptree_get_aux_state(mt, level, layer);
-
-            if (aux_state != ISL_AUX_STATE_CLEAR &&
-                aux_state != ISL_AUX_STATE_COMPRESSED_CLEAR) {
-               /* This slice doesn't have any fast-cleared bits. */
-               continue;
-            }
-
-            /* If we got here, then the level may have fast-clear bits that use
-             * the old clear value. Since a slow cleared block is the same size
-             * a fast-cleared block, the bandwidth savings likely aren't enough
-             * to justify a full resolve. Fall back to slow clear. Fortunately,
-             * few applications ever change their depth clear value so this
-             * shouldn't happen often.
-             */
-            return false;
-         }
-      }
-
-      MAYBE_UNUSED bool new_clear =
-         intel_miptree_set_depth_clear_value(brw, mt, depth_irb->mt_level,
-                                             depth_irb->mt_layer, num_layers,
-                                             false, clear_value);
-      assert(new_clear);
+   if (!intel_miptree_set_depth_clear_value(brw, mt, depth_irb->mt_level,
+                                            depth_irb->mt_layer, num_layers,
+                                            false, clear_value)) {
+      return false;
    }
 
    bool need_clear = false;
-- 
2.16.2

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to