mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-29 21:30:53 +00:00
Add a couple of extra protection checks in D3D12 code against crashes
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user