dzn: Check image view usage instead of image usage when creating an image view

So we take VkImageViewUsageCreateInfo extension instead of ignoring it.

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15698>
This commit is contained in:
Boris Brezillon 2022-04-04 13:21:46 +02:00 committed by Marge Bot
parent 7ecc22ccaa
commit 653c362ca6

View file

@ -1059,7 +1059,7 @@ dzn_image_view_init(dzn_device *device,
assert(range->baseMipLevel < image->vk.mip_levels);
/* View usage should be a subset of image usage */
assert(image->vk.usage & (VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
assert(iview->vk.usage & (VK_IMAGE_USAGE_TRANSFER_SRC_BIT |
VK_IMAGE_USAGE_SAMPLED_BIT |
VK_IMAGE_USAGE_STORAGE_BIT |
VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
@ -1081,13 +1081,13 @@ dzn_image_view_init(dzn_device *device,
dzn_image_view_prepare_srv_desc(iview);
if (image->vk.usage & VK_IMAGE_USAGE_STORAGE_BIT)
if (iview->vk.usage & VK_IMAGE_USAGE_STORAGE_BIT)
dzn_image_view_prepare_uav_desc(iview);
if (image->vk.usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
if (iview->vk.usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT)
dzn_image_view_prepare_rtv_desc(iview);
if (image->vk.usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)
if (iview->vk.usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)
dzn_image_view_prepare_dsv_desc(iview);
}