Cocoa: Add support for MoltenVK dynamic library

Tested with MoltenVK 0.18.0.

Related to #870.
This commit is contained in:
Camilla Löwy
2017-07-10 17:07:59 +02:00
parent d55c57b504
commit 8e899ccc29
6 changed files with 27 additions and 35 deletions
+1 -10
View File
@@ -52,8 +52,7 @@ GLFWbool _glfwInitVulkan(int mode)
#if defined(_GLFW_WIN32)
_glfw.vk.handle = _glfw_dlopen("vulkan-1.dll");
#elif defined(_GLFW_COCOA)
// NULL maps to RTLD_DEFAULT, which searches all loaded binaries
_glfw.vk.handle = _glfw_dlopen(NULL);
_glfw.vk.handle = _glfw_dlopen("libMoltenVK.dylib");
#else
_glfw.vk.handle = _glfw_dlopen("libvulkan.so.1");
#endif
@@ -69,16 +68,8 @@ GLFWbool _glfwInitVulkan(int mode)
_glfw_dlsym(_glfw.vk.handle, "vkGetInstanceProcAddr");
if (!_glfw.vk.GetInstanceProcAddr)
{
#if defined(_GLFW_COCOA)
if (mode == _GLFW_REQUIRE_LOADER)
{
_glfwInputError(GLFW_API_UNAVAILABLE,
"Vulkan: vkGetInstanceProcAddr not found in process");
}
#else
_glfwInputError(GLFW_API_UNAVAILABLE,
"Vulkan: Loader does not export vkGetInstanceProcAddr");
#endif
_glfwTerminateVulkan();
return GLFW_FALSE;