Fix crash if duplicate root signature pointer is returned

* If we make internal replay root signatures live resources they could clash
  with a replayed resource and end up with two entries in the live resource
  list, which will double delete on shutdown.
This commit is contained in:
baldurk
2020-10-01 16:59:25 +01:00
parent 55c57f7e89
commit 58f4dc6f02
+1 -2
View File
@@ -850,6 +850,7 @@ bool WrappedID3D12Device::Serialise_CreateRootSignature(SerialiserType &ser, UIN
{
if(GetResourceManager()->HasWrapper(ret))
{
ret->Release();
ret = (ID3D12RootSignature *)GetResourceManager()->GetWrapper(ret);
ret->AddRef();
@@ -937,8 +938,6 @@ HRESULT WrappedID3D12Device::CreateRootSignature(UINT nodeMask, const void *pBlo
else
{
wrapped->sig = GetShaderCache()->GetRootSig(pBlobWithRootSignature, blobLengthInBytes);
GetResourceManager()->AddLiveResource(wrapped->GetResourceID(), wrapped);
}
*ppvRootSignature = (ID3D12RootSignature *)wrapped;