Add protection against unknown resources when capturing

* This can happen because the addresses map is shared among all devices so some
  other devices might have added resources which we don't recognise the IDs for
  - though this could break in other ways (same address range for different
  resources on different devices) so it's generally not supported.
This commit is contained in:
baldurk
2021-07-05 12:24:58 +01:00
parent a1b5f01159
commit 83cee7b35d
+5 -2
View File
@@ -338,8 +338,11 @@ rdcarray<ID3D12Resource *> WrappedID3D12Resource::AddRefBuffersBeforeCapture(D3D
for(size_t i = 0; i < addresses.size(); i++)
{
ID3D12Resource *resource = (ID3D12Resource *)rm->GetCurrentResource(m_Addresses.addresses[i].id);
resource->AddRef();
ret.push_back(resource);
if(resource)
{
resource->AddRef();
ret.push_back(resource);
}
}
return ret;