KhronosGroup / KhronosGroup/Vulkan-Guide
Unclear when non-core formats are allowed to be used
- Dominant language
- Makefile
- Stars
- 2.3k
- Forks
- 196
- PR merge metrics
- No merged PRs in 30d
Description
`VkPhysicalDeviceFeatures` has the `textureCompressionBC`, `textureCompressionETC2`, and `textureCompressionASTC_LDR` feature flags, giving us information about the relevant formats and whether they are supported with optimal tiling. There's also many more extensions and Vulkan versions providing new formats.
Yet `vkGetPhysicalDeviceImageFormatProperties` is a physical device function, which means that it cannot know which extensions or which features we have enabled. And we seem to also be able to freely use *any* format that is reported as supported by the aforementioned function, even if the corresponding extension is not enabled. The spec also doesn't have any VUID which says anything about format extensions or format features to be enabled. The docs for `vkGetPhysicalDeviceImageFormatProperties` reports:
> To query for additional properties, or if the feature is not enabled, vkGetPhysicalDeviceFormatProperties and vkGetPhysicalDeviceImageFormatProperties can be used to check for supported properties of individual formats as normal.
So, based on "**or if the feature is not enabled**", are the features just to quickly guarantee many formats to be usable in specific use-cases?
Reading through `VkPhysicalDevice4444FormatsFeaturesEXT`:
> VkPhysicalDevice4444FormatsFeaturesEXT can also be used in the pNext chain of [VkDeviceCreateInfo](https://www.khronos.org/registry/vulkan/specs/1.3-extensions/man/html/VkDeviceCreateInfo.html) to selectively enable these features.
How else would they be enabled? Does this mean enabling format features is entirely optional?
Now, `VkDeviceCreateInfo` requires us to provide a `VkPhysicalDeviceFeatures` struct with all features we want to have enabled. So, what effect does enabling `textureCompressionBC`, `textureCompressionETC2`, or `textureCompressionASTC_LDR` have? What's the point of enabling e.g. `VK_IMG_format_pvrtc` if we can just query the format properties anyway to determine if we can use it? Are these just meta-extensions? Does the device even have to report VK_IMG_format_pvrtc` if the extensions are supported? Finally, why does this not follow the common extension/feature paradigm where we need to keep track of which features/extensions are available and were enabled, and determine our Vulkan usage based on that?
Contributor guide
Assessment
This issue has not been assessed yet.