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

Allow setting a load order for implicit layers #328

Open
DadSchoorse opened this issue Feb 14, 2020 · 5 comments
Open

Allow setting a load order for implicit layers #328

DadSchoorse opened this issue Feb 14, 2020 · 5 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@DadSchoorse
Copy link
Contributor

DadSchoorse commented Feb 14, 2020

For explicit layers it's easy to manage the order with the VK_INSTANCE_LAYERS env var but currently there is no way to specify which implicit layer should be loaded first.
Such a way would be useful for making sure that post processing layers like reshade or vkBasalt get applied before the steam overlay / other overlay layers.
As for how to achieve this, my proposal would be a signed integer value in the manifest file to specify the load priority for each layer.

@DadSchoorse DadSchoorse changed the title Allow setting a load order for explicit layers Allow setting a load order for implicit layers Feb 14, 2020
@lenny-lunarg lenny-lunarg added the enhancement New feature or request label Apr 2, 2020
@lenny-lunarg lenny-lunarg added this to the P2 milestone Apr 2, 2020
@samwalls-arm
Copy link

Hey, just out of curiosity @lenny-lunarg is there any expected timeline for the P2 milestone contents (this feature in particular) to reach the SDK?

@MarkY-LunarG
Copy link
Collaborator

This is something we're looking at starting in about a month or two. We have already started designing it, but are going through internal discussions on making it as clean and easy to use as possible. I hope to have a status for you in about a month. Sorry it's taking so long.

@MarkY-LunarG MarkY-LunarG self-assigned this Sep 9, 2021
@samwalls-arm
Copy link

Hi @MarkY-LunarG, no worries at all. Just wondering what the plans are 👍

@mfncharm
Copy link

mfncharm commented Mar 2, 2022

It seems to me that implicit layer ordering is indeed an area that deserves to be improved. In terms of actual implementation, I am not sure using an integer to capture load priority is a good approach. Who would choose the integers? The system integrator or the layers' developers? Also the chosen integer value would have no meaning by itself. It would only acquire meaning when compared with the integers assigned by all other layers. So assigning these integers requires some coordination. Said that, I think this problem could be solved by providing some guidelines. Or maybe a few priority labels (e.g. LOADED_FIRST, LOADED_LAST, ...) could be used instead of plain integers.

I wonder whether having layers declaring dependencies and/or intent would work. A layer could list other layers (or Vulkan extensions) as its dependencies. Or maybe it could declare the intent of implementing an extension VS adding overlays VS tracing, etc. The loader could use this information to figure out the order. This is just an idea, I think going down this route definitely requires a bit more thought. For example, for instrumentation/validation layers it is not unconceivable wanting to change the order with respect to other layers rather than having it determined in the manifest files.

@MarkY-LunarG
Copy link
Collaborator

First, sorry, this actually got dropped in priority as we were working on other items.

Who would choose the integers? The system integrator or the layers' developers?

The layer developers, they have the most knowledge on where their layer would be most useful in general. for example, layers implementing driver type features (like synchronization 2) should be closer to the driver, but layers doing overlay style features should be closer to the application.

Also the chosen integer value would have no meaning by itself... Or maybe a few priority labels (e.g. LOADED_FIRST, LOADED_LAST, ...) could be used instead of plain integers.

The concern about the few lables is you still have the issue of conflicts. Just look at the number of layers that have been encountered at GPUInfo.org. Unless we have something along the lines of more labels:

  • NEAREST_TO_APP
  • CLOSE_TO_APP
  • MIDDLE_BUT_CLOSE_TO_APP
  • MIDDLE
  • MIDDLE_BUT_CLOSE_TO_DRIVER
  • CLOSE_TO_DRIVER
  • NEAREST_TO_DRIVER

I wonder whether having layers declaring dependencies and/or intent would work. A layer could list other layers (or Vulkan extensions) as its dependencies

Sounds like we would end up with a lot of circular dependencies that would be hard to work through. However, we were thinking that at least VkConfig could override layer ordering. Always possible we could investigate other options in the future as well.

Unfortunately, due to shifting priorities this is taking longer than I originally hoped.

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

No branches or pull requests

5 participants