mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07: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
(cherry picked from commit 485200342d)
Signed-off-by: phosit <phosit@autistici.org>
This commit is contained in:
parent
fbc1b160e1
commit
8420377789
2 changed files with 16 additions and 4 deletions
|
|
@ -140,6 +140,9 @@ renderer.backend.vulkan.disabledescriptorindexing = false
|
|||
renderer.backend.vulkan.deviceindexoverride = -1
|
||||
renderer.backend.vulkan.destroyoldswapchainbefore = false
|
||||
|
||||
; In case index override isn't enough we might choose a device automatically.
|
||||
renderer.backend.vulkan.choosebestdevice = false
|
||||
|
||||
renderer.backend.vulkan.debugbarrierafterframebufferpass = false
|
||||
renderer.backend.vulkan.debugwaitidlebeforeacquire = false
|
||||
renderer.backend.vulkan.debugwaitidlebeforepresent = false
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue