From fa167d2afad4c2ff8b7e9412091ffc7e1ffb3458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20H=C3=B6glund?= Date: Mon, 4 Feb 2013 15:53:10 +0100 Subject: Check for GLX_ARB_create_context_profile before specifying a profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idc4982c039f8a6a304d9ce5ce6736d518fb0ef00 Reviewed-by: Samuel Rødal --- src/plugins/platforms/xcb/qglxintegration.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/plugins/platforms/xcb') diff --git a/src/plugins/platforms/xcb/qglxintegration.cpp b/src/plugins/platforms/xcb/qglxintegration.cpp index 23bec15b48..b7f0b14c70 100644 --- a/src/plugins/platforms/xcb/qglxintegration.cpp +++ b/src/plugins/platforms/xcb/qglxintegration.cpp @@ -285,6 +285,7 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc) glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB"); QList glxExt = QByteArray(glXQueryExtensionsString(DISPLAY_FROM_XCB(m_screen), m_screen->screenNumber())).split(' '); + bool supportsProfiles = glxExt.contains("GLX_ARB_create_context_profile"); // Use glXCreateContextAttribsARB if is available if (glxExt.contains("GLX_ARB_create_context") && glXCreateContextAttribsARB != 0) { @@ -304,7 +305,7 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat << GLX_CONTEXT_MINOR_VERSION_ARB << minorVersion; // If asking for OpenGL 3.2 or newer we should also specify a profile - if (m_format.majorVersion() > 3 || (m_format.majorVersion() == 3 && m_format.minorVersion() > 1)) { + if (supportsProfiles && (m_format.majorVersion() > 3 || (m_format.majorVersion() == 3 && m_format.minorVersion() > 1))) { if (m_format.profile() == QSurfaceFormat::CoreProfile) contextAttributes << GLX_CONTEXT_PROFILE_MASK_ARB << GLX_CONTEXT_CORE_PROFILE_BIT_ARB; else -- cgit v1.2.3