`vkGetPhysicalDeviceImageFormatProperties` does not take into account `VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT`
Closed this issue · 1 comments
The following code with AMDVLK
:
VkImageFormatProperties properties;
vkGetPhysicalDeviceImageFormatProperties(
physical_device,
VK_FORMAT_BC1_RGBA_UNORM_BLOCK,
VK_IMAGE_TYPE_2D,
VK_IMAGE_TILING_OPTIMAL,
VK_IMAGE_USAGE_STORAGE_BIT,
VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT | VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT,
&properties
)
returns VK_ERROR_FORMAT_NOT_SUPPORTED
.
This is because VK_IMAGE_USAGE_STORAGE_BIT
is not available on VK_FORMAT_BC1_RGBA_UNORM_BLOCK
. However, VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT | VK_IMAGE_CREATE_EXTENDED_USAGE_BIT
specifies we can use the flag of any format from an image view that can be created from this image. And VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
specifies we can create a compressed view of the image, for example with VK_FORMAT_R32G32_UINT
which has the VK_IMAGE_USAGE_STORAGE_BIT
, so this usage flag is valid and this function call shouldn't return an error.
However, when the image format is compressed, xgl always set noCompatibleExtendedUsage to false while it only should when VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT
is not set.
Note that outside of this error when getting the format properties, creating an image with these flags and using a view of the compressed image as a storage image works perfectly fine with AMDVLK, it is just the vkGetPhysicalDeviceImageFormatProperties
callwhich return that the format flags are not supported when they actually are.
Fixed with 2024.Q4.1