Add a couple of extra protection checks in D3D12 code against crashes

This commit is contained in:
baldurk
2021-08-24 18:59:45 +01:00
parent f45f8eac43
commit f258261a21
2 changed files with 8 additions and 1 deletions
+2 -1
View File
@@ -65,7 +65,8 @@ void D3D12_CleanupReplaySDK();
inline void SetObjName(ID3D12Object *obj, const rdcstr &utf8name)
{
obj->SetName(StringFormat::UTF82Wide(utf8name).c_str());
if(obj)
obj->SetName(StringFormat::UTF82Wide(utf8name).c_str());
}
#define PIX_EVENT_UNICODE_VERSION 0
+6
View File
@@ -1750,6 +1750,12 @@ bool WrappedID3D12Device::Serialise_MapDataWrite(SerialiserType &ser, ID3D12Reso
{
ID3D12Resource *uploadBuf = GetUploadBuffer(cmd.m_CurChunkOffset, rangeSize);
if(uploadBuf)
{
RDCERR("Couldn't get upload buffer");
return false;
}
SetObjName(uploadBuf,
StringFormat::Fmt("Map data write, %llu bytes for %s/%u @ %llu", rangeSize,
ToStr(origid).c_str(), Subresource, cmd.m_CurChunkOffset));