Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Qt 6.4 windows movement/resizing behavior on DirectX
QtWS25 Last Chance

Qt 6.4 windows movement/resizing behavior on DirectX

Scheduled Pinned Locked Moved Unsolved General and Desktop
qt 6direct3d11directxwindowsresizing
7 Posts 2 Posters 3.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AlexMax
    wrote on 30 Mar 2023, 13:44 last edited by
    #1

    Hi,
    We've started migrating our QtQuick/QML-based application from Qt 5.15.2 to QT 6.4, but in the process we noticed a significant performance downgrade, on Windows, when the app is using Qt6:
    - if the selected graphics api is DirectX (the default option), the application's windows(QQuickViews) movement and resizing are jerky/stuttering.
    - memory usage is higher

    This movement/resizing behavior is reproducible also on simple QT example apps, like
    ..\Examples\Qt-6.4.0\quickcontrols2\texteditor
    ..\Examples\Qt-6.4.0\demos\clocks

    When forcing the app to use OpenGL, using QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi), everything works smooth, as expected.

    Is there anything that can be done to improve performance on DirectX? Am I missing something?

    System Information

    Operating System: Windows 10 Enterprise 64-bit (10.0, Build 19043) (19041.vb_release.191206-1406)
    System Manufacturer: LENOVO
    System Model: 21AAS0T500
    Processor: 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 CPUs), ~2.5GHz
    Memory: 32768MB RAM
    Available OS Memory: 32472MB RAM
    DirectX Version: DirectX 12

    Display Devices

    Card name: Intel(R) UHD Graphics
    Manufacturer: Intel Corporation
    Chip type: Intel(R) UHD Graphics Family
    Display Memory: 16363 MB
    Dedicated Memory: 128 MB
    Shared Memory: 16235 MB
    Driver File Version: 31.00.0101.3358 (English)
    Driver Version: 31.0.101.3358
    Detachable GPU: No
    Hybrid Graphics GPU: Integrated
    Device Identifier: {D7B78E66-D920-11CF-0479-BC02AEC2D235}
    Vendor ID: 0x8086
    Device ID: 0x9A60

    Card name: NVIDIA T600 Laptop GPU
    Manufacturer: NVIDIA
    Chip type: NVIDIA T600 Laptop GPU
    Display Memory: 20200 MB
    Dedicated Memory: 3965 MB
    Shared Memory: 16235 MB
    Driver File Version: 31.00.0015.1766 (English)
    Driver Version: 31.0.15.1766
    Detachable GPU: No
    Hybrid Graphics GPU: Discrete
    Device Identifier: Unknown
    Vendor ID: 0x10DE
    Device ID: 0x1FBA

    Scene graph information via the QSG_INFO environment variable

    Qt 6.4.0 MSVC2019 64bit

    qt.scenegraph.general: Using QRhi with backend D3D11
    Graphics API debug/validation layers: 0
    QRhi profiling and debug markers: 0
    Shader/pipeline cache collection: 0
    qt.scenegraph.general: threaded render loop
    qt.scenegraph.general: Using sg animation driver
    qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
    qt.scenegraph.general: Using sg animation driver
    qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
    qt.rhi.general: FLIP_* swapchain supported = true, ALLOW_TEARING supported = true
    qt.rhi.general: Default swap effect: FLIP_SEQUENTIAL
    qt.rhi.general: Adapter 0: 'Intel(R) UHD Graphics' (vendor 0x8086 device 0x9A60 flags 0x0)
    qt.rhi.general: using this adapter
    qt.rhi.general: Adapter 1: 'NVIDIA T600 Laptop GPU' (vendor 0x10DE device 0x1FBA flags 0x0)
    qt.rhi.general: Adapter 2: 'Microsoft Basic Render Driver' (vendor 0x1414 device 0x8C flags 0x2)
    qt.scenegraph.general: MSAA sample count for the swapchain is 1. Alpha channel requested = no.
    qt.scenegraph.general: rhi texture atlas dimensions: 1024x1024

    A 1 Reply Last reply 30 Mar 2023, 14:45
    0
    • A AlexMax
      30 Mar 2023, 13:44

      Hi,
      We've started migrating our QtQuick/QML-based application from Qt 5.15.2 to QT 6.4, but in the process we noticed a significant performance downgrade, on Windows, when the app is using Qt6:
      - if the selected graphics api is DirectX (the default option), the application's windows(QQuickViews) movement and resizing are jerky/stuttering.
      - memory usage is higher

      This movement/resizing behavior is reproducible also on simple QT example apps, like
      ..\Examples\Qt-6.4.0\quickcontrols2\texteditor
      ..\Examples\Qt-6.4.0\demos\clocks

      When forcing the app to use OpenGL, using QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGLRhi), everything works smooth, as expected.

      Is there anything that can be done to improve performance on DirectX? Am I missing something?

      System Information

      Operating System: Windows 10 Enterprise 64-bit (10.0, Build 19043) (19041.vb_release.191206-1406)
      System Manufacturer: LENOVO
      System Model: 21AAS0T500
      Processor: 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 CPUs), ~2.5GHz
      Memory: 32768MB RAM
      Available OS Memory: 32472MB RAM
      DirectX Version: DirectX 12

      Display Devices

      Card name: Intel(R) UHD Graphics
      Manufacturer: Intel Corporation
      Chip type: Intel(R) UHD Graphics Family
      Display Memory: 16363 MB
      Dedicated Memory: 128 MB
      Shared Memory: 16235 MB
      Driver File Version: 31.00.0101.3358 (English)
      Driver Version: 31.0.101.3358
      Detachable GPU: No
      Hybrid Graphics GPU: Integrated
      Device Identifier: {D7B78E66-D920-11CF-0479-BC02AEC2D235}
      Vendor ID: 0x8086
      Device ID: 0x9A60

      Card name: NVIDIA T600 Laptop GPU
      Manufacturer: NVIDIA
      Chip type: NVIDIA T600 Laptop GPU
      Display Memory: 20200 MB
      Dedicated Memory: 3965 MB
      Shared Memory: 16235 MB
      Driver File Version: 31.00.0015.1766 (English)
      Driver Version: 31.0.15.1766
      Detachable GPU: No
      Hybrid Graphics GPU: Discrete
      Device Identifier: Unknown
      Vendor ID: 0x10DE
      Device ID: 0x1FBA

      Scene graph information via the QSG_INFO environment variable

      Qt 6.4.0 MSVC2019 64bit

      qt.scenegraph.general: Using QRhi with backend D3D11
      Graphics API debug/validation layers: 0
      QRhi profiling and debug markers: 0
      Shader/pipeline cache collection: 0
      qt.scenegraph.general: threaded render loop
      qt.scenegraph.general: Using sg animation driver
      qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
      qt.scenegraph.general: Using sg animation driver
      qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
      qt.rhi.general: FLIP_* swapchain supported = true, ALLOW_TEARING supported = true
      qt.rhi.general: Default swap effect: FLIP_SEQUENTIAL
      qt.rhi.general: Adapter 0: 'Intel(R) UHD Graphics' (vendor 0x8086 device 0x9A60 flags 0x0)
      qt.rhi.general: using this adapter
      qt.rhi.general: Adapter 1: 'NVIDIA T600 Laptop GPU' (vendor 0x10DE device 0x1FBA flags 0x0)
      qt.rhi.general: Adapter 2: 'Microsoft Basic Render Driver' (vendor 0x1414 device 0x8C flags 0x2)
      qt.scenegraph.general: MSAA sample count for the swapchain is 1. Alpha channel requested = no.
      qt.scenegraph.general: rhi texture atlas dimensions: 1024x1024

      A Offline
      A Offline
      Asperamanca
      wrote on 30 Mar 2023, 14:45 last edited by
      #2

      @AlexMax Is this a pure QML application (based on QQuickView) or a Widget application with QQuickWidget?

      In general,

      1. See if there are driver updates
      2. You can choose to use the nVidia card, e.g. through Windows "Graphics Settings" -> "Graphics performance preference" by application
      A 1 Reply Last reply 30 Mar 2023, 15:11
      0
      • A Asperamanca
        30 Mar 2023, 14:45

        @AlexMax Is this a pure QML application (based on QQuickView) or a Widget application with QQuickWidget?

        In general,

        1. See if there are driver updates
        2. You can choose to use the nVidia card, e.g. through Windows "Graphics Settings" -> "Graphics performance preference" by application
        A Offline
        A Offline
        AlexMax
        wrote on 30 Mar 2023, 15:11 last edited by
        #3

        @Asperamanca Our app doesn't use QQuickWidgets, main app windows are QQuickViews loading qml content.
        The behavior was noticed also on simple QML sample apps that are provided with the QT 6.4 SDK.

        Re. 1. the drivers are up to date; the problem reproduces also on other hardware configurations
        Re. 2. we used QT_D3D_ADAPTER_INDEX env var to force the app to use nVidia adaptor, but nothing changed.

        Thanks.

        A 1 Reply Last reply 31 Mar 2023, 06:25
        0
        • A AlexMax
          30 Mar 2023, 15:11

          @Asperamanca Our app doesn't use QQuickWidgets, main app windows are QQuickViews loading qml content.
          The behavior was noticed also on simple QML sample apps that are provided with the QT 6.4 SDK.

          Re. 1. the drivers are up to date; the problem reproduces also on other hardware configurations
          Re. 2. we used QT_D3D_ADAPTER_INDEX env var to force the app to use nVidia adaptor, but nothing changed.

          Thanks.

          A Offline
          A Offline
          Asperamanca
          wrote on 31 Mar 2023, 06:25 last edited by
          #4

          @AlexMax said in Qt 6.4 windows movement/resizing behavior on DirectX:

          we used QT_D3D_ADAPTER_INDEX env var to force the app to use nVidia adaptor, but nothing changed

          And the qt.rhi.general output confirmed it was used?

          In general, Qt5 used OpenGL, so setting that is probably closest to previous behavior. I have also experienced flickering with Direct3D on occasion, but haven't found the causes of it.

          A 1 Reply Last reply 31 Mar 2023, 07:26
          0
          • A Asperamanca
            31 Mar 2023, 06:25

            @AlexMax said in Qt 6.4 windows movement/resizing behavior on DirectX:

            we used QT_D3D_ADAPTER_INDEX env var to force the app to use nVidia adaptor, but nothing changed

            And the qt.rhi.general output confirmed it was used?

            In general, Qt5 used OpenGL, so setting that is probably closest to previous behavior. I have also experienced flickering with Direct3D on occasion, but haven't found the causes of it.

            A Offline
            A Offline
            AlexMax
            wrote on 31 Mar 2023, 07:26 last edited by
            #5

            @Asperamanca said in Qt 6.4 windows movement/resizing behavior on DirectX:

            And the qt.rhi.general output confirmed it was used?

            Yes.

            Using ..\Examples\Qt-6.4.0\demos\clocks app, for instance, the main looks like this:

            int main(int argc, char *argv[])
            {
                qputenv("QSG_INFO", "1");
                //qputenv("QT_D3D_ADAPTER_INDEX", "1");
            
                QCoreApplication::setOrganizationName("QtExamples");
            
                QGuiApplication app(argc, argv);
            
                //QQuickWindow::setGraphicsApi(QSGRendererInterface::Direct3D11);
                //QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
                qDebug() << "Current Graphics API =" << QQuickWindow::graphicsApi();
            
                QQuickView view;
                view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit);
                view.setSource(QUrl("qrc:/demos/clocks/clocks.qml"));
                if (view.status() == QQuickView::Error)
                    return -1;
                view.setResizeMode(QQuickView::SizeRootObjectToView);
                view.show();
                return app.exec();
            }
            

            Using Qt 6.4.0 MSVC2019 64bit
            Build configuration: Release

            qt.rhi.general output looks like this:

            09:51:10: Starting C:/Qt/Qt6.4/Examples/Qt-6.4.0/demos/build-clocks-Desktop_Qt_6_4_0_MSVC2019_64bit-Release/clocks.exe...
            qt.scenegraph.general: Using QRhi with backend D3D11
            Graphics API debug/validation layers: 0
            QRhi profiling and debug markers: 0
            Shader/pipeline cache collection: 0
            Current Graphics API = 4
            qt.scenegraph.general: threaded render loop
            qt.scenegraph.general: Using sg animation driver
            qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
            qt.scenegraph.general: Using sg animation driver
            qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
            qt.rhi.general: FLIP_
            swapchain supported = true, ALLOW_TEARING supported = true
            qt.rhi.general: Default swap effect: FLIP_SEQUENTIAL
            qt.rhi.general: Adapter 0: 'Intel(R) UHD Graphics' (vendor 0x8086 device 0x9A60 flags 0x0)
            qt.rhi.general: using this adapter
            qt.rhi.general: Adapter 1: 'NVIDIA T600 Laptop GPU' (vendor 0x10DE device 0x1FBA flags 0x0)
            qt.rhi.general: Adapter 2: 'Microsoft Basic Render Driver' (vendor 0x1414 device 0x8C flags 0x2)
            qt.scenegraph.general: MSAA sample count for the swapchain is 1. Alpha channel requested = no.
            qt.scenegraph.general: rhi texture atlas dimensions: 1024x512
            qt.scenegraph.general: animation driver switched to timer mode
            qt.scenegraph.general: Using sg animation driver
            qt.scenegraph.general: animation driver switched to vsync mode
            qt.scenegraph.general: animation driver switched to timer mode
            qt.scenegraph.general: Using sg animation driver
            qt.scenegraph.general: animation driver switched to vsync mode
            qt.scenegraph.general: animation driver switched to timer mode
            qt.scenegraph.general: Using sg animation driver
            qt.scenegraph.general: animation driver switched to vsync mode*

            If I uncomment this line:

            //qputenv("QT_D3D_ADAPTER_INDEX", "1");
            

            the output is this:

            Starting C:/Qt/Qt6.4/Examples/Qt-6.4.0/demos/build-clocks-Desktop_Qt_6_4_0_MSVC2019_64bit-Release/clocks.exe...
            qt.scenegraph.general: Using QRhi with backend D3D11
            Graphics API debug/validation layers: 0
            QRhi profiling and debug markers: 0
            Shader/pipeline cache collection: 0
            Current Graphics API = 4
            qt.scenegraph.general: threaded render loop
            qt.scenegraph.general: Using sg animation driver
            qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
            qt.scenegraph.general: Using sg animation driver
            qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
            qt.rhi.general: FLIP_
            swapchain supported = true, ALLOW_TEARING supported = true
            qt.rhi.general: Default swap effect: FLIP_SEQUENTIAL
            qt.rhi.general: Adapter 0: 'Intel(R) UHD Graphics' (vendor 0x8086 device 0x9A60 flags 0x0)
            qt.rhi.general: Adapter 1: 'NVIDIA T600 Laptop GPU' (vendor 0x10DE device 0x1FBA flags 0x0)
            qt.rhi.general: using this adapter
            qt.rhi.general: Adapter 2: 'Microsoft Basic Render Driver' (vendor 0x1414 device 0x8C flags 0x2)
            qt.scenegraph.general: MSAA sample count for the swapchain is 1. Alpha channel requested = no.
            qt.scenegraph.general: rhi texture atlas dimensions: 1024x512
            qt.scenegraph.general: animation driver switched to timer mode
            qt.scenegraph.general: Using sg animation driver
            qt.scenegraph.general: animation driver switched to vsync mode
            qt.scenegraph.general: animation driver switched to timer mode
            qt.scenegraph.general: Using sg animation driver
            qt.scenegraph.general: animation driver switched to vsync mode*

            A 1 Reply Last reply 9 May 2023, 07:59
            0
            • A AlexMax
              31 Mar 2023, 07:26

              @Asperamanca said in Qt 6.4 windows movement/resizing behavior on DirectX:

              And the qt.rhi.general output confirmed it was used?

              Yes.

              Using ..\Examples\Qt-6.4.0\demos\clocks app, for instance, the main looks like this:

              int main(int argc, char *argv[])
              {
                  qputenv("QSG_INFO", "1");
                  //qputenv("QT_D3D_ADAPTER_INDEX", "1");
              
                  QCoreApplication::setOrganizationName("QtExamples");
              
                  QGuiApplication app(argc, argv);
              
                  //QQuickWindow::setGraphicsApi(QSGRendererInterface::Direct3D11);
                  //QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);
                  qDebug() << "Current Graphics API =" << QQuickWindow::graphicsApi();
              
                  QQuickView view;
                  view.connect(view.engine(), &QQmlEngine::quit, &app, &QCoreApplication::quit);
                  view.setSource(QUrl("qrc:/demos/clocks/clocks.qml"));
                  if (view.status() == QQuickView::Error)
                      return -1;
                  view.setResizeMode(QQuickView::SizeRootObjectToView);
                  view.show();
                  return app.exec();
              }
              

              Using Qt 6.4.0 MSVC2019 64bit
              Build configuration: Release

              qt.rhi.general output looks like this:

              09:51:10: Starting C:/Qt/Qt6.4/Examples/Qt-6.4.0/demos/build-clocks-Desktop_Qt_6_4_0_MSVC2019_64bit-Release/clocks.exe...
              qt.scenegraph.general: Using QRhi with backend D3D11
              Graphics API debug/validation layers: 0
              QRhi profiling and debug markers: 0
              Shader/pipeline cache collection: 0
              Current Graphics API = 4
              qt.scenegraph.general: threaded render loop
              qt.scenegraph.general: Using sg animation driver
              qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
              qt.scenegraph.general: Using sg animation driver
              qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
              qt.rhi.general: FLIP_
              swapchain supported = true, ALLOW_TEARING supported = true
              qt.rhi.general: Default swap effect: FLIP_SEQUENTIAL
              qt.rhi.general: Adapter 0: 'Intel(R) UHD Graphics' (vendor 0x8086 device 0x9A60 flags 0x0)
              qt.rhi.general: using this adapter
              qt.rhi.general: Adapter 1: 'NVIDIA T600 Laptop GPU' (vendor 0x10DE device 0x1FBA flags 0x0)
              qt.rhi.general: Adapter 2: 'Microsoft Basic Render Driver' (vendor 0x1414 device 0x8C flags 0x2)
              qt.scenegraph.general: MSAA sample count for the swapchain is 1. Alpha channel requested = no.
              qt.scenegraph.general: rhi texture atlas dimensions: 1024x512
              qt.scenegraph.general: animation driver switched to timer mode
              qt.scenegraph.general: Using sg animation driver
              qt.scenegraph.general: animation driver switched to vsync mode
              qt.scenegraph.general: animation driver switched to timer mode
              qt.scenegraph.general: Using sg animation driver
              qt.scenegraph.general: animation driver switched to vsync mode
              qt.scenegraph.general: animation driver switched to timer mode
              qt.scenegraph.general: Using sg animation driver
              qt.scenegraph.general: animation driver switched to vsync mode*

              If I uncomment this line:

              //qputenv("QT_D3D_ADAPTER_INDEX", "1");
              

              the output is this:

              Starting C:/Qt/Qt6.4/Examples/Qt-6.4.0/demos/build-clocks-Desktop_Qt_6_4_0_MSVC2019_64bit-Release/clocks.exe...
              qt.scenegraph.general: Using QRhi with backend D3D11
              Graphics API debug/validation layers: 0
              QRhi profiling and debug markers: 0
              Shader/pipeline cache collection: 0
              Current Graphics API = 4
              qt.scenegraph.general: threaded render loop
              qt.scenegraph.general: Using sg animation driver
              qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
              qt.scenegraph.general: Using sg animation driver
              qt.scenegraph.general: Animation Driver: using vsync: 16.67 ms
              qt.rhi.general: FLIP_
              swapchain supported = true, ALLOW_TEARING supported = true
              qt.rhi.general: Default swap effect: FLIP_SEQUENTIAL
              qt.rhi.general: Adapter 0: 'Intel(R) UHD Graphics' (vendor 0x8086 device 0x9A60 flags 0x0)
              qt.rhi.general: Adapter 1: 'NVIDIA T600 Laptop GPU' (vendor 0x10DE device 0x1FBA flags 0x0)
              qt.rhi.general: using this adapter
              qt.rhi.general: Adapter 2: 'Microsoft Basic Render Driver' (vendor 0x1414 device 0x8C flags 0x2)
              qt.scenegraph.general: MSAA sample count for the swapchain is 1. Alpha channel requested = no.
              qt.scenegraph.general: rhi texture atlas dimensions: 1024x512
              qt.scenegraph.general: animation driver switched to timer mode
              qt.scenegraph.general: Using sg animation driver
              qt.scenegraph.general: animation driver switched to vsync mode
              qt.scenegraph.general: animation driver switched to timer mode
              qt.scenegraph.general: Using sg animation driver
              qt.scenegraph.general: animation driver switched to vsync mode*

              A Offline
              A Offline
              AlexMax
              wrote on 9 May 2023, 07:59 last edited by
              #6

              Setting env var QT_D3D_NO_FLIP=1 (source:https://bugreports.qt.io/browse/QTBUG-99637) will fix the movement/resizing issues for Qt6.4.0. But this is a workaround, not a solution.
              I noticed QT_D3D_NO_FLIP was removed in Qt6.5 LTS and the issues are still present.
              Has anyone found a proper solution for this?

              A 1 Reply Last reply 9 May 2023, 08:12
              1
              • A AlexMax
                9 May 2023, 07:59

                Setting env var QT_D3D_NO_FLIP=1 (source:https://bugreports.qt.io/browse/QTBUG-99637) will fix the movement/resizing issues for Qt6.4.0. But this is a workaround, not a solution.
                I noticed QT_D3D_NO_FLIP was removed in Qt6.5 LTS and the issues are still present.
                Has anyone found a proper solution for this?

                A Offline
                A Offline
                Asperamanca
                wrote on 9 May 2023, 08:12 last edited by
                #7

                @AlexMax
                The issues is marked fixed in 6.3 and 6.4, so it it still persists in 6.5, that would probably warrant a new issue, linking to the old one. Or is it captured by linked and still-open https://bugreports.qt.io/browse/QTBUG-99602?

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved