Skip to content

Commit

Permalink
Make sure deferred dirty marks don't get lost while not capturing
Browse files Browse the repository at this point in the history
  • Loading branch information
baldurk committed Sep 13, 2016
1 parent c10c487 commit 8213a99
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
6 changes: 6 additions & 0 deletions renderdoc/driver/d3d11/d3d11_context_wrap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.",
Expand Down
7 changes: 6 additions & 1 deletion renderdoc/driver/d3d11/d3d11_resources.h
Original file line number Diff line number Diff line change
Expand Up @@ -1262,12 +1262,17 @@ class WrappedID3D11CommandList : public WrappedDeviceChild11<ID3D11CommandList>

WrappedID3D11DeviceContext *GetContext() { return m_pContext; }
bool IsCaptured() { return m_Successful; }
void SetDirtyResources(set<ResourceId> dirty) { m_Dirty.swap(dirty); }
void SetDirtyResources(set<ResourceId> &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<ResourceId> &missingTracks)
{
for(auto it = m_Dirty.begin(); it != m_Dirty.end(); ++it)
missingTracks.insert(*it);
}

//////////////////////////////
// implement ID3D11CommandList
Expand Down

0 comments on commit 8213a99

Please sign in to comment.