Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.5.3
-
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(); }