From 09948a3495c6a389fdd5ef87369b78bee72eef7d Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Sat, 1 Sep 2018 21:25:39 +0200 Subject: [PATCH] [d3d11] Synchronize CS thread after flush when waiting for resource In some rare cases, the flush operation itself may add new references which we need to see while spinning on the resource's usage counter. --- src/d3d11/d3d11_context_imm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index 62daa9b6..304b9ab1 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -520,7 +520,6 @@ namespace dxvk { // Wait for the any pending D3D11 command to be executed // on the CS thread so that we can determine whether the // resource is currently in use or not. - FlushCsChunk(); SynchronizeCsThread(); if (Resource->isInUse()) { @@ -534,6 +533,7 @@ namespace dxvk { // Make sure pending commands using the resource get // executed on the the GPU if we have to wait for it Flush(); + SynchronizeCsThread(); while (Resource->isInUse()) dxvk::this_thread::yield();