zink: check image format props before creating image

ensure that these attrs are viable before failing silently later on

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9788>
This commit is contained in:
Mike Blumenkrantz 2021-02-03 15:34:58 -05:00
parent 7edc3f50c1
commit aac88f49e5

View File

@ -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,