From a4c7d03ed2b8e59bf8a2a4bfc30946fe4f96d68a Mon Sep 17 00:00:00 2001 From: Stenzek Date: Wed, 18 Oct 2023 00:18:17 +1000 Subject: [PATCH] VulkanDevice: Ignore GPUs which don't support Vulkan 1.1 --- src/util/vulkan_device.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/util/vulkan_device.cpp b/src/util/vulkan_device.cpp index ae57af69b..9c8d79a71 100644 --- a/src/util/vulkan_device.cpp +++ b/src/util/vulkan_device.cpp @@ -247,8 +247,8 @@ VulkanDevice::GPUList VulkanDevice::EnumerateGPUs(VkInstance instance) res = vkEnumeratePhysicalDevices(instance, &gpu_count, physical_devices.data()); if (res == VK_INCOMPLETE) { - Log_WarningPrintf("First vkEnumeratePhysicalDevices() call returned %zu devices, but second returned %u", - physical_devices.size(), gpu_count); + Log_WarningFmt("First vkEnumeratePhysicalDevices() call returned {} devices, but second returned {}", + physical_devices.size(), gpu_count); } else if (res != VK_SUCCESS) { @@ -266,6 +266,16 @@ VulkanDevice::GPUList VulkanDevice::EnumerateGPUs(VkInstance instance) VkPhysicalDeviceProperties props = {}; vkGetPhysicalDeviceProperties(device, &props); + // Skip GPUs which don't support Vulkan 1.1, since we won't be able to create a device with them anyway. + if (VK_API_VERSION_VARIANT(props.apiVersion) == 0 && VK_API_VERSION_MAJOR(props.apiVersion) <= 1 && + VK_API_VERSION_MINOR(props.apiVersion) < 1) + { + Log_WarningFmt("Ignoring Vulkan GPU '{}' because it only claims support for Vulkan {}.{}.{}", props.deviceName, + VK_API_VERSION_MAJOR(props.apiVersion), VK_API_VERSION_MINOR(props.apiVersion), + VK_API_VERSION_PATCH(props.apiVersion)); + continue; + } + std::string gpu_name = props.deviceName; // handle duplicate adapter names