From 0a952801b3beb25c110bed597511b1d84de82182 Mon Sep 17 00:00:00 2001 From: Danny Robson Date: Mon, 4 Mar 2019 00:20:08 +1100 Subject: [PATCH] tools/hello: avoid needing _vkCreateDebugReportCallbackEXT symbol --- tools/hello.cpp | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/tools/hello.cpp b/tools/hello.cpp index 944d5a4..acba2aa 100644 --- a/tools/hello.cpp +++ b/tools/hello.cpp @@ -293,6 +293,21 @@ public: }; +VkResult _vkCreateDebugReportCallbackEXT ( + VkInstance instance, + const VkDebugReportCallbackCreateInfoEXT* pCreateInfo, + const VkAllocationCallbacks* pAllocator, + VkDebugReportCallbackEXT* pCallback +) noexcept { + return reinterpret_cast ( + vkGetInstanceProcAddr ( + instance, + "vkCreateDebugReportCallbackEXT" + ) + ) (instance, pCreateInfo, pAllocator, pCallback); +} + + /////////////////////////////////////////////////////////////////////////////// int main (void) @@ -332,16 +347,14 @@ main (void) ; debug_info.pfnCallback = vk_debug_callback; - if (0) { - VkDebugReportCallbackEXT obj; - auto res = vkCreateDebugReportCallbackEXT (instance.native (), &debug_info, nullptr, &obj); - if (res != VK_SUCCESS) - panic ("deport report callback"); - } + VkDebugReportCallbackEXT obj; + auto res = _vkCreateDebugReportCallbackEXT (instance.native (), &debug_info, nullptr, &obj); + if (res != VK_SUCCESS) + panic ("deport report callback"); - auto debug_callback = cruft::vk::make_owned ( - instance, &debug_info, nullptr - ); + //auto debug_callback = cruft::vk::make_owned ( + // instance, &debug_info, nullptr + //); //-------------------------------------------------------------------------