diff --git a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp index 0ba9ca8ac0..9c3ce333a0 100644 --- a/renderdoc/driver/d3d11/d3d11_context_wrap.cpp +++ b/renderdoc/driver/d3d11/d3d11_context_wrap.cpp @@ -4852,6 +4852,9 @@ void WrappedID3D11DeviceContext::ExecuteCommandList(ID3D11CommandList *pCommandL cmdListRecord->AddResourceReferences(m_pDevice->GetResourceManager()); } + // still update dirty resources for subsequent captures + wrapped->MarkDirtyResources(m_MissingTracks); + if(RestoreContextState) { // insert a chunk to let us know on replay that we finished the command list's @@ -5164,6 +5167,9 @@ HRESULT WrappedID3D11DeviceContext::FinishCommandList(BOOL RestoreDeferredContex // we pick up on that. m_EmptyCommandList = true; + // still need to propagate up dirty resources to the immediate context + wrapped->SetDirtyResources(m_DeferredDirty); + RDCDEBUG( "Deferred Context %llu not capturing at the moment, Produced unsuccessful command list " "%llu.", diff --git a/renderdoc/driver/d3d11/d3d11_resources.h b/renderdoc/driver/d3d11/d3d11_resources.h index a12bb15de0..f201d5d9b6 100644 --- a/renderdoc/driver/d3d11/d3d11_resources.h +++ b/renderdoc/driver/d3d11/d3d11_resources.h @@ -1262,12 +1262,17 @@ class WrappedID3D11CommandList : public WrappedDeviceChild11 WrappedID3D11DeviceContext *GetContext() { return m_pContext; } bool IsCaptured() { return m_Successful; } - void SetDirtyResources(set dirty) { m_Dirty.swap(dirty); } + void SetDirtyResources(set &dirty) { m_Dirty.swap(dirty); } void MarkDirtyResources(D3D11ResourceManager *manager) { for(auto it = m_Dirty.begin(); it != m_Dirty.end(); ++it) manager->MarkDirtyResource(*it); } + void MarkDirtyResources(set &missingTracks) + { + for(auto it = m_Dirty.begin(); it != m_Dirty.end(); ++it) + missingTracks.insert(*it); + } ////////////////////////////// // implement ID3D11CommandList