Vulkan-Loader icon indicating copy to clipboard operation
Vulkan-Loader copied to clipboard

add VK_LOADER_FORCE_LAYER_ORDER to allow forced layer ordering

Open zmike opened this issue 9 months ago • 2 comments

For debugging, sometimes it's useful to be able to force a certain layer to load before (closest to the application) any other layer. Currently, the only way to do this is through vkconfig, but this is cumbersome to be toggling constantly during a debug session. There should be an environment variable to enable this sort of ordering.

zmike avatar Apr 04 '25 20:04 zmike

Hi @zmike,

I am trying to understand exactly what's your feature request.

We introduce in Vulkan Configurator 3 the capability to decouple ordering layers from enabling them. My understanding of a VK_LOADER_FORCE_LAYER_ORDER would be to specify the layer ordering without necessarilly enabling (loading) them.

However, here it seems you want to load first a layer, so ordering and enabling layers at the same time. Isn't VK_LOADER_LAYERS_ENABLE enough for this? I guess not considering your request, but what's missing?

If we look at: https://github.com/KhronosGroup/Vulkan-Loader/raw/main/docs/images/loader_layer_order.png

Then it implies to list the implicit layers in VK_LOADER_LAYERS_ENABLE for them to be explicitly ordered.

And if I am totally missing something, how would you expect VK_LOADER_FORCE_LAYER_ORDER to work?

And maybe finally, what so annoying with controlling this with Vulkan Configurator compared with doing this with an environment variable? (except maybe that you generally prefer environment variable than a UI)

christophe-lunarg avatar Apr 08 '25 10:04 christophe-lunarg

I don't think VK_LOADER_LAYERS_ENABLE is sufficient for managing the order of both implicit layers and explicit layers.

The configurator tool is intended for general purpose use, but it is not suitable for use in debug sessions where layer settings may change on every application run.

zmike avatar Apr 08 '25 14:04 zmike

@zmike As discussed elsewhere, I have gone forward with the VK_INSTANCE_LAYERS approach such that putting an implicit layer in the env-var causes it to be ordered with other env-var enabled layers. So VK_INSTANCE_LAYERS=foo:bar will have the bar layer be enabled after foo, regardless of whether they are implicit or explicit.

charles-lunarg avatar Aug 08 '25 05:08 charles-lunarg

Sounds great!

zmike avatar Aug 08 '25 11:08 zmike