struct cbtype
{
float a, b, c, d;
};
context->Map (...);
cbtype *dest = (cbtype *) MappedResource.pData;
cbtype->a = cbtype->b = cbtype->c = somenumber;
cbtype->d = someothernumber;
context->Unmap (...);
That's not exact code - just a simplified case illustrating a condition that got triggered, but it surprised me (which with hindsight it shouldn't have) to find out (by viewing disassembly) that the "a = b = c = somenumber" line ended up reading from the Mapped buffer.
Now, I'm aware of the warnings given here: http://msdn.microsof...7(v=vs.85).aspx and I'm aware of the implications, but the question is: since it's so easy to accidentally do this (the page I linked gives another example commonly found when dealing with CPU-side memory), how does one reliably detect when/if it happens? The Debug Runtimes have nothing so say on it, even with Info-level output enabled, and PIX is quiet as the grave. Visual Studio can be configured to break on a memory write, but not on a read.
Is there really no way but the hard way?