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

QPaintedTextureImage crashes when doing update() calls in succession

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: P0: Blocker P0: Blocker
    • 5.11.0 RC 1
    • 5.11.0 Beta 4
    • Qt3D
    • None
    • 7f0bdc21a8f1a5fbe2afdba61f037a71f00c1d61

      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.

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes