Check for GLX_ARB_create_context_profile before specifying a profile

Change-Id: Idc4982c039f8a6a304d9ce5ce6736d518fb0ef00
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
This commit is contained in:
Fredrik Höglund 2013-02-04 15:53:10 +01:00 committed by The Qt Project
parent b5119f9d4e
commit fa167d2afa

View File

@ -285,6 +285,7 @@ QGLXContext::QGLXContext(QXcbScreen *screen, const QSurfaceFormat &format, QPlat
glXCreateContextAttribsARB = (glXCreateContextAttribsARBProc) glXGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB");
QList<QByteArray> 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