From 3cbaf619368d233dcb320b9dec5433c4d037800b Mon Sep 17 00:00:00 2001 From: GameParrot <85067619+GameParrot@users.noreply.github.com> Date: Fri, 8 Jul 2022 21:57:23 -0400 Subject: [PATCH 1/2] Fix MoltenVK Loading on macOS Loading Vulkan fails on macOS even if the user has libMoltenVK.dylib. This is because it tries to load libvulkan.1.dylib, not libMoltenVK.dylib. --- src/vulkan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vulkan.c b/src/vulkan.c index 64a4650f..4d3b3b40 100644 --- a/src/vulkan.c +++ b/src/vulkan.c @@ -60,7 +60,7 @@ GLFWbool _glfwInitVulkan(int mode) #elif defined(_GLFW_WIN32) _glfw.vk.handle = _glfwPlatformLoadModule("vulkan-1.dll"); #elif defined(_GLFW_COCOA) - _glfw.vk.handle = _glfwPlatformLoadModule("libvulkan.1.dylib"); + _glfw.vk.handle = _glfwPlatformLoadModule("libMoltenVK.dylib"); if (!_glfw.vk.handle) _glfw.vk.handle = _glfwLoadLocalVulkanLoaderCocoa(); #elif defined(__OpenBSD__) || defined(__NetBSD__) From 4512d49486a41adc3b91dcab8868f482f54269c2 Mon Sep 17 00:00:00 2001 From: GameParrot <85067619+GameParrot@users.noreply.github.com> Date: Fri, 8 Jul 2022 22:03:15 -0400 Subject: [PATCH 2/2] Load libMoltenVK.dylib instead --- src/cocoa_init.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/cocoa_init.m b/src/cocoa_init.m index aa369f9c..b0fdf463 100644 --- a/src/cocoa_init.m +++ b/src/cocoa_init.m @@ -465,7 +465,7 @@ void* _glfwLoadLocalVulkanLoaderCocoa(void) return NULL; CFURLRef loaderUrl = CFURLCreateCopyAppendingPathComponent( - kCFAllocatorDefault, frameworksUrl, CFSTR("libvulkan.1.dylib"), false); + kCFAllocatorDefault, frameworksUrl, CFSTR("libMoltenVK.dylib"), false); if (!loaderUrl) { CFRelease(frameworksUrl);