* If we make internal replay root signatures live resources they could clash
with a replayed resource and end up with two entries in the live resource
list, which will double delete on shutdown.
* This should only be allocated when the config flag isn't disabled and when
it's needed, but we were always allocating it during capture.
* We also only allocate as much as is needed, since it seems on AMD linux the
CPU memory can actually be quite arbitrarily constrained.
* If we destroy a resource e.g. FBO 4 in a captured frame, its record will stay
alive until the end. When we delete that record we don't want to remove the
record that is now recorded for FBO 4 since that might be a new resource that
has been created. If the ID doesn't match then the original resource
destruction has already been processed and the record is now orphaned, so
nothing has to happen.
* We don't replay it, all resources are resident on replay. At record time we
need to know the residency status to make resources resident when necessary.
* DXGI is entangled with the API unfortunately, such that for D3D11
DXGI_SWAP_EFFECT_FLIP_DISCARD can only access buffer 0 (like
DXGI_SWAP_EFFECT_DISCARD) but for D3D12 it can access any buffer. This is
naturally undocumented.
* On D3D11 we just queried the resource & sampler binding from whichever stage
it was on and bound it to the pixel shader. On D3D12 we re-use the root
signature which means we need to fetch the binding in the stage it was used
originally. VS t0,space0 could be different from PS t0,space0.
* This can lead to lifetime issues if the allocator is reset and now the
external-data pointer or bool can be trashed. Instead if the data allocation
can't come from the allocator, allocate both data and chunk externally.
* When capturing some external memory driver implementations have completely
disjoint memory type bits allowed for external and non-external resources.
This means it is impossible to capture it as external and then replay it as
non-external, leading to a broken capture.
* This is warned about at capture time but easy to miss. Adding this error here
is more likely to be seen and found.
Updated vk_next_chains.cpp to handle serializing of the new structs
Updated VkCreateInfo function to check for Android External Buffer
Fixes to vk_serialize.cpp to serialize structs properly