* Remove redundant buffer allocation and copy, deserialise straight into
the mapped memory that we allocate.
* Get memory allocation size from buffer correctly rather than assuming
the buffer size will be identical (it probably will be, but still).
* This reduces the total size from 448 bytes -> 232 bytes, but does mean
some extra pointer chasing. I'm not sure what the best balance is so
this will do for now and I'll wait and see if profiling turns up any
issues.
* Not supporting images with arrays or mips for now as that becomes
more complicated. In theory a page table each, but then need to handle
mip tail and stuff.
* Normal resources have a single memory bind that can be added to frame
references when the resource is. Sparse resources don't have that easy
single mapping.
* Calls to MarkResourceFrameReferenced with a 0 ResourceId aren't a
real problem, but we have to be careful when dirtying resources.
* We don't have to dirty memory that's sparsely bound as we'll dirty it
as soon as its sparsely bound. We do have to worry about making sure
that memory is correctly frame referenced.
* To do this command buffers track the sparsemapping structures (will be
created for all sparse resources) that are referenced underneath them.
Then at queue submit time the current sparse mapping is iterated and
all bound memory marked frame referenced.
* For most cases where a buffer is bound or similar, we can directly add
the sparsemapping from the resource record. For descriptor sets we
must do this indirectly - by marking any bindframerefs in the descset
record with a bit indicating that the associated resource is sparse,
then at submit time when iterating the bindframerefs, taking any with
the bit set and looking up its record to find the sparsemapping.
* Not supporting image transitions within secondary command buffers, and
doesn't support partial executes of secondary command buffers on the
replay side.
* Not sure when a renderpass clear effects should be available for an
attachment that isn't used in the first subpass. At the moment the
clear doesn't show up until the first draw, but that's not such a bad
bug even if it's our side rather than driver's.
* We can't analyse or reflect it at all, but we should at least pass it
through.
* Currently invalid but there will probably be extensions that allow
this, whether or not we'll allow them is a different matter.