Make sure to correctly identify removed buffer in GPUAddress mapping

* When multiple buffers are aliased over the same heap memory, they'll have the
  same GPU base address. Our mapping needs to ensure it removes the right entry
  when a resource is released.
This commit is contained in:
baldurk
2019-01-28 19:55:39 +00:00
parent 3e843351e7
commit 76e42a1a2a
2 changed files with 28 additions and 7 deletions
+8 -1
View File
@@ -307,7 +307,14 @@ WrappedID3D12Resource::~WrappedID3D12Resource()
// assuming only valid for buffers
if(m_pReal->GetDesc().Dimension == D3D12_RESOURCE_DIMENSION_BUFFER)
m_Addresses.RemoveFrom(m_pReal->GetGPUVirtualAddress());
{
GPUAddressRange range;
range.start = m_pReal->GetGPUVirtualAddress();
range.end = m_pReal->GetGPUVirtualAddress() + m_pReal->GetDesc().Width;
range.id = GetResourceID();
m_Addresses.RemoveFrom(range);
}
Shutdown();