summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2018-03-09 10:30:52 +0100
committerJohan Helsing <johan.helsing@qt.io>2018-03-09 15:19:17 +0000
commit7ce033cbf9a80d2ea5d687956da668cf4567d361 (patch)
tree6a456cc79e35691ddc3316b73548af33c0e6849f
parent0177295c91cccc4394de41cd4d01f2736bf2ad43 (diff)
Don't try to create compatibility GL context when profile is unsetv5.11.0-beta2
Context creation would sometimes fail because of this. Change-Id: Icf73a42ee2bb984ebfc09b7ed98f094d544134b8 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io> Reviewed-by: Andy Nichols <andy.nichols@qt.io>
-rw-r--r--src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
index 740e9641..6e48659d 100644
--- a/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
+++ b/src/hardwareintegration/client/wayland-egl/qwaylandglcontext.cpp
@@ -259,10 +259,18 @@ QWaylandGLContext::QWaylandGLContext(EGLDisplay eglDisplay, QWaylandDisplay *dis
}
// Profiles are OpenGL only and mandatory in 3.2+. The value is silently ignored for < 3.2.
if (m_format.renderableType() == QSurfaceFormat::OpenGL) {
- eglContextAttrs.append(EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR);
- eglContextAttrs.append(format.profile() == QSurfaceFormat::CoreProfile
- ? EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR
- : EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR);
+ switch (format.profile()) {
+ case QSurfaceFormat::NoProfile:
+ break;
+ case QSurfaceFormat::CoreProfile:
+ eglContextAttrs.append(EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR);
+ eglContextAttrs.append(EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR);
+ break;
+ case QSurfaceFormat::CompatibilityProfile:
+ eglContextAttrs.append(EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR);
+ eglContextAttrs.append(EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR);
+ break;
+ }
}
}
eglContextAttrs.append(EGL_NONE);