diff --git a/tools/hello.cpp b/tools/hello.cpp index acba2aa..4ec9632 100644 --- a/tools/hello.cpp +++ b/tools/hello.cpp @@ -299,12 +299,16 @@ VkResult _vkCreateDebugReportCallbackEXT ( const VkAllocationCallbacks* pAllocator, VkDebugReportCallbackEXT* pCallback ) noexcept { - return reinterpret_cast ( + static auto fn = reinterpret_cast< + decltype(_vkCreateDebugReportCallbackEXT)* + > ( vkGetInstanceProcAddr ( instance, "vkCreateDebugReportCallbackEXT" ) - ) (instance, pCreateInfo, pAllocator, pCallback); + ); + + return fn (instance, pCreateInfo, pAllocator, pCallback); }