From 0a2fa590f5eee595dce8f799569cbc8df3457b7d Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Fri, 23 Mar 2018 11:54:19 +0100 Subject: [PATCH] [d3d11] Reset busy flag after emitting the Flush command Fixes a general performance regression in games that call WaitForResources a lot. --- src/d3d11/d3d11_context_imm.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index 0371f721..978b9679 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -49,9 +49,6 @@ namespace dxvk { m_parent->FlushInitContext(); if (m_csIsBusy || m_csChunk->commandCount() != 0) { - m_csIsBusy = false; - m_drawCount = 0; - // Add commands to flush the threaded // context, then flush the command list EmitCs([dev = m_device] (DxvkContext* ctx) { @@ -64,6 +61,10 @@ namespace dxvk { }); FlushCsChunk(); + + // Reset optimization info + m_drawCount = 0; + m_csIsBusy = false; } }