radv: Disable usage checks in metadata for images with extended usage data.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 5 Oct 2017 22:55:57 +0000 (00:55 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 5 Oct 2017 23:41:29 +0000 (01:41 +0200)
The app can extend the usage, so knowing that the usage is limitied
does not help us here.

Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_image.c

index c017bf8955382b4bc3c48577a19a166080a78769..f0645279aa10ed604c6527f2a5c3c606e2f45d45 100644 (file)
@@ -110,7 +110,8 @@ radv_init_surface(struct radv_device *device,
        if (is_depth) {
                surface->flags |= RADEON_SURF_ZBUFFER;
                if (!(pCreateInfo->usage & VK_IMAGE_USAGE_STORAGE_BIT) &&
-                   !(pCreateInfo->flags & VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT) &&
+                   !(pCreateInfo->flags & (VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT |
+                                           VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR)) &&
                    pCreateInfo->tiling != VK_IMAGE_TILING_LINEAR &&
                    pCreateInfo->mipLevels <= 1 &&
                    device->physical_device->rad_info.chip_class >= VI &&
@@ -149,6 +150,7 @@ radv_init_surface(struct radv_device *device,
 
        if ((pCreateInfo->usage & (VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
                                   VK_IMAGE_USAGE_STORAGE_BIT)) ||
+           (pCreateInfo->flags & VK_IMAGE_CREATE_EXTENDED_USAGE_BIT_KHR) ||
            !dcc_compatible_formats ||
             (pCreateInfo->tiling == VK_IMAGE_TILING_LINEAR) ||
             pCreateInfo->mipLevels > 1 || pCreateInfo->arrayLayers > 1 ||