From 8e870d4cc0325ce41cc32f2323a2d8ae5429f4e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Camilla=20L=C3=B6wy?= Date: Tue, 7 Feb 2017 20:08:14 +0100 Subject: [PATCH] Win32: Fix bad error from glfwVulkanSupported A VK_ERROR_OUT_OF_HOST_MEMORY error would be passed on to client code on systems that had a Vulkan loader but no ICD. Fixes #916. --- README.md | 2 ++ src/vulkan.c | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 743ffcaf..38a230d4 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,8 @@ information on what to include when reporting a bug. - [Win32] Bugfix: Undecorated windows could not be iconified by the user (#861) - [Win32] Bugfix: Deadzone logic could underflow with some controllers (#910) - [Win32] Bugfix: Bitness test in `FindVulkan.cmake` was VS specific (#928) +- [Win32] Bugfix: `glfwVulkanSupported` emitted an error on systems with + a loader but no ICD (#916) - [X11] Replaced `_GLFW_HAS_XF86VM` compile-time option with dynamic loading - [X11] Bugfix: `glfwGetVideoMode` would segfault on Cygwin/X - [Linux] Bugfix: Event processing did not detect joystick disconnection (#932) diff --git a/src/vulkan.c b/src/vulkan.c index 2acf7476..9bd10d43 100644 --- a/src/vulkan.c +++ b/src/vulkan.c @@ -99,9 +99,13 @@ GLFWbool _glfwInitVulkan(int mode) err = vkEnumerateInstanceExtensionProperties(NULL, &count, NULL); if (err) { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Vulkan: Failed to query instance extension count: %s", - _glfwGetVulkanResultString(err)); + // NOTE: This happens on systems with a loader but without any Vulkan ICD + if (mode == _GLFW_REQUIRE_LOADER) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Vulkan: Failed to query instance extension count: %s", + _glfwGetVulkanResultString(err)); + } _glfwTerminateVulkan(); return GLFW_FALSE;