-
Notifications
You must be signed in to change notification settings - Fork 410
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_layer_settings behaviour seems inconsistent across platforms #8760
Comments
Hi !
Are you refering to this documentation I think a lot of these questions will be clarified by readying the Vulkan Layers configuration documentation here: |
This is something I can add, we have this issue where without the settings, I don't know if you want errors reported to a file, to your callback, etc... basically we can't do "normal validation" before we get the settings I have special flow for "things that need validation before validation starts" and get a PR up to add this one Edit: So this is an |
Thank you @christophe-lunarg for you answer. I had already read the doc you are referring to so my question is a bit deeper. The context here is that I wish to do everything under program control, without use of environment variables or vkconfig. The two issues I am seeing are as follows:
However, on Windows and Linux, no layer is enabled prior to instance creation if there are no env variables set and vkconfig is not running. This causes a Catch-22 situation: On Windows and Linux it seems that you cannot enumerate
As an aside, I have noticed that if you can enumerate |
Thanks @spencer-lunarg.
Before taking any action here, I would like to first hear back from @christophe-lunarg regarding how to properly detect support for |
This is due to the fact that the MoltenVK driver advertises support for it directly. If you query the instance extensions supported by VK_LAYER_KHRONOS_validation directly, you'll find that it supports VK_EXT_layer_settings. Alternatively, look at the output of vulkaninfo - the layer settings extension appears in the supported instance extension list of various layers. Running it on my local system, I see it directly in the validation layer as well as others layers. The reason for the extension list from FYI - this is not a unique problem to VK_EXT_layer_settings. VK_EXT_debug_utils has the same behavior on android. On desktop, debug_utils is supported by the loader as well as layers, so its always available. But on android neither the driver nor loader support it, so it appears unavailable. When the validation layer is available, the application can query the extensions it supports, which includes debug_utils.
No, MoltenVK is a driver. It is not considered a layer by the Vulkan-Loader. |
To answer a different question - the reason vkconfig makes VK_EXT_layer_settings appear as 'available' is because of the way vkconfig makes VK_LAYER_KHRONOS_validation be force-enabled. The mechanism vkconfig uses is to create an "override" implicit layer that tells the loader to enable the validation layer. But because the override needs to be implicit in order to be active by default, the validation layer inherits that 'implicit' layer nature and so adds the extension to the instance layer list. Or that is my going theory. It might be a different mechanism but I am fairly confident that is the reason why. |
@SRSaunders (sorry to create a new thread)
This part is what I am want to understand, I am not sure who is returning this, can you make a branch of Vulkan Samples where I could reproduce this behavior? |
@charles-lunarg thank you very much for these explanations - it helps me a lot. The details around vkconfig's inner workings seem a little more sophisticated, but ultimately I don't need to know this to achieve what I am looking for. I will follow your advice and query |
@spencer-lunarg you can use the branch for my currently open PR KhronosGroup/Vulkan-Samples#1187. To reproduce the problem do the following:
I am not sure how important it is to fix this for my purposes. I plan to not include the |
I believe everything what answered by @charles-lunarg and @spencer-lunarg. Detecting the availability of |
@christophe-lunarg I have two final questions:
|
|
I just got the new VUs added in https://gitlab.khronos.org/vulkan/vulkan/-/merge_requests/6979 (will be in 1.3.301 header under This is for formality, in reality, I would be surprised if a layer would go "they didn't use the extension, we are going to ignore their |
Yes, all the layers I implemented |
Let me raise an internal Working Group issue on this... I agree it is VERY confusing to not realize which extensions are layer vs driver ... you are not the first person to hit this 😆 |
I would like to add a note to the spec indicating that "layer supported extensions can be queried by calling vkEnumerateInstanceExtensions with the name of the layer as the first parameter" so that the solution to the problem in this issue has a little more visibility. |
Thanks to all for your extensive explanations and background. I have modified my PR in Vulkan-Samples to take into account the information here. And it would be great if you could add the doc items mentioned above. If you wish, I can leave this issue open until you close on the doc enhancements. Thanks again. |
Environment:
Describe the Issue
I would like to report on the seemingly different behaviours of the
VK_EXT_layer_settings
extension across platforms. For instance, on Windows and Linux it seems this extension is not advertized during enumeration unless vkconfig is running. And in addition, if you try to enable it on Windows (even with vkconfig running), it will bail out with an extension not found error duringvkCreateInstance()
- which seems unexpected to me. This is in contrast to what happens on macOS where the extension is available at all times (not just when vkconfig is running), and can be enabled during instance creation without bailing out.Interestingly, if the
VK_EXT_layer_settings
extension is visible during enumeration (for any platform), it seems you can still use theVkLayerSettingsCreateInfoEXT
structure even if you don't enable theVK_EXT_layer_settings
extension duringvkCreateInstance()
. This appears to be a bit unconventional, but perhaps is the intended functionality. I don't know.Expected behavior
If implemented in the SDK version, I would expect
VK_EXT_layer_settings
to be visible during enumeration at all times (independent of whether vkconfig is running or not). This should be consistent across all OS and GPU platform combinations.In addition, if the extension is visible during enumeration, I would expect to be able to include it in the enabled extensions list during instance creation, i.e.
vkCreateInstance()
, without causingERROR_EXTENSION_NOT_PRESENT
errors.I thought that
VK_EXT_layer_settings
was meant to allow setting of layer features under program control during instance creation, and its visibility should not depend on whether vkconfig is running or not. In addition, I believe the docs indicate that if the requested layer setting does not match any known setting, it should be ignored and not generate an error.Valid Usage ID
Additional context
See issue KhronosGroup/Vulkan-Samples#1187 for background information.
The text was updated successfully, but these errors were encountered: