* This fixes the issue that tests of out-of-bounds and error behaviour trigger
debugbreaks. We don't apply this to RDCERR (currently) as it would generate
more code overall and it's easier to convert any new deliberate test errors.
* Drivers can compact inconsistently so if we have a compaction that ends up
smaller during capture than replay we will end up with overlapping and invalid
AS locations on replay.
* We still allow compactions to happen in case there's a performance benefit,
the application will just not be able to exploit any memory savings.
The spec does not mandate that the compaction size is the same between capture and replay, so we effectively disable it by always returning the full AS size when the compaction size is queried.
When vkCmdBuildAccelerationStructuresKHR is called, the input buffers used for the build are copied into host-accessible memory, so when initial state serialisation is triggers it can be copied into the capture file.
To unify the behaviour of the different geometry types, there is only one readback buffer per AS, and in the case of triangle data it can contain the vertex, index, and transform data concatenated into a single contiguous block.
The buffer data along with build arguments are stored in a ref-counted VkAccelerationStructureInfo object held by the AS's VkResourceRecord. Once the info object is destroyed, then the copied buffer mem is also freed.
Serialisation of the initial state will follow in later patches.
Caveats:
* vkCmdBuildAccelerationStructuresIndirectKHR is not handled
* VkAccelerationStructureGeometryInstancesDataKHR::arrayOfPointers mode is not handled
* After each function we need to reset the IDs of any function-local constants
since they may be referenced in other functions and need to be given new
function-local IDs for reference.
The reftype of a merged subresource state is now initialized with the reftype of the original subresource state
This resolves an issue that could occur if image states in a secondary command buffer were merged into a primary for the first time, where the resulting merged image state would have an uninitialized reftype