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

RHI: QQuickWindow::createFromImage and/or QSGSimpleTextureNode doesn't work

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P2: Important
    • None
    • 5.15
    • Qt RHI
    • None
    • Linux/Wayland, Linux/X11

    Description

      Minimal example project attached. With the old backend, it shows a green rectangle, with rhi it is blank.

      Relevant part of the example:

      QSGNode *TestItem::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data)
      {
          auto *node = static_cast<QSGSimpleTextureNode *>(oldNode);
          if (!node) {
              node = new QSGSimpleTextureNode();
      
              QImage image(QSize(100, 100), QImage::Format_ARGB32);
              image.fill(Qt::GlobalColor::green);
              QSGTexture *texture = window()->createTextureFromImage(image);
              if (texture)
                  texture->bind();
      
              node->setTexture(texture);
              node->setRect(QRect(0,0,100,100));
              node->setSourceRect(QRect(0,0,100,100));
          }
          return node;
      }
      

      Ran with:

      env QSG_RHI=1 QSG_RHI_BACKEND=gl ./sgtex
      

      Attachments

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

        Activity

          People

            johanhelsing Johan Helsing
            johanhelsing Johan Helsing
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes