radv: Fix assert that is too strict.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Fri, 7 Aug 2020 18:29:07 +0000 (20:29 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 10 Aug 2020 09:34:49 +0000 (09:34 +0000)
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 <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6232>

src/amd/vulkan/radv_image.c

index 343a5d85a88d24a26e77e5fb6d399c891a2066de..fc0fb81175e50a19a8faf78bb4de973ecde47375 100644 (file)
@@ -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);