After each command list execute, renumber child draws. Closes #62

This commit is contained in:
baldurk committed 2014-06-17 21:07:35 +01:00
1 parent cb67ae894a
commit 5b6f8e5e5c
3 files changed
+22

No files matched your search

+16
View File
@@ -900,6 +900,22 @@ void WrappedID3D11DeviceContext::AddUsage(FetchDrawcall d)
m_ResourceUses[((WrappedID3D11RenderTargetView *)pipe->OM.RenderTargets[i])->GetResourceResID()].push_back(EventUsage(e, eUsage_OM_RTV));
}
void WrappedID3D11DeviceContext::RefreshDrawcallIDs(DrawcallTreeNode &node)
{
if(GetType() == D3D11_DEVICE_CONTEXT_DEFERRED)
{
m_pDevice->GetImmediateContext()->RefreshDrawcallIDs(node);
return;
}
// assign new drawcall IDs
for(size_t i=0; i < node.children.size(); i++)
{
node.children[i].draw.drawcallID = m_CurDrawcallID++;
RefreshDrawcallIDs(node.children[i]);
}
}
void WrappedID3D11DeviceContext::AddDrawcall(FetchDrawcall d, bool hasEvents)
{
if(d.context == ResourceId()) d.context = m_pDevice->GetResourceManager()->GetOriginalID(m_ResourceID);
+1
View File
@@ -219,6 +219,7 @@ private:
void AddEvent(D3D11ChunkType type, string description, ResourceId ctx = ResourceId());
void AddDrawcall(FetchDrawcall draw, bool hasEvents);
void RefreshDrawcallIDs(DrawcallTreeNode &node);
////////////////////////////////////////////////////////////////
// implement InterceptorSystem privately, since it is not thread safe (like all other context functions)
@@ -4075,7 +4075,12 @@ bool WrappedID3D11DeviceContext::Serialise_ExecuteCommandList(ID3D11CommandList
if(!m_DrawcallStack.empty() && !m_DrawcallStack.back()->children.empty() &&
cmdDrawChildren != m_CmdLists.end())
{
m_DrawcallStack.back()->children.back().children = cmdDrawChildren->second.children;
// assign new drawcall IDs so that we don't get duplicates if this commandlist is executed again
RefreshDrawcallIDs(cmdDrawChildren->second);
}
}
return true;