mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-31 14:52:11 +01:00
[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:
parent
26b319b29b
commit
40b52758e3
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user