Hi,
I'm trying to ensure that an app I'm developing for Windows and Linux loads a specific version of the validation layers shared library, which is stored alongside the app rather than at the system level.
To that end, I set VK_ADD_LAYER_PATH to point to my shared library (with SetEnvironmentVariableA on Windows and setenv on Linux) before initializing Vulkan. This works on Windows, but not on Linux, because on Linux loader_initialize is called in the loader_init_library constructor function as soon as the .so is loaded, i.e. as soon as the executable starts (in my case, the app links with vulkan dynamically). This means that on Linux, I change the environment variable after it's already been read/
What's the canonical way to go around this issue ? Should I :
- Run my program with some sort of launcher that sets the environment then runs the actual app
- Have my own ((constructor)) function, and somehow ensure that it runs before vulkan's
- Load vulkan dynamically at runtime rather than linking with it ?
If I missed a simpler way to programmatically choose which validation layer shared library is loaded, please let me know !
Hi,
I'm trying to ensure that an app I'm developing for Windows and Linux loads a specific version of the validation layers shared library, which is stored alongside the app rather than at the system level.
To that end, I set VK_ADD_LAYER_PATH to point to my shared library (with
SetEnvironmentVariableAon Windows andsetenvon Linux) before initializing Vulkan. This works on Windows, but not on Linux, because on Linuxloader_initializeis called in theloader_init_libraryconstructor function as soon as the .so is loaded, i.e. as soon as the executable starts (in my case, the app links with vulkan dynamically). This means that on Linux, I change the environment variable after it's already been read/What's the canonical way to go around this issue ? Should I :
If I missed a simpler way to programmatically choose which validation layer shared library is loaded, please let me know !