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

Invalid shaders created when glProgramBinary fails

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Duplicate
    • Affects Version/s: 5.10.0, 5.9.4
    • Fix Version/s: None
    • Component/s: GUI: OpenGL
    • Labels:
      None

      Description

      The `QOpenGLShaderProgram` class in Qt can be used to compile and link OpenGL shaders. If the `GL_ARB_get_program_binary` OpenGL extension is available, it can cache those shaders on disk (~/.cache/qtshadercache). The i965 driver in Mesa supports this extension since version 18.0.0.

      When the shader is loaded using the `glProgramBinary` function, OpenGL can refuse it if for example some hardware or software component changed. Mesa refuses binaries that were created by any other build of Mesa (using among other things the build_id of the library).

      If the shader is refused, Qt should fallback to compiling it from sources, but it incorrectly calls glLinkProgram first. The glLinkProgram succeeds, because it actually links 0 shaders together. That is allowed in OpenGL compatibility profile and the resulting program works as a fixed pipeline. Which of course does not render as expected.

      This causes rendering errors in Qt applications every time Mesa is updated since version 18.0.0. For example white screen in sddm.

      This issue was originally reported in openSUSE (https://bugzilla.opensuse.org/show_bug.cgi?id=1080578).

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              sletta Gunnar Sletta
              Reporter:
              lbeltrame Luca Beltrame
              Votes:
              2 Vote for this issue
              Watchers:
              11 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes