-
Notifications
You must be signed in to change notification settings - Fork 452
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
Layer violates LLP_LAYER_16 #2033
Comments
@MarkY-LunarG & @charles-lunarg any recommendations on how to proceed with this? The relevant code is here. |
If most layers are doing that, then most layers are written incorrectly. The Vulkan spec states for vkEnumerateDeviceExtensionProperties:
|
The layers probably do it this way so that the implemented extensions appear as if the driver supports them directly, which makes initialization and extension discovery a bit easier on the user's side. I think that is generally a good idea, so maybe there should be a way to do this in accordance with the spec. |
Upon further review, I actually think the specification is wrong here. The way it was written assumes that layers which aren't implicitly enabled do not provide any extensions. Except in other parts of the spec, it claims that implicit layers only differ in them 'being enabled through mechanisms outside of the API'. The functionality of layers is the same for both types, so calling out that explicit layers can't add extensions is inconsistent.
Yes, this has the carve out that allows Layers such as FYI - Layers don't 'know' they are implicit or explicit. Sure, the author of a layer may code the layer in such a manner, but there are almost no differences in the layer code between an implicit layer and explicit layer. |
Thanks @charles-lunarg, should this be converted to a Loader or something-else issue? |
Vulkan-Docs, because the spec should be clarified to not exclude explicit layers. |
Oh and yes, should have a corresponding Vulkan Loader issue since LLP_LAYER_16 is a loader concept. |
So what would the "correct" behavior for a layer be now? If a layer wants to implement support for an extension, should it modify the extensions returned by vkEnumerateDeviceExtensionProperties or should it conform to the LLP_LAYER_16 requirement, waiting for the loader code to be corrected? |
Another area where this mechanism seems unwanted is VK_EXT_tooling_info, only gives information about the enabled tools if either the driver directly supports it or at least one implicit layer supports it. |
This doesn't seem correct to me. My expectation is that explicit layers can add extensions, and I don't think we intended to prohibit that. The whole purpose of being able to call |
Are we leaning towards saying this is allowed for implicit layers? In a nut-shell:
|
This is currently automatically handled by the loader correctly, it automatically calls vkEnumerateDeviceExtensionProperties with pLayerName==someLayer for implicit layers and adds the returned extensions to the final list of device extensions. It doesn't do this for explicit layers, meaning the function behaves exactly as intended by the spec then. This means, when following LLP_LAYER_16, everything works as specified in the spec. The problem I see is that the official layers do not conform to the loader requirement and manually add their extensions, breaking the specified functionality of vkEnumerateDeviceExtensionProperties. |
That's not quite what I was describing. My opinion is:
The result of this is that layers only need to handle the case where layerName == myName, and will then work in both the implicit and explicit case. In my opinion, if Khronos layers aren't doing that, then they are incorrectly written. I'm not quite following the issue with |
This makes the usage of such "general information" extensions very cumbersome imo. When using this extension, an application will mostly not care which layer implements it, as the return value of vkGetPhysicalDeviceToolPropertiesEXT is a list of ALL layers/tools that are enabled. |
Okay. That's fair. Hopefully the fact we made it core in 1.3 helps a little there, but it obviously doesn't solve the issue on all platforms today. |
That definitely helps a lot 👍 |
Thanks for the clarification @Rob2309 |
Ah, actually, the loader gets this info from the JSON, I honestly didn't remember since I've been out of digging into this side of stuff with the loader for a few years now. Basically, if the layer defines extensions in the appropriate section of the JSON, it gets added by the loader. [BTW, @charles-lunarg found it]. |
I am currently trying to understand the Interface between the Loader and a Layer. I found out about LLP_LAYER_16, which states that vkEnumerateDeviceExtensionProperties must only return its own extensions when pLayerName is specifying the current layer. It seems to me like almost all Khronos layers violate this requirement by appending their extensions to the list of extensions supported by the driver.
Am I understanding something completely wrong?
As an example, the synchronization2 layer does this, probably to mask the fact that the synchronization2 extension is implemented in a layer, but is this allowed by the spec?
I am asking this here instead of in the Loader repo because it is not directly an issue with the loader.
The text was updated successfully, but these errors were encountered: