radv: do not allow sparse resources with multi-planar formats
authorSamuel Pitoiset <samuel.pitoiset@gmail.com>
Mon, 27 Jan 2020 14:17:25 +0000 (15:17 +0100)
committerMarge Bot <eric+marge@anholt.net>
Mon, 27 Jan 2020 15:47:49 +0000 (15:47 +0000)
It's unsupported.

Fixes some fails or hangs with
dEQP-VK.sparse_resources.image_sparse_binding.*

Cc: 19.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3581>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3581>

src/amd/vulkan/radv_formats.c

index b5d1fa31ba7c8e83c95dd402280c7eaa73e2fc10..67a9cb7bfe0ba26b837d9ab5dde969e7f7b52fcb 100644 (file)
@@ -1248,6 +1248,12 @@ static VkResult radv_get_image_format_properties(struct radv_physical_device *ph
                }
        }
 
+       /* Sparse resources with multi-planar formats are unsupported. */
+       if (info->flags & VK_IMAGE_CREATE_SPARSE_BINDING_BIT) {
+               if (desc->plane_count > 1)
+                       goto unsupported;
+       }
+
        *pImageFormatProperties = (VkImageFormatProperties) {
                .maxExtent = maxExtent,
                .maxMipLevels = maxMipLevels,