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

Qt Quick batch rendering issue when a batch contain nodes that have different index types

    XMLWordPrintable

Details

    • macOS, Windows
    • f9e95c9d4 (dev), 374b98599 (6.4), 0cf71fb2c (6.5), 0933e62b2 (dev), 302a7530d (6.8), 280f289fa (6.7), 59743e96b (tqtc/lts-6.5), 9087f078c (dev), b645aaa9c (6.8), f17f174b9 (6.7), 344ec11f5 (tqtc/lts-6.5)

    Description

      When a batch contains nodes that have different index types, there is a rendering issue when the first node of the batch use QSGGeometry::UnsignedShortType: nodes that use QSGGeometry::UnsignedIntType are incorrectly rendered

       

      The attached project defines two custom QQuickItem, a triangle that uses unsigned short indexes and a circle that uses unsigned int indexes.

      • When the application is launched, everything is ok: circles are well rendered.
      • After pressing the button, the opaque circle is batched with an opaque triangle item (that uses unisgned short indexes) and is incorrectly rendered
      • After pressing the button again, the triangle disappears (visible: false) and the two circles are well rendered

       

      Renderer::uploadBatch (qsgbatchrenderer.cpp line 2009) assumes that all QSGGeometryNode nodes use the same index type (QSGGeometry::UnsignedShortType or QSGGeometry::UnsignedIntType) when it computes its canMerge flag

      Renderer::prepareOpaqueBatches (qsgbatchrenderer.cpp line 1692) does not check if QSGGeometryNode nodes use the same index type

       

      Steps to reproduce:

      1. Please run the attached example
      2. Click on the button

      Attachments

        1. BatchingUploadBug.zip
          6 kB
          Alexandre Lemort
        2. Capture d’écran 2021-10-14 à 10.33.03.png
          152 kB
          Alexandre Lemort
        3. Capture d’écran 2021-10-14 à 10.50.51.png
          158 kB
          Alexandre Lemort
        4. Capture d’écran 2021-10-15 à 10.30.55.png
          34 kB
          Alexandre Lemort
        5. Capture d’écran 2021-10-15 à 10.31.04.png
          30 kB
          Alexandre Lemort

        Issue Links

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

          Activity

            People

              janichol Andy Nichols
              lemortalexandre Alexandre Lemort
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: