-
Notifications
You must be signed in to change notification settings - Fork 456
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
VK_EXT_swapchain_colorspace and new constants #442
Comments
Of course not. What gave you the idea?
Obviously (that's how it worked for the past year BTW). Or the implementation can choose not to support presenting at all. The spec should perhaps say that the |
Nothing in the specs mentions that the extension must be enabled for the new constants to be returned. Suppose you're writing a Vulkan implementation that presents directly to a monitor, and you're a bit careless, it's easy to not check for the extension's status and simply return the color space of the monitor. That's why I'm opening the issue. Right now you're supposed to deduce the way it works from various places of the specs, instead of reading clear instructions. |
Yeah, I suppose the sentence is missing "enumerants". |
The other problem is that if you look at this, it's not obvious that all of the constants but one are part of an extension: https://www.khronos.org/registry/vulkan/specs/1.0-extensions/html/vkspec.html#VkSurfaceFormatKHR |
Technically both are part of an extension. One tell is the suffix. Second tell is the offset of the values. Sure, it would be pretty if the source extension name would be there (maybe as a C comment before each first enumerant of each extension). (EDIT: made that suggestion now as #444) On that note I think sometimes the spec normal text is worse and should contain "If X extension enabled" more. |
FYI - When the spec is made "with all registered Vulkan extensions", it documents the behavior as if all extensions have been enabled. So, other than the extension listed in the extensions chapter, extension language is integrated into the spec and may not be explicitly called out. As @krOoze mentioned, you can tell they come from an extension by the enumerate suffix. |
I've logged an issue on the internal Khronos bug tracker regarding the question of what should an implementation do with extension enums when the extension is not enabled. The app side is clear and the validation layers will complain about use without enable. But it's not as clear if having extension attributes be returned to an application when the corresponding extension is not enabled. |
We have an internal resolution that queries may return enums and bitfields from extensions that were not explicitly enabled by the app, and some changes to that effect in the 1.0.44 release, but leaving this assigned to @courtney-g to finish closing out the topic here. |
This should be fixed in the 1.0.46 spec update. |
@oddhack That's quite surprising and unorthodox resolution. So I have some Qs about its effect:
|
We spent quite a bit of time debating this topic. Basically it makes queries simpler for the driver. Vulkan is all about keeping the driver as lean as possible. So yes, it is true. Likely to see it affect vkGetPhysicalDeviceSurfaceFormatsKHR as it simplifies that driver code to return all supported formats.
No. You cannot use the enums without enabling the associated extension. That will cause a validation failure. We still want use by the application be explicit. For example, vkGetPhysicalDeviceSurfaceFormatsKHR can return a VkSurfaceFormatKHR with a colorSpace of VK_COLOR_SPACE_DISPLAY_P3_NONLINEAR_EXT.
No. Enums from extensions that are not enabled cannot be used (passed as input values to Vulkan calls) by the application.
I don't understand this question. An application may see enums / flags it does not recognize and must ignore those flags. One of the motivations for this behavior is what happens with applications written to Vulkan 1.0 when they are running on 1.1? Requiring applications to ignore enums / flags they do not recognize makes that situation easier to manage.
For vkGetPhysicalDeviceSurfaceFormatsKHR, I believe VK_COLOR_SPACE_SRGB_NONLINEAR_KHR is a required color space. I believe there are required elements that must always be present. Have to look a bit more closely.
I don't think so, though may require clarification. |
@courtney-g thanks for the answers!
Alright then. Anyway, AIS could use to be more clear. The added Note seems to try to do that but IMO fails. What is also not clear is to what degree this property is transitive (i.e. if or when it makes any structure housing that enum value also to be ignored as a whole.)
Good. I don't see that reflected in the spec though.
I was refering to the wording in the newly added Note (that I criticized in 1. as a whole, so I was probably just extrapolating too much from its unfortunate wording). So probably irrelevant, but anyway I was refering specifically to this: "[...]cases such as 'hidden' extensions known only to driver internals, or layers enabling extensions without knowledge of the application[...]"
It would not help, because I could be forced to discard the guaranteed one format-colorspace pair because of the format enum too even if
Being highly self-referential and circular, I don't know what it means, Though it further discusses something that has to be in the array conditionally.
Possibly |
Well - I get no such validation error for using the enums returned from vkGetPhysicalDeviceSurfaceFormats2KHR , when I have not explicitly enabled the instance extension VK_EXT_swapchain_colorspace. Vulkan SDK 1.2.154.1 Was this extension internally promoted to no longer be an extension ? Is it built-in now so to speak that explicitly enabling the extension is no longer required to use these colorspace enumerations? Currently on the "Vulkan Hardware Capability Database" this extension has vendor gpu support of 7.7% vs no support at 92.3% What is going on here? Is this extension deprecated? I'm not sure if enabling this extension is required for HDR/WideGamut Colorspaces. These formats are important for implementations supporting true hdr monitors. |
Apologies for resurrecting an old discussion...but this is a murky area for implementation requirements. I read the above discussion to at best indicate that implementations are allowed to return enumerants from extensions that are not enabled, but I don't read it as requiring the implementation to do so. Is that a correct assumption? Or are implementations expected or required to return all supported enumerants from associated queries, regardless of which extensions are enabled? EDIT: Based on other feedback, and the general consensus of other implementations, we've modified MoltenVK to return the full set of color spaces, regardless of whether the extension is enabled or not. |
The
VK_EXT_swapchain_colorspace
extension added new constants in theVkColorSpaceKHR
enum.If you don't enable this extension, can
vkGetPhysicalDeviceSurfaceFormatsKHR
return any of these new constants?VK_COLOR_SPACE_SRGB_NONLINEAR_KHR
(as they have no other choice but to return this value)? If so I think it should be written explicitly in the specs.The text was updated successfully, but these errors were encountered: