From 1c4dbd14ae2f335f6148b1355f88d75c1a79cc35 Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Fri, 23 Jun 2023 13:30:49 +0200 Subject: [PATCH] rhi: d3d12: Fix more than one window with the same QRhi This is what maps to the Vulkan and Metal backend. Taking the frame slot from the other swapchain was a mistake. It should use the frame slot from the current swapchain. Pick-to: 6.6 Fixes: QTBUG-114826 Change-Id: I1585088ce9a963f1710168d3ebc0d2e5f1e9ab21 Reviewed-by: Andy Nichols --- src/gui/rhi/qrhid3d12.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/rhi/qrhid3d12.cpp b/src/gui/rhi/qrhid3d12.cpp index c1d25cecd1..df67399400 100644 --- a/src/gui/rhi/qrhid3d12.cpp +++ b/src/gui/rhi/qrhid3d12.cpp @@ -1414,7 +1414,7 @@ QRhi::FrameOpResult QRhiD3D12::beginFrame(QRhiSwapChain *swapChain, QRhi::BeginF // be in flight anymore). With Qt Quick this situation cannot happen anyway // by design (one QRhi per window). for (QD3D12SwapChain *sc : std::as_const(swapchains)) - sc->waitCommandCompletionForFrameSlot(sc->currentFrameSlot); + sc->waitCommandCompletionForFrameSlot(currentFrameSlot); // note: swapChainD->currentFrameSlot, not sc's HRESULT hr = cmdAllocators[currentFrameSlot]->Reset(); if (FAILED(hr)) {