[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.
This commit is contained in:
Philip Rebohle 2018-05-16 16:17:39 +02:00
parent 26b319b29b
commit 40b52758e3
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
1 changed files with 9 additions and 0 deletions

View File

@ -1,5 +1,7 @@
#include "dxvk_instance.h"
#include <algorithm>
namespace dxvk {
DxvkInstance::DxvkInstance()
@ -26,6 +28,13 @@ namespace dxvk {
std::vector<Rc<DxvkAdapter>> 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<DxvkAdapter>& a, const Rc<DxvkAdapter>& b) -> bool {
return a->deviceProperties().deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
&& b->deviceProperties().deviceType != VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU;
});
return result;
}