From 5191abe4fc4caf54f0d9f1069968d0da0cb28c4b Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Wed, 29 Nov 2023 13:29:53 -0500 Subject: [PATCH 1/2] Manager: fix build with debug layers on Android Signed-off-by: Jared Van Bortel --- src/Manager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Manager.cpp b/src/Manager.cpp index eccdbaee..8a223718 100644 --- a/src/Manager.cpp +++ b/src/Manager.cpp @@ -261,7 +261,7 @@ Manager::createInstance() (PFN_vkDebugReportCallbackEXT)debugMessageCallback; debugCreateInfo.flags = debugFlags; - this->mDebugDispatcher.init(*this->mInstance, &vkGetInstanceProcAddr); + this->mDebugDispatcher.init(*this->mInstance, vkGetInstanceProcAddr); this->mDebugReportCallback = this->mInstance->createDebugReportCallbackEXT( debugCreateInfo, nullptr, this->mDebugDispatcher); From 791f1a4ef2cf9aa463d71bf02ad7ebedb9cd1326 Mon Sep 17 00:00:00 2001 From: Jared Van Bortel Date: Wed, 29 Nov 2023 13:30:04 -0500 Subject: [PATCH 2/2] fix crash Signed-off-by: Jared Van Bortel --- src/Manager.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Manager.cpp b/src/Manager.cpp index 8a223718..c8b909cf 100644 --- a/src/Manager.cpp +++ b/src/Manager.cpp @@ -179,6 +179,13 @@ Manager::createInstance() applicationExtensions.data(); } +#if VK_USE_PLATFORM_ANDROID_KHR + vk::DynamicLoader dl; + PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = + dl.getProcAddress("vkGetInstanceProcAddr"); + VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr); +#endif // VK_USE_PLATFORM_ANDROID_KHR + #ifndef KOMPUTE_DISABLE_VK_DEBUG_LAYERS KP_LOG_DEBUG("Kompute Manager adding debug validation layers"); // We'll identify the layers that are supported @@ -233,13 +240,6 @@ Manager::createInstance() } #endif -#if VK_USE_PLATFORM_ANDROID_KHR - vk::DynamicLoader dl; - PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr = - dl.getProcAddress("vkGetInstanceProcAddr"); - VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr); -#endif // VK_USE_PLATFORM_ANDROID_KHR - this->mInstance = std::make_shared(); vk::createInstance( &computeInstanceCreateInfo, nullptr, this->mInstance.get());