QOpenGLPaintEngine vs. desktop OpenGL core profile

  • Hello, as the title suggest, my question is: will it be possible to use QPainter (backed by QOpenGLPaintEngine) with core profile?

    So far, I only managed a working QPainter with compatibility profile (gl version > 3.2). When switched to core profile, I got a black window and the following debug output:

    @QOpenGLShader::compile(Vertex): Vertex shader failed to compile with the following errors:
    ERROR: error(#272) Implicit version number 110 not supported by GL3 forward compatible context
    ERROR: error(#273) 1 compilation errors. No code generated

    followed by problematic shader source code


    Upon looking into the soruces, I found that the QOpenGLPaintEngine's stock shaders are missing the #version directive, causing shader compilation to fail in core profile. I managed to "hack" the #version in, but without success. I'm afraid the problem is deeper than that.

    My concern is only because I read somewhere that compatibility profile is not available on some platforms (OS X).

    My setup is: Win7 / MSVC2010 and current Qt 5.1 sources from git, configured with: -opengl desktop -no-angle.

  • No the QOpenGLPaintEngine is not usable with Core profile contexts at present. It is also likely quite some work to make it work with a core profile so I can't see it happening anytime soon.

    It is true that OS X doesn't provide OpenGL 3.2 Compatibility profile, however it does still provide OpenGL 2.x contexts and the QOpenGLPaintEngine works there.

    Similar story for QtQuick 2...

  • Thank you for the clarification.

    I have a followup question, maybe little offtopic. Can I have another QQuickView rendered into an offscreen FBO, without exposing the window? It seems QQuickWindow::setRenderTarget() is designed just for this. My idea is to have this auxiliary hidden window render my QML UI layer into an FBO and then re-use this FBO in my OpenGL 4.2 core profile renderer in the first QWindow.

    Should be in theory possible via context sharing, right? Thank you for any input.

Log in to reply