From aac88f49e5f2831a4abc8a90e92fc6321ba4d430 Mon Sep 17 00:00:00 2001 From: Mike Blumenkrantz Date: Wed, 3 Feb 2021 15:34:58 -0500 Subject: [PATCH] zink: check image format props before creating image ensure that these attrs are viable before failing silently later on Reviewed-by: Dave Airlie Part-of: --- src/gallium/drivers/zink/zink_resource.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/gallium/drivers/zink/zink_resource.c b/src/gallium/drivers/zink/zink_resource.c index 0b1bcde4976..b49e6c3a609 100644 --- a/src/gallium/drivers/zink/zink_resource.c +++ b/src/gallium/drivers/zink/zink_resource.c @@ -374,6 +374,13 @@ resource_object_create(struct zink_screen *screen, const struct pipe_resource *t if (optimal_tiling) *optimal_tiling = ici.tiling != VK_IMAGE_TILING_LINEAR; + VkImageFormatProperties image_props; + if (vkGetPhysicalDeviceImageFormatProperties(screen->pdev, ici.format, ici.imageType, + ici.tiling, ici.usage, ici.flags, &image_props) != VK_SUCCESS) { + FREE(obj); + return NULL; + } + struct wsi_image_create_info image_wsi_info = { VK_STRUCTURE_TYPE_WSI_IMAGE_CREATE_INFO_MESA, NULL,