radv: check allowed fast HTILE clears a bit earlier
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 12 Nov 2018 16:57:10 +0000 (17:57 +0100)
committerSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 19 Nov 2018 15:32:14 +0000 (16:32 +0100)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_meta_clear.c

index b9ae66695c2a19ba8434886d7bcd0dd65f8da0e1..4d8a6a9160293aeab0fb6a7362ce543059aa2c23 100644 (file)
@@ -821,6 +821,11 @@ emit_fast_htile_clear(struct radv_cmd_buffer *cmd_buffer,
        if (clear_rect->layerCount != iview->image->info.array_size)
                return false;
 
+       if (!(aspects & VK_IMAGE_ASPECT_DEPTH_BIT) ||
+           ((vk_format_aspects(iview->image->vk_format) & VK_IMAGE_ASPECT_STENCIL_BIT) &&
+            !(aspects & VK_IMAGE_ASPECT_STENCIL_BIT)))
+               return false;
+
        if (!radv_is_fast_clear_depth_allowed(clear_value) ||
            !(aspects & VK_IMAGE_ASPECT_DEPTH_BIT))
                return false;