summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Matías Locatti2024-01-24 23:32:20 -0300
committerGravatar Matías Locatti2024-01-24 23:36:14 -0300
commit807f421752a63756cb1eda734cd588c0e8d6811e (patch)
tree2e6394deec5c35dfc57997d16f972900b6798b8d
parentMerge pull request #12763 from liamwhite/fix-hbl-again (diff)
downloadyuzu-807f421752a63756cb1eda734cd588c0e8d6811e.tar.gz
yuzu-807f421752a63756cb1eda734cd588c0e8d6811e.tar.xz
yuzu-807f421752a63756cb1eda734cd588c0e8d6811e.zip
Demote Mesa dozen to the bottom of the device list
-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,
39 } 39 }
40} 40}
41 41
42bool IsMicrosoftDozen(const char* device_name) {
43 return std::strstr(device_name, "Microsoft") != nullptr;
44}
45
42void SortPhysicalDevices(std::vector<VkPhysicalDevice>& devices, const InstanceDispatch& dld) { 46void SortPhysicalDevices(std::vector<VkPhysicalDevice>& devices, const InstanceDispatch& dld) {
43 // Sort by name, this will set a base and make GPUs with higher numbers appear first 47 // Sort by name, this will set a base and make GPUs with higher numbers appear first
44 // (e.g. GTX 1650 will intentionally be listed before a GTX 1080). 48 // (e.g. GTX 1650 will intentionally be listed before a GTX 1080).
@@ -52,6 +56,12 @@ void SortPhysicalDevices(std::vector<VkPhysicalDevice>& devices, const InstanceD
52 }); 56 });
53 // Prefer Nvidia over AMD, AMD over Intel, Intel over the rest. 57 // Prefer Nvidia over AMD, AMD over Intel, Intel over the rest.
54 SortPhysicalDevicesPerVendor(devices, dld, {0x10DE, 0x1002, 0x8086}); 58 SortPhysicalDevicesPerVendor(devices, dld, {0x10DE, 0x1002, 0x8086});
59 // Demote Microsoft's Dozen devices to the bottom.
60 SortPhysicalDevices(
61 devices, dld,
62 [](const VkPhysicalDeviceProperties& lhs, const VkPhysicalDeviceProperties& rhs) {
63 return IsMicrosoftDozen(rhs.deviceName) && !IsMicrosoftDozen(lhs.deviceName);
64 });
55} 65}
56 66
57template <typename T> 67template <typename T>