radv: Don't relayout images with modifiers.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 16 Nov 2020 11:01:54 +0000 (12:01 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 2 Feb 2021 00:43:56 +0000 (00:43 +0000)
The modifier should have been the exact layout of the image. Hence
we should not relayout the image according to the implicit modifier
on memory import (i.e. VkMemory allocation).

Reviewed-By: Chad Versace <chad@kiwitree.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7667>

src/amd/vulkan/radv_device.c

index 11c9c82..a7b2cdb 100644 (file)
@@ -5310,7 +5310,8 @@ static VkResult radv_alloc_memory(struct radv_device *device,
 
                if (mem->image && mem->image->plane_count == 1 &&
                    !vk_format_is_depth_or_stencil(mem->image->vk_format) &&
-                   mem->image->info.samples == 1) {
+                   mem->image->info.samples == 1 &&
+                   mem->image->tiling != VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) {
                        struct radeon_bo_metadata metadata;
                        device->ws->buffer_get_metadata(mem->bo, &metadata);