From 06cff50453abcda2cadd0e485e6e4327704889c3 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Mon, 12 Mar 2018 23:36:55 +0100 Subject: [PATCH] [d3d11] Flush CS chunks when executing/finalizing command lists Fixes rendering issues and validation errors in Kingdom Come: Deliverance. --- src/d3d11/d3d11_context_def.cpp | 4 ++++ src/d3d11/d3d11_context_imm.cpp | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/d3d11/d3d11_context_def.cpp b/src/d3d11/d3d11_context_def.cpp index 092063280..426167f5b 100644 --- a/src/d3d11/d3d11_context_def.cpp +++ b/src/d3d11/d3d11_context_def.cpp @@ -31,6 +31,8 @@ namespace dxvk { void STDMETHODCALLTYPE D3D11DeferredContext::ExecuteCommandList( ID3D11CommandList* pCommandList, BOOL RestoreContextState) { + FlushCsChunk(); + static_cast(pCommandList)->EmitToCommandList(m_commandList.ptr()); if (RestoreContextState) @@ -43,6 +45,8 @@ namespace dxvk { HRESULT STDMETHODCALLTYPE D3D11DeferredContext::FinishCommandList( BOOL RestoreDeferredContextState, ID3D11CommandList **ppCommandList) { + FlushCsChunk(); + if (ppCommandList != nullptr) *ppCommandList = m_commandList.ref(); m_commandList = CreateCommandList(); diff --git a/src/d3d11/d3d11_context_imm.cpp b/src/d3d11/d3d11_context_imm.cpp index 1245fe074..4e86c98cf 100644 --- a/src/d3d11/d3d11_context_imm.cpp +++ b/src/d3d11/d3d11_context_imm.cpp @@ -66,6 +66,8 @@ namespace dxvk { void STDMETHODCALLTYPE D3D11ImmediateContext::ExecuteCommandList( ID3D11CommandList* pCommandList, BOOL RestoreContextState) { + FlushCsChunk(); + static_cast(pCommandList)->EmitToCsThread(&m_csThread); if (RestoreContextState)