From 40b52758e3240700b061dd9650986a1312c9099f Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Wed, 16 May 2018 16:17:39 +0200 Subject: [PATCH] [dxvk] Enumerate discrete GPUs before integrated GPUs May help with games that do not run on Intel GPUs when the Intel Vulkan driver is installed alongside the AMD or Nvidia drivers. --- src/dxvk/dxvk_instance.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/dxvk/dxvk_instance.cpp b/src/dxvk/dxvk_instance.cpp index 5dc6d7cab..e4c0df357 100644 --- a/src/dxvk/dxvk_instance.cpp +++ b/src/dxvk/dxvk_instance.cpp @@ -1,5 +1,7 @@ #include "dxvk_instance.h" +#include + namespace dxvk { DxvkInstance::DxvkInstance() @@ -26,6 +28,13 @@ namespace dxvk { std::vector> result; for (uint32_t i = 0; i < numAdapters; i++) result.push_back(new DxvkAdapter(this, adapters[i])); + + std::sort(result.begin(), result.end(), + [this] (const Rc& a, const Rc& b) -> bool { + return a->deviceProperties().deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU + && b->deviceProperties().deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU; + }); + return result; }