Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-64019

QGraphicalEffects not compatible with OpenGL 3.2+ on macOS

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.6.3, 5.9.2
    • None
    • MacBook Pro with OS X Yosemite and nVidia GPU

      MacBook Pro with OS X El Capitan and AMD GPU

      MacBook Pro with OS X Sierra and AMD GPU
    • macOS

    Description

      If QtGraphicalEffects are used in QML with an OpenGL context higher than 3.1 artifacts appear or elements are missing. The QtCreator debug console shows a list of shader compilation errors.

       

      Steps to reproduce: Create Qt Quick Application Project. Import and use any QtGraphicalEffects Item in main.qml
      In main.cpp set QSurfaceFormat::defaultFormat() to a CoreProfile with version 3.2 or greater before main.qml file is loaded.

       

      Cause: macOS's graphics driver does not support OpenGL compatibility profiles. This leads to syntax errors in GLSL shader code because for example "varying" is no longer a valid keyword in OpenGL 3.2 GLSL 1.5.
      This is not an issue with a specific OS X version or GPU vendor. It is an issue of shader code that is not version aware. The underlying cause is Apple's decision to not support any OpenGL compatibility profiles.

      This issue was first reported here https://bugreports.qt.io/browse/QTBUG-42107

       

      Possible Solution: Detect OpenGL core profile and version number in qt-fixes/qtdeclarative/src/quick/items/qquickopenglshadereffect.cpp and modify shader code to comply with GLSL 150 core before it is compiled on macOS.
      This solution would fix ALL QtGraphicalEffects and also any custom ShaderEffects which are written as inline QML strings.
      The existing +glslcore folder mechanism could also be used to provide compatible shader code, if a ShaderEffect is used with urls instead of inline shader strings.
      This is hover not a solution for all graphical effects because some are build from multiple strings and variables. 

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              srutledg Shawn Rutledge
              konfick Konstantin Fick
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes