Implements what's described in https://learn.microsoft.com/en-us/windows/uwp/gaming/reduce-latency-with-dxgi-1-3-swap-chains By default SetMaximumFrameLatency is called with a value of 2, since we do not want to force 1 on everyone as some application may have more GPU heavy 2D/3D scenes. Use QT_D3D_MAX_FRAME_LATENCY to override. Setting to 0 disables the whole thing. This patch contains no C++ API (could be in the backend-specific init params), because it is not clear if it is reasonable to expect applications to control such details of the presentation mechanism. This also allows cherry picking to earlier branches. The result is that, for example, the visible lag between the mouse cursor and the dragged item will get reduced in Qt Quick scenes that have a mouse draggable item in them. This comes at the expense of potentially reducing CPU-GPU parallelism, but many scenes do not need that kind of performance to begin with. One big gain here is that with a MaximumFrameLatency of 2 the behavior becomes closer, and basically identical, to what one gets when running with OpenGL (where Qt has no control whatsoever over such presentation details), and so the behavior becomes closer out of the box with Qt 6 to what one got with Qt 5. This is true at least with NVIDIA graphics on Windows 11; note that it may not apply to other vendors' GL implementations. The QRhi doc update just brings in what's been true for some time in Qt 6: as IDXGIFactory2 is required, the minimum required DXGI version is in fact 1.3 and so D3D 11.2. (which is Windows 8.1 stuff so should be fine) [ChangeLog][RHI] The D3D11 backend creates swapchains from now on with DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT by default, with a max frame latency of 2. Task-number: QTBUG-127267 Change-Id: I74f68f7af41097b957b8e0bbdbae39f9302b1ad3 Reviewed-by: Andy Nichols <andy.nichols@qt.io> (cherry picked from commit 02bf4d06b2432d95df9a1f6c9ad072b953b06cda) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%