Don't try to replay maps with empty writes.

* This can lead to crashes if we try to optimise with a buffer upload
  and try to create a buffer of 0 bytes. Easier just to skip these no-op
  maps.
This commit is contained in:
baldurk
2017-06-21 11:06:21 +01:00
parent 1dc3f65445
commit ba91e82feb
+2 -1
View File
@@ -897,7 +897,8 @@ bool WrappedID3D12Device::Serialise_MapDataWrite(Serialiser *localSerialiser,
SERIALISE_ELEMENT(uint64_t, begin, (uint64_t)range.Begin);
SERIALISE_ELEMENT(uint64_t, end, (uint64_t)range.End);
if(m_State < WRITING && GetResourceManager()->HasLiveResource(res))
// don't do anything if end <= begin because the range is empty.
if(m_State < WRITING && GetResourceManager()->HasLiveResource(res) && end > begin)
{
ID3D12Resource *r = GetResourceManager()->GetLiveAs<ID3D12Resource>(res);