Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. OpenGL 4.6 unable to set surfaceformat
Qt 6.11 is out! See what's new in the release blog

OpenGL 4.6 unable to set surfaceformat

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 1 Posters 651 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Reynolds
    wrote on last edited by
    #1

    This morning Ubuntu updated Mesa to version 20.0.8. Since this update Qt is unable to set the correct surfaceformat and it will always default to OpenGL 4.6. This leads to a segfault when trying to access any OpenGL function. I have confirmed that OpenGL runs correctly and I am able to select core profile 4.1 on other applications using GLFW.

    I set the core format in my Qt application using:

    QSurfaceFormat glFormat;
    glFormat.setProfile(QSurfaceFormat::CoreProfile);
    glFormat.setVersion(4, 1);
    
    glFormat.setOption(QSurfaceFormat::DebugContext);
    glFormat.setSamples(4);
    glFormat.setSwapInterval(0);
    
    QSurfaceFormat::setDefaultFormat(glFormat);
    

    and use a pointer to the QOpenGLFunctions_4_1_core object to handle calls to openGL

    When printing the version string using:

    QString glVersion;
    glVersion = reinterpret_cast<const char*>(glGetString(GL_VERSION));
    qDebug() << "Using" << qPrintable(glVersion);
    

    It will consistently print out:
    "Using 4.6 (Core Profile) Mesa 20.0.8"

    No, matter what major or minor version I set in the surface format. There is also no QOpenGLFunctions_4_6_core available to use instead. Is this a bug in Qt or am I missing a setting somewhere?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Reynolds
      wrote on last edited by
      #2

      I forgot to mention that this was on Qt 5.10. Upgrading to 5.15 did not solve anything.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved