mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-29 00:53:42 +00:00
Disables Vulkan devices sorting by default
Currently we always choose the best device. But it's not always desirable. A more safe approach is to use the default device (with index 0). The only downside of that is if a user didn't adjust settings then the game might run on an integrated GPU instead of a discrete one. In the future it'll be solved by selecting GPU in options: #8529 Fixes #8455
This commit is contained in:
@@ -407,10 +407,19 @@ std::unique_ptr<CDevice> CDevice::Create(SDL_Window* window)
|
||||
}
|
||||
if (choosedDeviceIt == device->m_AvailablePhysicalDevices.end())
|
||||
{
|
||||
// We need to choose the best available device fits our needs.
|
||||
choosedDeviceIt = min_element(
|
||||
availablePhyscialDevices.begin(), availablePhyscialDevices.end(),
|
||||
ComparePhysicalDevices);
|
||||
const bool chooseBestDevice{g_ConfigDB.Get("renderer.backend.vulkan.choosebestdevice", false)};
|
||||
if (chooseBestDevice)
|
||||
{
|
||||
// We need to choose the best available device fits our needs.
|
||||
choosedDeviceIt = min_element(
|
||||
availablePhyscialDevices.begin(), availablePhyscialDevices.end(),
|
||||
ComparePhysicalDevices);
|
||||
}
|
||||
else
|
||||
{
|
||||
// By default we assume that the Vulkan driver provides a decent default.
|
||||
choosedDeviceIt = availablePhyscialDevices.begin();
|
||||
}
|
||||
}
|
||||
device->m_ChoosenDevice = *choosedDeviceIt;
|
||||
const SAvailablePhysicalDevice& choosenDevice = device->m_ChoosenDevice;
|
||||
|
||||
Reference in New Issue
Block a user