summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatías Locatti <42481638+goldenx86@users.noreply.github.com>2024-01-25 07:58:09 +0100
committerGitHub <noreply@github.com>2024-01-25 07:58:09 +0100
commitf3749394ac5700a2438cdc4d6536941e02b92939 (patch)
tree2e6394deec5c35dfc57997d16f972900b6798b8d /src
parentMerge pull request #12763 from liamwhite/fix-hbl-again (diff)
parentDemote Mesa dozen to the bottom of the device list (diff)
downloadyuzu-f3749394ac5700a2438cdc4d6536941e02b92939.tar
yuzu-f3749394ac5700a2438cdc4d6536941e02b92939.tar.gz
yuzu-f3749394ac5700a2438cdc4d6536941e02b92939.tar.bz2
yuzu-f3749394ac5700a2438cdc4d6536941e02b92939.tar.lz
yuzu-f3749394ac5700a2438cdc4d6536941e02b92939.tar.xz
yuzu-f3749394ac5700a2438cdc4d6536941e02b92939.tar.zst
yuzu-f3749394ac5700a2438cdc4d6536941e02b92939.zip
Diffstat (limited to 'src')
-rw-r--r--src/video_core/vulkan_common/vulkan_wrapper.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/video_core/vulkan_common/vulkan_wrapper.cpp b/src/video_core/vulkan_common/vulkan_wrapper.cpp
index 074aed964..3966bd61e 100644
--- a/src/video_core/vulkan_common/vulkan_wrapper.cpp
+++ b/src/video_core/vulkan_common/vulkan_wrapper.cpp
@@ -39,6 +39,10 @@ void SortPhysicalDevicesPerVendor(std::vector<VkPhysicalDevice>& devices,
}
}
+bool IsMicrosoftDozen(const char* device_name) {
+ return std::strstr(device_name, "Microsoft") != nullptr;
+}
+
void SortPhysicalDevices(std::vector<VkPhysicalDevice>& devices, const InstanceDispatch& dld) {
// Sort by name, this will set a base and make GPUs with higher numbers appear first
// (e.g. GTX 1650 will intentionally be listed before a GTX 1080).
@@ -52,6 +56,12 @@ void SortPhysicalDevices(std::vector<VkPhysicalDevice>& devices, const InstanceD
});
// Prefer Nvidia over AMD, AMD over Intel, Intel over the rest.
SortPhysicalDevicesPerVendor(devices, dld, {0x10DE, 0x1002, 0x8086});
+ // Demote Microsoft's Dozen devices to the bottom.
+ SortPhysicalDevices(
+ devices, dld,
+ [](const VkPhysicalDeviceProperties& lhs, const VkPhysicalDeviceProperties& rhs) {
+ return IsMicrosoftDozen(rhs.deviceName) && !IsMicrosoftDozen(lhs.deviceName);
+ });
}
template <typename T>