VK_IMAGE_CREATE_EXTENDED_USAGE_BIT not accounted for in vkGetPhysicalDeviceImageFormatProperties
VK_IMAGE_CREATE_EXTENDED_USAGE_BIT allows for usage that is not supported by the format as long as later we have an image view with a format that allows for that usage. From what I found, there's no consideration to this flag for vkGetPhysicalDeviceImageFormatProperties
when we want to check if the combination of format, tiling, type, usage and flags is valid.
We can see that due to how the usage is tested, there's no consideration to the mentioned flag: https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/amd/vulkan/radv_formats.c#L1566
This case can be triggered by having a compressed format with storage usage among other ones VK_IMAGE_USAGE_STORAGE_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT | VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_SAMPLED_BIT
, and creation flags that allow for this VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT | VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
.
The following Vulkan CTS tests should trigger what I'm trying to explain:
- dEQP-VK.image.sample_texture.64_bit_compressed_format_two_samplers
- dEQP-VK.image.sample_texture.128_bit_compressed_format
- dEQP-VK.image.sample_texture.128_bit_compressed_format_two_samplers
There's a fix ongoing for these tests to check the support of this. After those are in, the test is not run due to know having the support for the mentioned usage/creation flags combination (https://gitlab.khronos.org/Tracker/vk-gl-cts/-/issues/3225).
Let me know if there are any questions, and thank you in advance.