Ensure barriers are recorded into the right command list for application

This commit is contained in:
baldurk
2016-09-19 18:31:27 +02:00
parent 759b75da8b
commit 20b6c86119
2 changed files with 15 additions and 1 deletions
@@ -381,7 +381,7 @@ bool WrappedID3D12GraphicsCommandList::Serialise_ResourceBarrier(UINT NumBarrier
if(!filtered.empty())
list->ResourceBarrier((UINT)filtered.size(), &filtered[0]);
ResourceId cmd = GetResID(list);
ResourceId cmd = GetResID(GetResourceManager()->GetWrapper(list));
// need to re-wrap the barriers
for(UINT i = 0; i < num; i++)
+14
View File
@@ -582,11 +582,25 @@ WrappedID3D12GraphicsCommandList::WrappedID3D12GraphicsCommandList(ID3D12Graphic
m_Cmd = m_pDevice->GetQueue()->GetCommandData();
}
if(m_pReal)
{
bool ret = m_pDevice->GetResourceManager()->AddWrapper(this, m_pReal);
if(!ret)
RDCERR("Error adding wrapper for ID3D12GraphicsCommandList");
}
m_pDevice->GetResourceManager()->AddCurrentResource(GetResourceID(), this);
m_pDevice->SoftRef();
}
WrappedID3D12GraphicsCommandList::~WrappedID3D12GraphicsCommandList()
{
if(m_pReal)
m_pDevice->GetResourceManager()->RemoveWrapper(m_pReal);
m_pDevice->GetResourceManager()->ReleaseCurrentResource(GetResourceID());
SAFE_RELEASE(m_WrappedDebug.m_pReal);
SAFE_RELEASE(m_pReal);
}