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

QPaintedTextureImage crashes when doing update() calls in succession

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P0: Blocker
    • Resolution: Done
    • Affects Version/s: 5.11.0 Beta 4
    • Fix Version/s: 5.11.0 RC 1
    • Component/s: Qt3D
    • Labels:
      None
    • Commits:
      7f0bdc21a8f1a5fbe2afdba61f037a71f00c1d61

      Description

      Have a QPaintedTextureImage and do an update() from a QFrameAction. (very common in Qt 3D Studio, to update text field contents). This simply does not work due to gltexture.cpp asserting in getOrCreateGlTexture() when trying to retrieve the image data for an already released generator:

              for (const Image &img : qAsConst(m_images)) {
                  const QTextureImageDataPtr imgData = m_textureImageDataManager->getData(img.generator);
      
                  Q_ASSERT(imgData);
      

      a bit of logging clearly shows that the TextureImage backend node releases and registers the new generator:

              } else if (propertyChange->propertyName() == QByteArrayLiteral("dataGenerator")) {
                  // Release ref to generator
                  if (m_generator)
                      m_textureImageDataManager->releaseData(m_generator, peerId());
                  m_generator = propertyChange->value().value<QTextureImageDataGeneratorPtr>();
                  // Request functor upload
                  if (m_generator)
                      m_textureImageDataManager->requestData(m_generator, peerId());
              }
      

      however gltexture then tries to query with the old (just released) generator.

      Note that the key to reproduce is to do updates fast enough, i.e. at least two updates within three frames.

        Attachments

          Issue Links

          For Gerrit Dashboard: QTBUG-67989
          # Subject Branch Project Status CR V

            Activity

              People

              Assignee:
              seanharmer Sean Harmer
              Reporter:
              lagocs Laszlo Agocs
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes