KhronosGroup / Vulkan-Loader

Vulkan Loader
https://vulkan.lunarg.com/doc/sdk/latest/linux/LoaderInterfaceArchitecture.html
Other
519 stars 284 forks source link

Fix layers with pre-inst funcs from being loaded erroneously #1602

Closed charles-lunarg closed 1 week ago

charles-lunarg commented 1 week ago

The loader_scan_for_implicit_layers function was not removing inactive layers from the list of layers gotten from the loader settings file. This caused layers with pre-instance functions to loaded and executed. For example, layers with an enable-environment field shouldn't be loaded unless their respective env-var was set. This lack of filtering didn't change the list of layers active during vkCreateInstance, but does cause adverse side effects during pre-instance API function calls.

Also: Reuse library loading code in pre-instance functions

The functions vkEnumerateInstanceExtensionProperties, vkEnumerateInstanceVersion, and vkEnumerateInstanceLayerProperties have no strong reason for duplicating the the logic to load and unload libraries. This commit re-uses existing facilities to handle library loading, which has the side benefit of adding logging to the loading and unloading of layer libraries.

ci-tester-lunarg commented 1 week ago

CI Vulkan-Loader build queued with queue ID 303721.

ci-tester-lunarg commented 1 week ago

CI Vulkan-Loader build # 2783 running.

ci-tester-lunarg commented 1 week ago

CI Vulkan-Loader build # 2783 passed.