Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
godot
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
community
godot
Commits
b1e3215f
Unverified
Commit
b1e3215f
authored
Jan 03, 2019
by
Hein-Pieter van Braam
Committed by
GitHub
Jan 03, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #24477 from lupoDharkael/nouveau
Don't enable DRI_PRIME if nouveau is loaded
parents
65a86ae1
bfade869
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
1 deletion
+20
-1
os_x11.cpp
platform/x11/os_x11.cpp
+20
-1
No files found.
platform/x11/os_x11.cpp
View file @
b1e3215f
...
@@ -243,7 +243,26 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
...
@@ -243,7 +243,26 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
// Set DRI_PRIME if not set. This means that Godot should default to a higher-power GPU if it exists.
// 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
// Note: Due to the final '0' parameter to setenv any existing DRI_PRIME environment variables will not
// be overwritten.
// be overwritten.
setenv
(
"DRI_PRIME"
,
"1"
,
0
);
bool
enable_dri_prime
=
true
;
// Check if Nouveau is loaded, we don't want to force dGPU usage with that driver.
if
(
FileAccess
*
f
=
FileAccess
::
open
(
"/proc/modules"
,
FileAccess
::
READ
))
{
// Match driver name + space
String
nouveau_str
=
"nouveau "
;
while
(
!
f
->
eof_reached
())
{
String
line
=
f
->
get_line
();
if
(
line
.
begins_with
(
nouveau_str
))
{
enable_dri_prime
=
false
;
break
;
}
}
f
->
close
();
memdelete
(
f
);
}
if
(
enable_dri_prime
)
{
setenv
(
"DRI_PRIME"
,
"1"
,
0
);
}
ContextGL_X11
::
ContextType
opengl_api_type
=
ContextGL_X11
::
GLES_3_0_COMPATIBLE
;
ContextGL_X11
::
ContextType
opengl_api_type
=
ContextGL_X11
::
GLES_3_0_COMPATIBLE
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment