Change (most of) the samples to use the DispatchLoaderDynamic by default. (#392)

This commit is contained in:
Andreas Süßenbach
2019-09-26 09:55:15 +02:00
committed by Markus Tavenrath
parent 5ceb4d2801
commit becef43315
14 changed files with 127 additions and 84 deletions

View File

@@ -41,6 +41,13 @@ int main(int /*argc*/, char ** /*argv*/)
desiredVersionString += ".";
desiredVersionString += std::to_string(desiredMinorVersion);
#if (VULKAN_HPP_DISPATCH_LOADER_DYNAMIC == 1)
// initialize the DipatchLoaderDynamic to use
static vk::DynamicLoader dl;
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = dl.getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr);
#endif
// Determine what API version is available
uint32_t apiVersion = vk::enumerateInstanceVersion();