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

Rendering errors with ShaderEffect after hiding and reshowing a window

    XMLWordPrintable

Details

    • All
    • 44f6a797563c084a1eaa763e8e6f3ceaeb936bd4 (qt/tqtc-qtdeclarative/5.15)

    Description

      The core issue appears to be the cleanup done at https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/quick/scenegraph/qsgthreadedrenderloop.cpp?h=5.15.2#n554 – this
      cleanup is deleting material types when hiding that are subsequently being
      used when the window is reshown.

      The attached diff adds logging to qtdeclarative confirming the above. It will
      generate logs like:

      querying 0x7f97b0cdea80 type 0x7f97b0c9eb30
      deleting cached materials (0x7f97b0c9eb30)
      querying 0x7f97b0cdea80 type 0x7f97b0c9eb30

      You can see on the 3rd line that m_type still refers to a QSGMaterialType that
      has been deleted at the 2nd line.

      The attached example can be used to reproduce. Comments in the file
      describe the reproduction.

      Workaround can be to set the ShaderEffect vertex shader to empty and set it back when the Window is visible again:

      onVisibleChanged: {
              if(window.visible === true) {
                  effect2.fragmentShader = effect2.fragmentShaderString
              }
              else {
                  effect2.fragmentShader = ""
              }
          }
      

      Attachments

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

        Activity

          People

            lagocs Laszlo Agocs
            karimpinter Karim Pinter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes