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

QML Canvas rendering hang with renderTarget Canvas.Image

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.6.0
    • None
    • Windows

    Description

      Using QML Canvas of QT 5.15.2, performances are pretty good according our needs if we set the renderTarget to Canvas.FramebufferObject as it takes advantage of OpenGL graphic acceleration.
      Now we plan to port our application to QT 6.6.0 and the documentation mention :
      "As of Qt 6.0, Canvas.FramebufferObject value is ignored".
      As a consequence, Canvas.Image is the only choice.

      The result with Qt 6, is a unusable Canvas component as it lag during the rendering process and fps count is very low even with small sample count.
      The attached files can reproduce the problem with a simple QML Canvas graph example.
      sampleCount :     100 , 1000 , 10000
      QT 5.15.2  fps         60,   60 ,     60
      QT 6.6.0   fps         10,     1 ,     < 1 with first rendering > 10 s

      If we use QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL ); in main.cpp
      with QSG_INFO we get this information about OpenGL activation :
      qt.scenegraph.general: Creating QRhi with backend OpenGL for window 0x24e263d2dc0 (wflags 0x1).
      However, looking at the GPU activity, the openGL layer is not used, probably due to the Canvas.Image render target.

      With QSG_RENDER_TIMING=1 we get the render loop info :
      qt.scenegraph.time.renderloop: [window 0x1f60dd70310][gui thread] polishAndSync: start, elapsed since last call: 17188 ms (also visible with QML profiler)

      As a conclusion, we wonder why since QT 6, OpenGL accelerated graphic layer is no more available for Canvas while it is using QSceneGraph as a Quick component.

      Is there any reason to such lag in the render loop steps (synch issue) ?
      Is there any way to enable use of OpenGL using Canvas component with Qt 6 ?

      Thanks in advance for your response.

      Attachments

        1. Canvas-Graph.pro
          0.7 kB
          ROUAULT GUY
        2. main.cpp
          0.8 kB
          ROUAULT GUY
        3. main.qml
          2 kB
          ROUAULT GUY
        4. qml.qrc
          0.1 kB
          ROUAULT GUY

        Issue Links

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

          Activity

            People

              lagocs Laszlo Agocs
              mani ROUAULT GUY
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes