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

QSGBatchRenderer: Inefficient batch allocation on i.MX 8M Plus

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.4
    • None
    • i.MX 8M Plus with Vivante GC7000UL running Wayland/Weston, wayland-egl backend, Vivante EGL drivers
      2 GB RAM
      Display: 1280x720 LVDS
    • Linux/Wayland

    Description

       

      We have observed a performance regression from Qt5 to Qt 6 running the following example on i.MX 8M Plus with Vivante GC7000UL.

       

      // Omit the version numbers for Qt6, otherwise use the same code
      import QtQuick 2.15
      import QtQuick.Window 2.15
      import QtQuick.Layouts 1.15
      Window {
          id: window
          width: 720
          height: 1280
          visible: true
          Flickable {
              z: 100
              anchors.fill: parent
              contentWidth: layout.width
              contentHeight: layout.implicitHeight
              flickableDirection: Flickable.VerticalFlick
              ColumnLayout {
                  id: layout
                  opacity: 0.5
                  width: parent.width
                  anchors.top: parent.top
                  anchors.left: parent.left
                  spacing: 10
                  Repeater {
                      model: 2500
                      Rectangle {
                          height: 70
                          width: window.width
                          color: "#555"
                          Text {
                              anchors.centerIn: parent
                              text: model.index
                              color: "#fff"
                              font.pixelSize: 15
                          }
                      }
                  }
              }
          }
      }
      

       

      Running the code on Qt5 yields good performance up to 12500 Repeater child elements. 
      Qt6 however starts lagging already with about 1000 Repeater child nodes.

      I am aware of the existence of ListView with its virtualized nodes, but this is not the point. As proven by Qt5, it is obviously possible to efficiently handle 10000 nodes. So Qt6 should also support this.

      When setting QSG_RENDERER_DEBUG=render, we can observe the following issue (output for Qt6):

       

      -> Opaque: 0 nodes in 0 batches...
      -> Alpha: 5000 nodes in 2501 batches...
      - 0xffff5cbf2d60 [ upload] [noclip] [ alpha] [ merged] Nodes: 2500 Vertices: 10000 Indices: 15000 root: 0x0 opacity: 0.5
      - 0xffff5cb62d70 [ upload] [noclip] [ alpha] [ merged] Nodes: 1 Vertices: 4 Indices: 6 root: 0x0 opacity: 0.5
      - 0xffff5cc0bd00 [ upload] [noclip] [ alpha] [ merged] Nodes: 1 Vertices: 4 Indices: 6 root: 0x0 opacity: 0.5
      - 0xffff5cb62750 [ upload] [noclip] [ alpha] [ merged] Nodes: 1 Vertices: 4 Indices: 6 root: 0x0 opacity: 0.5
      
      [last line repeated 2500 times]

       

      Whereas on Qt5, it only prints:

      -> Alpha: 5000 nodes in 2 batches...
      - 0xffff607dea00 [ upload] [ clip] [ alpha] [ merged] Nodes: 2500 Vertices: 10000 Indices: 15000 root: 0xffff60035488 opacity: 0.5
      - 0xffff607deaf0 [ upload] [ clip] [ alpha] [ merged] Nodes: 2500 Vertices: 35560 Indices: 53340 root: 0xffff60035488 opacity: 0.5

       

      This shows that Qt6 is creating rendering batches less efficiently.

      The earliest version I could reproduce the bug with is Qt 5.15.5 (when setting QSG_RHI=1). There, the critical change was introduced in qsgbatchrenderer.cpp, method checkOverlap:

      where

       if (!e)

      was replaced by

       if (!e || e->batch)

      Undoing this change made the GUI run smoothly again, however in Qt6 this did not help (the change is already guarded away by the undefined macro QSGBATCHRENDERER_INVALIDATE_WEDGED_NODES)

       

       

      Attachments

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

        Activity

          People

            janichol Andy Nichols
            hjlre Jakob Huber
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes