summaryrefslogtreecommitdiffstats
path: root/servers
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2024-08-28 00:11:45 +0200
committerRémi Verschelde <rverschelde@gmail.com>2024-08-28 00:11:45 +0200
commit330fca1ffd0ba2fa7fc8ee270ab47fed645fd9b6 (patch)
treeeafc62db97c60d2c3a87c535c715bce57096ba15 /servers
parent6cb21a56fd102078b31a4e459b1f275ecb06ef5b (diff)
parent88581a7705e2f23005f0831be071956943dc5ecb (diff)
downloadredot-engine-330fca1ffd0ba2fa7fc8ee270ab47fed645fd9b6.tar.gz
Merge pull request #93985 from alvinhochun/windows-gpu-pref
Respect integrated GPU preference in Windows Settings
Diffstat (limited to 'servers')
-rw-r--r--servers/rendering/rendering_device.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/servers/rendering/rendering_device.cpp b/servers/rendering/rendering_device.cpp
index 9e3ab5da49..a6612c0dc9 100644
--- a/servers/rendering/rendering_device.cpp
+++ b/servers/rendering/rendering_device.cpp
@@ -82,11 +82,12 @@ static String _get_device_type_name(const RenderingContextDriver::Device &p_devi
}
static uint32_t _get_device_type_score(const RenderingContextDriver::Device &p_device) {
+ static const bool prefer_integrated = OS::get_singleton()->get_user_prefers_integrated_gpu();
switch (p_device.type) {
case RenderingContextDriver::DEVICE_TYPE_INTEGRATED_GPU:
- return 4;
+ return prefer_integrated ? 5 : 4;
case RenderingContextDriver::DEVICE_TYPE_DISCRETE_GPU:
- return 5;
+ return prefer_integrated ? 4 : 5;
case RenderingContextDriver::DEVICE_TYPE_VIRTUAL_GPU:
return 3;
case RenderingContextDriver::DEVICE_TYPE_CPU: