Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

D3D12 Replay loading GPU sync for ExecuteIndirect. Closes #2970 #2973

Merged

Conversation

Zorro666
Copy link
Collaborator

@Zorro666 Zorro666 commented Jul 3, 2023

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() to GPUSync() 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).

Change it to do 8 indirect draws with a clear in between.
Check the pixel and mesh data for each draw is correct (simple triangle)
GPUSyncAllQueues() changed behaviour in e33629c which meant the GPU was not being synchronized when patching the execute indirect arguments when loading a capture.

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 ExecuteIndirect replay.

In addition to fixing the bug changed other calls from GPUSyncAllQueues() to GPUSync() where appropriate ie. single flush validate debug mode.
@Zorro666 Zorro666 merged commit 5f88b30 into baldurk:v1.x Jul 3, 2023
16 checks passed
@Zorro666 Zorro666 deleted the d3d12-execute-indirect-replay-sync-2970 branch July 3, 2023 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant