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. [Moved] QtOpenGL/Qt3D without shaders do not work (intel i915) / partial fix

[Moved] QtOpenGL/Qt3D without shaders do not work (intel i915) / partial fix

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.0k Views
  • 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.
  • D Offline
    D Offline
    dmoreno
    wrote on last edited by
    #1

    I've been some time creating a Qt3D game, but i had some problems to get it working, as it thought that I have fragment shaders and I dont. I hunted down the problem at Qt3d::QGLPainter::isFixedFunction() (~qglpainter.cpp:525). It is returning false and should be true, once forced it all work perfectly.

    So I continued unwrapping, and the real culprit is Qt::QGLShaderProgram::hasOpenGLShaderPrograms, isnt it? Not sure as this checks if the system has the ability to compile shader programs. Maybe my system can. Actually it solves all the functions at qt_resolve_glsl_extensions() . So the problem is that isFixedFunction has a bug on how to check shader availability as it should check the extension that really do it, not the function, as the function may exist but not do the real thing.

    So.. How to fix it? I dont really know, but here are my suggestions:

    1. It should use QGLShaderProgram::hasOpenGLShaders(). I dont know how to make this work as its a object method (vs QGLShaderProgram::hasOpenGLShaderPrograms(), static class method).

    2. Make QGLShaderProgram::hasOpenGLShaderPrograms() check for the right extension. My inhouse patch does this:

    @
    diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
    index c7689b8..091d323 100644
    --- a/src/opengl/qglshaderprogram.cpp
    +++ b/src/opengl/qglshaderprogram.cpp
    @@ -3201,7 +3201,8 @@ bool QGLShaderProgram::hasOpenGLShaderPrograms(const QGLContext *context)
    context = QGLContext::currentContext();
    if (!context)
    return false;

    • return qt_resolve_glsl_extensions(const_cast<QGLContext *>(context));
    • return qt_resolve_glsl_extensions(const_cast<QGLContext *>(context)) &&
    •       QByteArray((const char *) glGetString(GL_EXTENSIONS)).contains("GL_ARB_fragment_shader");
      

    #else
    Q_UNUSED(context);
    return true;
    @

    1. Optionally create an environment variable (QTGL_DONT_USE_SHADERS) or any mechanism for at least on tests force font use shaders.

    Does anyone has suggestions on how to make properly this patch? And on how to add it to master qt or qt3d?

    Thanks.

    Disclaimer: Im not an OpenGL expert. Extensions that should be checked maybe are others.

    1 Reply Last reply
    0
    • S Offline
      S Offline
      sarasmit
      wrote on last edited by
      #2

      Hi,

      This is definitely a bug - http://bugreports.qt.nokia.com/browse/QTBUG-18241

      Senior Engineer Team Lead Qt3D
      sarah.j.smith@nokia.com

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sarasmit
        wrote on last edited by
        #3

        Fixed as per http://bugreports.qt.nokia.com/browse/QTBUG-13179 and http://bugreports.qt.nokia.com/browse/QTBUG-12478.

        Bug http://bugreports.qt.nokia.com/browse/QTBUG-18241 closed as duplicate.

        Senior Engineer Team Lead Qt3D
        sarah.j.smith@nokia.com

        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