Change verify map writes capture option to verify buffer access.

* This option will now toggle on the behaviour to fill undefined buffer contents
  with a marker value, both if they're created without data (it will be zero
  filled instead) or mapped with discard (it will keep the old contents
  instead).
* There were too many hard to find problems or misconceptions about the buffer
  filling for it to be useful. Now it will be opt-in instead.
This commit is contained in:
baldurk
2018-11-23 11:25:39 +00:00
parent 667d40382b
commit f75b5e235e
12 changed files with 107 additions and 73 deletions
+4 -2
View File
@@ -45,8 +45,10 @@ bool WrappedID3D11Device::Serialise_CreateBuffer(SerialiserType &ser, const D3D1
{
fakeData.pSysMem = new byte[Descriptor.ByteWidth];
fakeData.SysMemPitch = fakeData.SysMemSlicePitch = Descriptor.ByteWidth;
// fill with 0xfefefefe to indicate that the data is uninitialised.
memset((void *)fakeData.pSysMem, 0xfe, Descriptor.ByteWidth);
// fill with 0xdddddddd to indicate that the data is uninitialised, if that option is enabled
memset((void *)fakeData.pSysMem,
RenderDoc::Inst().GetCaptureOptions().verifyBufferAccess ? 0xdd : 0x0,
Descriptor.ByteWidth);
pInitialData = &fakeData;
}