Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vkGetPhysicalDeviceImageFormatProperties does not take into account VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT #178

Closed
Macdu opened this issue Sep 21, 2024 · 1 comment

Comments

@Macdu
Copy link

Macdu commented Sep 21, 2024

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.

@jinjianrong
Copy link
Member

Fixed with 2024.Q4.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants