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 <andy.nichols@qt.io>
bb10
Laszlo Agocs 2023-06-23 13:30:49 +02:00
parent 00f0384f79
commit 1c4dbd14ae
1 changed files with 1 additions and 1 deletions

View File

@ -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)) {