Add /usr/local/lib to macOS vulkan search path attempts

This commit is contained in:
baldurk
2019-06-05 17:57:28 +01:00
parent 257e78dbff
commit 700b100dc5
+11 -2
View File
@@ -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);