summaryrefslogtreecommitdiff
path: root/platform
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2018-11-08 14:21:12 +0100
committerGitHub <noreply@github.com>2018-11-08 14:21:12 +0100
commite7cb47e686368b462a5aec62379dcfb1c6d7a821 (patch)
tree05406c9fd529b89e5a6ec2199d41caf01e0251ca /platform
parentc4234b15211beca909c5850aeb74f87356c895d1 (diff)
parent0aad11a6a77d8ce3a8cf6096ad01cf25cb94553d (diff)
Merge pull request #23463 from hpvb/use-dri-prime-default
Set DRI_PRIME=1 by default on X11 if not already set
Diffstat (limited to 'platform')
-rw-r--r--platform/x11/os_x11.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/platform/x11/os_x11.cpp b/platform/x11/os_x11.cpp
index 8ba5833796..2ab7b835b6 100644
--- a/platform/x11/os_x11.cpp
+++ b/platform/x11/os_x11.cpp
@@ -267,6 +267,10 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
// maybe contextgl wants to be in charge of creating the window
#if defined(OPENGL_ENABLED)
+ // Set DRI_PRIME if not set. This means that Godot should default to a higher-power GPU if it exists.
+ // Note: Due to the final '0' parameter to setenv any existing DRI_PRIME environment variables will not
+ // be overwritten.
+ setenv("DRI_PRIME", "1", 0);
ContextGL_X11::ContextType opengl_api_type = ContextGL_X11::GLES_3_0_COMPATIBLE;