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

Extra copy of backing store image when flushing a small region in rhiFlush

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.5.3
    • Qt RHI
    • None

    Description

      Please use this code to reproduce. This simulate updating a small icon when there is a webengine sibling. The dirty region is 16x16 but detatch() copies the whole backing store image.
      Qt6.2 is 0-copy. The pixels from the backing store image is sent to glTexSubImage2D directly. Qt6.5 copies the image twice. (detatch() here, copy full image; and enqueueSubresUpload() if gles2 rhi, copy sub image). It would be ideal if Qt6.5 is as fast as Qt6.2 (no copy of backing store image).

      #include <QtCore/QTimer>
      #include <QtWidgets/QApplication>
      #include <QtWidgets/QWidget>
      #include <QtQuick/QQuickWindow>
      #include <QtOpenGLWidgets/QOpenGLWidget>
      
      
      int main(int argc, char** argv)
      {
      	QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL); // or d3d11/metal/etc...
      	QApplication app(argc, argv);
      
      	// tlw: red.
      	QWidget tlw;
      	tlw.resize(1920, 1080);
      	tlw.setStyleSheet("QWidget { background-color: red; }");
      
      	// turn tlw into rhi flush. e.g. webengine
      	QOpenGLWidget gl(&tlw);
      	gl.setGeometry(0, 0, 1, 1);
      
          // loop forever to profile performance when updating a small region.
      	QTimer repeat;
      	QObject::connect(&repeat, &QTimer::timeout, [&]() {
      		// simulate repeat update to a small icon.
      		tlw.repaint(200, 200, 16, 16);
          });
      	repeat.setInterval(1);
      	repeat.start();
      
      	tlw.show();
      	return app.exec();
      }
      

      Attachments

        1. hotspot.jpg
          206 kB
          Mingxiang Xu
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            lagocs Laszlo Agocs
            mingxiang Mingxiang Xu
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes