Enumerating available instance extensions
The same process of filtering requested layers against available ones should be repeated for instance extensions.
In this recipe, you will learn how to obtain available instance extensions, how to store them as strings, and how to convert them to pointers to characters so that they can be passed to the Vulkan API.
Getting ready
The process is very similar to the one described in the previous recipe, which also includes a utility function to perform an intersection of the available layers and the requested ones.
How to do it…
Obtaining a list of extensions is as easy as obtaining the available layers.
- First, call
vkEnumerateInstanceExtensionProperties
twice, once to determine how many extensions are available and then one more time to fetch the extensions:uint32_t extensionsCount{0}; vkEnumerateInstanceExtensionProperties( nullptr, &extensionsCount, nullptr); std::vector<VkExtensionProperties...