diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-04-12 13:16:00 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2023-04-12 18:46:33 +0200 |
commit | be375614971d89365138fa4b899239da729940cb (patch) | |
tree | b8bca301b9c0415c235811a293c376a2763320bc /src/gui/opengl/platform/egl/qeglconvenience.cpp | |
parent | bbd6cbd71c7ff4df3d141383d090a4bdc2459a48 (diff) |
Default NVidia EGL to GLES2
Found some documentation saying NVidia provided desktop GL for
development purposes only, and recommmended against using it. Not sure
if that applied to all NVidia drivers, or only that one embedded
platform, but since we have multiple bugs about EGL not working on
NVidia, default to using GLES2 like it suggested.
Change-Id: If8ac8dd61c4ceb88162360f1eaa2a096acefa9c6
Pick-to: 6.5 6.2
Fixes: QTBUG-105921
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/opengl/platform/egl/qeglconvenience.cpp')
-rw-r--r-- | src/gui/opengl/platform/egl/qeglconvenience.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/opengl/platform/egl/qeglconvenience.cpp b/src/gui/opengl/platform/egl/qeglconvenience.cpp index 3d5b99c38c..5124e2e5dc 100644 --- a/src/gui/opengl/platform/egl/qeglconvenience.cpp +++ b/src/gui/opengl/platform/egl/qeglconvenience.cpp @@ -216,14 +216,17 @@ EGLConfig QEglConfigChooser::chooseConfig() configureAttributes.append(EGL_OPENVG_BIT); break; #ifdef EGL_VERSION_1_4 - case QSurfaceFormat::DefaultRenderableType: + case QSurfaceFormat::DefaultRenderableType: { #ifndef QT_NO_OPENGL - if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL) + // NVIDIA EGL only provides desktop GL for development purposes, and recommends against using it. + const char *vendor = eglQueryString(display(), EGL_VENDOR); + if (QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL && (!vendor || !strstr(vendor, "NVIDIA"))) configureAttributes.append(EGL_OPENGL_BIT); else #endif // QT_NO_OPENGL needsES2Plus = true; break; + } case QSurfaceFormat::OpenGL: configureAttributes.append(EGL_OPENGL_BIT); break; @@ -353,6 +356,7 @@ QSurfaceFormat q_glFormatFromConfig(EGLDisplay display, const EGLConfig config, else if (referenceFormat.renderableType() == QSurfaceFormat::DefaultRenderableType #ifndef QT_NO_OPENGL && QOpenGLContext::openGLModuleType() == QOpenGLContext::LibGL + && !strstr(eglQueryString(display, EGL_VENDOR), "NVIDIA") #endif && (renderableType & EGL_OPENGL_BIT)) format.setRenderableType(QSurfaceFormat::OpenGL); |