D3D12 Replay loading GPU sync for ExecuteIndirect. Closes #2970 #2973
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
GPUSyncAllQueues() changed behaviour in e33629c which meant the GPU was not guaranteed to be synchronized when patching the execute indirect arguments when loading a capture (specifically if there were multiple ExecuteIndirect calls inside the same command buffer).
This led to a race between CPU & GPU and incorrect argument data being read back from the GPU to the CPU and then used for the ExecuteIndirect replay.
In addition to fixing the bug changed other calls from
GPUSyncAllQueues()
toGPUSync()
where appropriate ie. single flush validate debug mode.Extended the D3D12_Execute_Indirect test to act as a regression test for this case but also to cover the case of multiple ExecuteIndirect calls within the same command buffer. Changed the test to do 8 indirect draws with a clear in between and then check the pixel and mesh data for each draw is correct (simple triangle).