Merge pull request #46794 from akien-mga/3.2-linux-fix-detect_prime-steam

[3.2] Linux: Fix PRIME detection on Steam
This commit is contained in:
Rémi Verschelde 2021-03-08 16:30:09 +01:00 committed by GitHub
commit 9c30f70f64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -264,7 +264,10 @@ Error OS_X11::initialize(const VideoMode &p_desired, int p_video_driver, int p_a
use_prime = 0; use_prime = 0;
} }
if (getenv("LD_LIBRARY_PATH")) { // Some tools use fake libGL libraries and have them override the real one using
// LD_LIBRARY_PATH, so we skip them. *But* Steam also sets LD_LIBRARY_PATH for its
// runtime and includes system `/lib` and `/lib64`... so ignore Steam.
if (use_prime == -1 && getenv("LD_LIBRARY_PATH") && !getenv("STEAM_RUNTIME_LIBRARY_PATH")) {
String ld_library_path(getenv("LD_LIBRARY_PATH")); String ld_library_path(getenv("LD_LIBRARY_PATH"));
Vector<String> libraries = ld_library_path.split(":"); Vector<String> libraries = ld_library_path.split(":");