From 700b100dc5b39c11153b53c52e37f21c0b4a26a2 Mon Sep 17 00:00:00 2001 From: baldurk Date: Wed, 5 Jun 2019 17:41:43 +0100 Subject: [PATCH] Add /usr/local/lib to macOS vulkan search path attempts --- renderdoc/driver/vulkan/vk_apple.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/renderdoc/driver/vulkan/vk_apple.cpp b/renderdoc/driver/vulkan/vk_apple.cpp index 173fd0a49..1a51c14bf 100644 --- a/renderdoc/driver/vulkan/vk_apple.cpp +++ b/renderdoc/driver/vulkan/vk_apple.cpp @@ -94,13 +94,13 @@ void VulkanReplay::GetOutputWindowDimensions(uint64_t id, int32_t &w, int32_t &h h = getMetalLayerHeight(outw.wnd); } -static const char *VulkanLibraryName = "libvulkan.1.dylib"; +static const rdcstr VulkanLibraryName = "libvulkan.1.dylib"_lit; void *LoadVulkanLibrary() { // first try to load the module globally. If so we assume the user has a global (or at least // user-wide) configuration that we should use. - void *ret = Process::LoadModule(VulkanLibraryName); + void *ret = Process::LoadModule(VulkanLibraryName.c_str()); if(ret) { @@ -108,6 +108,15 @@ void *LoadVulkanLibrary() return ret; } + // then try the standard SDK install path under /usr/local/lib + void *ret = Process::LoadModule(("/usr/local/lib/" + VulkanLibraryName).c_str()); + + if(ret) + { + RDCLOG("Loaded /usr/local/lib/libvulkan.1.dylib, using installed MoltenVK environment"); + return ret; + } + // if not, we fall back to our embedded libvulkan and also force use of our embedded ICD. std::string libpath; FileIO::GetLibraryFilename(libpath);