tools/hello: cache the vkCreateDebugReportCallbackEXT lookup

This commit is contained in:
Danny Robson 2019-03-13 14:50:23 +11:00
parent 5d2c872596
commit 345b428069

View File

@ -299,12 +299,16 @@ VkResult _vkCreateDebugReportCallbackEXT (
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,
VkDebugReportCallbackEXT* pCallback VkDebugReportCallbackEXT* pCallback
) noexcept { ) noexcept {
return reinterpret_cast<decltype(_vkCreateDebugReportCallbackEXT)*> ( static auto fn = reinterpret_cast<
decltype(_vkCreateDebugReportCallbackEXT)*
> (
vkGetInstanceProcAddr ( vkGetInstanceProcAddr (
instance, instance,
"vkCreateDebugReportCallbackEXT" "vkCreateDebugReportCallbackEXT"
) )
) (instance, pCreateInfo, pAllocator, pCallback); );
return fn (instance, pCreateInfo, pAllocator, pCallback);
} }