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:
parent
54283ce0a1
commit
4d6196c3d3
1 changed files with 3 additions and 3 deletions
|
|
@ -475,12 +475,12 @@ int main(int argc, char *argv[])
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef Q_PROCESSOR_X86
|
|
||||||
// Some ARM and RISC-V embedded devices don't have working GLX which can cause
|
// 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
|
// 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");
|
SDL_SetHint(SDL_HINT_VIDEO_X11_FORCE_EGL, "1");
|
||||||
#endif
|
qputenv("QT_XCB_GL_INTEGRATION", "xcb_egl");
|
||||||
|
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
// This avoids using the default keychain for SSL, which may cause
|
// This avoids using the default keychain for SSL, which may cause
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue