Mesa (master): radv: Disable usage checks in metadata for images with extended usage data.

Bas Nieuwenhuizen bnieuwenhuizen at kemper.freedesktop.org
Thu Oct 5 23:42:34 UTC 2017


Module: Mesa
Branch: master
Commit: ca2163463239ad121a68e603105c10739815967f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=ca2163463239ad121a68e603105c10739815967f

Author: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Date:   Fri Oct  6 00:55:57 2017 +0200

radv: Disable usage checks in metadata for images with extended usage data.

The app can extend the usage, so knowing that the usage is limitied
does not help us here.

Reviewed-by: Dave Airlie <airlied at redhat.com>

---

 src/amd/vulkan/radv_image.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_image.c b/src/amd/vulkan/radv_image.c
index c017bf8955..f0645279aa 100644
--- a/src/amd/vulkan/radv_image.c
+++ b/src/amd/vulkan/radv_image.c
@@ -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 ||




More information about the mesa-commit mailing list