mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 02:30:52 +00:00
Use EGL for all X11 GL context creation in Qt and SDL
Using a mix of GLX and EGL can cause interoperability issues when our EGLRenderer tries to bind an EGL context while Qt already has a GLX context bound on the same thread. This was the source of a number of confusing EGLRenderer failures over the years.
This commit is contained in:
@@ -475,12 +475,12 @@ int main(int argc, char *argv[])
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef Q_PROCESSOR_X86
|
||||
// Some ARM and RISC-V embedded devices don't have working GLX which can cause
|
||||
// SDL to fail to find a working OpenGL implementation at all. Let's force EGL
|
||||
// on non-x86 platforms, since GLX is deprecated anyway.
|
||||
// on all platforms for both SDL and Qt. This also avoids GLX-EGL interop issues
|
||||
// when trying to use EGL on the main thread after Qt uses GLX.
|
||||
SDL_SetHint(SDL_HINT_VIDEO_X11_FORCE_EGL, "1");
|
||||
#endif
|
||||
qputenv("QT_XCB_GL_INTEGRATION", "xcb_egl");
|
||||
|
||||
#ifdef Q_OS_MACOS
|
||||
// This avoids using the default keychain for SSL, which may cause
|
||||
|
||||
Reference in New Issue
Block a user