anv: Improve image/view usage bits verification
authorSviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Wed, 8 Feb 2023 08:50:21 +0000 (10:50 +0200)
committerMarge Bot <emma+marge@anholt.net>
Thu, 27 Apr 2023 01:04:44 +0000 (01:04 +0000)
commit697ed61e7c5701333e0dc9cdda05ae31dfac2dd2
tree9333dfd86741ccbddb8e32e0c8a63964e3487e33
parent98991513616a3d8995eb59c70d9cf22bbb0e3b2e
anv: Improve image/view usage bits verification

This change makes usage bits verification closer to the Vulkan spec.
i.e. VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT does not always require all formats
to support all the requested usage bits.
Also, VK_IMAGE_CREATE_EXTENDED_USAGE_BIT, when combined with
VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT can relax the requirements for the
usage supported by the original image format.

v2: Removed strict verification of the format_list_info formats usage
    per chadversary's suggestion. Other minor style/comments tweaks.

v3: Added checking of all compatible formats when
    VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT and VK_IMAGE_CREATE_EXTENDED_USAGE_BIT
    are specified, but no list of possible formats was given.

v4: Add VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT handling.

Cc: 22.2 <mesa-stable>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6031
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17182>
src/intel/vulkan/anv_formats.c