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.
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.