dzn: Check image view usage instead of image usage when creating an image view
authorBoris Brezillon <boris.brezillon@collabora.com>
Mon, 4 Apr 2022 11:21:46 +0000 (13:21 +0200)
committerMarge Bot <emma+marge@anholt.net>
Fri, 8 Apr 2022 11:54:43 +0000 (11:54 +0000)
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>

src/microsoft/vulkan/dzn_image.cpp

index 1d8a30e..79650b0 100644 (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);
 }