summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2024-02-06 10:16:27 +0100
committerLaszlo Agocs <laszlo.agocs@qt.io>2024-02-22 13:57:33 +0100
commitcff5a49cc20c3c9d98a5f97cd702a378ae29611b (patch)
tree1111053164422e4ec4d3c6a1c8ad3e7bf6222d8d
parent7bbd39c4c9f345ae48781a212a6544e72757fd3e (diff)
rhi: d3d11: Flush() when destroying a swapchain
Task-number: QTBUG-120276 Pick-to: 6.7 6.6 6.5 Change-Id: Iaf79c4dcf60d9a52bd562fd94976402cf570147d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
-rw-r--r--src/gui/rhi/qrhid3d11.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/rhi/qrhid3d11.cpp b/src/gui/rhi/qrhid3d11.cpp
index d10303316c..35a115e5aa 100644
--- a/src/gui/rhi/qrhid3d11.cpp
+++ b/src/gui/rhi/qrhid3d11.cpp
@@ -4903,8 +4903,12 @@ void QD3D11SwapChain::destroy()
}
QRHI_RES_RHI(QRhiD3D11);
- if (rhiD)
+ if (rhiD) {
rhiD->unregisterResource(this);
+ // See Deferred Destruction Issues with Flip Presentation Swap Chains in
+ // https://learn.microsoft.com/en-us/windows/win32/api/d3d11/nf-d3d11-id3d11devicecontext-flush
+ rhiD->context->Flush();
+ }
}
QRhiCommandBuffer *QD3D11SwapChain::currentFrameCommandBuffer()