If an enabled layer or extension is not available at instance creation, vkCreateInstance
returns VK_ERROR_EXTENSION_NOT_PRESENT
or VK_ERROR_LAYER_NOT_PRESENT
. I would like to identify which layer or extension is not supported, to provide better error messages. vkEnumerateInstanceExtensionProperties
and vkEnumerateInstanceLayerProperties
seem perfect for the job.
However, according to the specification, the list of available extensions and layers may change at any time. My current understanding is that this list can be changed from outside the Vulkan implementation, not by the implementation itself.
Is this correct? How can the list of available layers and extensions change, specifically? Is it likely to happen? Can I actually rely on vkEnumerateInstanceExtensionProperties
and vkEnumerateInstanceLayerProperties
to provide useful output?
Thanks in advance!
Because the list of available layers may change externally between calls to vkEnumerateInstanceExtensionProperties, two calls may retrieve different results if a pLayerName is available in one call but not in another. The extensions supported by a layer may also change between two calls, e.g. if the layer implementation is replaced by a different version between those calls.
vkEnumerateInstanceExtensionProperties Manual Page
The list of available layers may change at any time due to actions outside of the Vulkan implementation, so two calls to vkEnumerateInstanceLayerProperties with the same parameters may return different results, or retrieve different pPropertyCount values or pProperties contents. Once an instance has been created, the layers enabled for that instance will continue to be enabled and valid for the lifetime of that instance, even if some of them become unavailable for future instances.