Skip to content

Commit

Permalink
VulkanDevice: Ignore GPUs which don't support Vulkan 1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
stenzek committed Oct 17, 2023
1 parent db675cf commit a4c7d03
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/util/vulkan_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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
Expand Down

0 comments on commit a4c7d03

Please sign in to comment.