Don't release ASs on replay

* These resources are destroyed on capture shutdown and possibly out of order
  between ASs and ASBs. The ownership tracking is not needed on replay so only
  do this during capture.
This commit is contained in:
baldurk
2024-05-10 11:13:45 +01:00
parent 72491cb9b2
commit 729fa04136
+6 -5
View File
@@ -152,8 +152,6 @@ D3D12AccelerationStructure::D3D12AccelerationStructure(WrappedID3D12Device *wrap
D3D12AccelerationStructure::~D3D12AccelerationStructure()
{
RDCLOG("AS %s destroyed", ToStr(GetResourceID()).c_str());
Shutdown();
}
@@ -209,9 +207,12 @@ WrappedID3D12Resource::~WrappedID3D12Resource()
}
}
// release all ASs
for(auto it = m_accelerationStructMap.begin(); it != m_accelerationStructMap.end(); ++it)
SAFE_RELEASE(it->second);
// release all ASs during capture. During replay these will be destroyed themselves
if(IsCaptureMode(m_pDevice->GetState()))
{
for(auto it = m_accelerationStructMap.begin(); it != m_accelerationStructMap.end(); ++it)
SAFE_RELEASE(it->second);
}
if(IsReplayMode(m_pDevice->GetState()))
m_pDevice->RemoveReplayResource(GetResourceID());