mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-05 01:20:42 +00:00
Handle not being able to load vulkan library at runtime
* We try to call vkEnumerateInstanceExtensionProperties to figure out instance extensions we might want to add, and we can only do this at the moment by loading the vulkan dynamic library and calling into it.
This commit is contained in:
@@ -428,17 +428,30 @@ VkResult WrappedVulkan::vkCreateInstance(const VkInstanceCreateInfo *pCreateInfo
|
||||
hasDebugReport = true;
|
||||
}
|
||||
|
||||
std::vector<VkExtensionProperties> supportedExts;
|
||||
|
||||
// enumerate what instance extensions are available
|
||||
void *module = Process::LoadModule(VulkanLibraryName);
|
||||
PFN_vkEnumerateInstanceExtensionProperties enumInstExts =
|
||||
(PFN_vkEnumerateInstanceExtensionProperties)Process::GetFunctionAddress(
|
||||
module, "vkEnumerateInstanceExtensionProperties");
|
||||
if(module)
|
||||
{
|
||||
PFN_vkEnumerateInstanceExtensionProperties enumInstExts =
|
||||
(PFN_vkEnumerateInstanceExtensionProperties)Process::GetFunctionAddress(
|
||||
module, "vkEnumerateInstanceExtensionProperties");
|
||||
|
||||
uint32_t numSupportedExts = 0;
|
||||
enumInstExts(NULL, &numSupportedExts, NULL);
|
||||
if(enumInstExts)
|
||||
{
|
||||
uint32_t numSupportedExts = 0;
|
||||
enumInstExts(NULL, &numSupportedExts, NULL);
|
||||
|
||||
std::vector<VkExtensionProperties> supportedExts(numSupportedExts);
|
||||
enumInstExts(NULL, &numSupportedExts, &supportedExts[0]);
|
||||
supportedExts.resize(numSupportedExts);
|
||||
enumInstExts(NULL, &numSupportedExts, &supportedExts[0]);
|
||||
}
|
||||
}
|
||||
|
||||
if(supportedExts.empty())
|
||||
RDCWARN(
|
||||
"Couldn't load vkEnumerateInstanceExtensionProperties in vkCreateInstance to enumerate "
|
||||
"instance extensions");
|
||||
|
||||
// always enable debug report, if it's available
|
||||
if(!hasDebugReport)
|
||||
|
||||
Reference in New Issue
Block a user