kompute : fix issues with debug layers

This commit is contained in:
Jared Van Bortel 2023-11-06 17:24:14 -05:00
parent f88b198885
commit a8cac53207

View File

@ -180,6 +180,16 @@ Manager::createInstance()
applicationExtensions.data(); applicationExtensions.data();
} }
try {
mDynamicLoader = std::make_shared<vk::DynamicLoader>();
} catch (const std::exception & err) {
return;
}
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr =
mDynamicLoader->getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr);
#ifndef KOMPUTE_DISABLE_VK_DEBUG_LAYERS #ifndef KOMPUTE_DISABLE_VK_DEBUG_LAYERS
KP_LOG_DEBUG("Kompute Manager adding debug validation layers"); KP_LOG_DEBUG("Kompute Manager adding debug validation layers");
// We'll identify the layers that are supported // We'll identify the layers that are supported
@ -234,16 +244,6 @@ Manager::createInstance()
} }
#endif #endif
try {
mDynamicLoader = std::make_shared<vk::DynamicLoader>();
} catch (const std::exception & err) {
return;
}
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr =
mDynamicLoader->getProcAddress<PFN_vkGetInstanceProcAddr>("vkGetInstanceProcAddr");
VULKAN_HPP_DEFAULT_DISPATCHER.init(vkGetInstanceProcAddr);
this->mInstance = std::make_shared<vk::Instance>(); this->mInstance = std::make_shared<vk::Instance>();
vk::Result r = vk::createInstance( vk::Result r = vk::createInstance(
&computeInstanceCreateInfo, nullptr, this->mInstance.get()); &computeInstanceCreateInfo, nullptr, this->mInstance.get());
@ -270,7 +270,7 @@ Manager::createInstance()
(PFN_vkDebugReportCallbackEXT)debugMessageCallback; (PFN_vkDebugReportCallbackEXT)debugMessageCallback;
debugCreateInfo.flags = debugFlags; debugCreateInfo.flags = debugFlags;
this->mDebugDispatcher.init(*this->mInstance, &vkGetInstanceProcAddr); this->mDebugDispatcher.init(*this->mInstance, vkGetInstanceProcAddr);
this->mDebugReportCallback = this->mDebugReportCallback =
this->mInstance->createDebugReportCallbackEXT( this->mInstance->createDebugReportCallbackEXT(
debugCreateInfo, nullptr, this->mDebugDispatcher); debugCreateInfo, nullptr, this->mDebugDispatcher);