From ff4f6202be26d1ffe1dfd306e6a586ea380367bc Mon Sep 17 00:00:00 2001 From: Bas Nieuwenhuizen Date: Fri, 7 Aug 2020 20:29:07 +0200 Subject: [PATCH] radv: Fix assert that is too strict. The added assert fails on MSAA images if we disable FMASK .... Reordered things. Fixes: c6aadbae715 "radv: Don't use both DCC and CMASK for single sample images." Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3385 Reviewed-by: Samuel Pitoiset Part-of: --- src/amd/vulkan/radv_image.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c index 343a5d85a88..fc0fb81175e 100644 --- a/src/amd/vulkan/radv_image.c +++ b/src/amd/vulkan/radv_image.c @@ -1233,13 +1233,13 @@ static void radv_image_alloc_single_sample_cmask(const struct radv_image *image, struct radeon_surf *surf) { - assert(image->info.storage_samples == 1 || surf->cmask_offset); - if (!surf->cmask_size || surf->cmask_offset || surf->bpe > 8 || image->info.levels > 1 || image->info.depth > 1 || radv_image_has_dcc(image) || !radv_image_use_fast_clear_for_image(image)) return; + assert(image->info.storage_samples == 1); + surf->cmask_offset = align64(surf->total_size, surf->cmask_alignment); surf->total_size = surf->cmask_offset + surf->cmask_size; surf->alignment = MAX2(surf->alignment, surf->cmask_alignment); -- 2.30.2