radv: do not use gfx fast depth clears for layered depth/stencil images
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 3 Jun 2019 15:52:56 +0000 (17:52 +0200)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Tue, 4 Jun 2019 06:55:32 +0000 (08:55 +0200)
The driver should only fast depth clears with the graphics path
when the view covers all image layers, otherwise this might
corrupt layers when HTILE is enabled.

Cc: 19.0 19.1 mesa-stable@lists.freedesktop.org
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_meta_clear.c

index 313e80d5cb76dc2815d4dd6a27d5ac8662ac94c2..44aaf92f53db8a612e995fbf4fc49db82d8da7e3 100644 (file)
@@ -650,6 +650,7 @@ static bool depth_view_can_fast_clear(struct radv_cmd_buffer *cmd_buffer,
        if (radv_image_has_htile(iview->image) &&
            iview->base_mip == 0 &&
            iview->base_layer == 0 &&
+           iview->layer_count == iview->image->info.array_size &&
            radv_layout_is_htile_compressed(iview->image, layout, queue_mask) &&
            radv_image_extent_compare(iview->image, &iview->extent))
                return true;