From ada5e55b28869248cb4177aa765519e7722a4204 Mon Sep 17 00:00:00 2001 From: baldurk Date: Thu, 27 Jun 2019 10:18:43 +0100 Subject: [PATCH] Add some single-flush-validate code into D3D12 initial state preparation --- renderdoc/driver/d3d12/d3d12_initstate.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/renderdoc/driver/d3d12/d3d12_initstate.cpp b/renderdoc/driver/d3d12/d3d12_initstate.cpp index d1e02625c..f94e212db 100644 --- a/renderdoc/driver/d3d12/d3d12_initstate.cpp +++ b/renderdoc/driver/d3d12/d3d12_initstate.cpp @@ -157,6 +157,14 @@ bool D3D12ResourceManager::Prepare_InitialState(ID3D12DeviceChild *res) m_Device->Evict(1, &pageable); } + else + { +#if ENABLED(SINGLE_FLUSH_VALIDATE) + m_Device->CloseInitialStateList(); + m_Device->ExecuteLists(NULL, true); + m_Device->FlushLists(true); +#endif + } SetInitialContents(GetResID(r), D3D12InitialContents(copyDst)); return true; @@ -344,6 +352,14 @@ bool D3D12ResourceManager::Prepare_InitialState(ID3D12DeviceChild *res) if(nonresident) m_Device->Evict(1, &pageable); } + else + { +#if ENABLED(SINGLE_FLUSH_VALIDATE) + m_Device->CloseInitialStateList(); + m_Device->ExecuteLists(NULL, true); + m_Device->FlushLists(true); +#endif + } SAFE_RELEASE(arrayTexture); SAFE_DELETE_ARRAY(layouts);