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

Signal fences on CPU to reduce delays on muxed queues #2082

Merged
merged 5 commits into from
Aug 26, 2024

Conversation

doitsujin
Copy link
Collaborator

@doitsujin doitsujin commented Aug 24, 2024

Suppose we have two virtual queues A and B both sharing the same vkd3d_queue, and the application does something like this:

A->ExecuteCommands(...);
B->ExecuteCommands(...);
A->Signal(fence, ...);

then actually signaling the fence may be delayed until work submitted to B completes, which can delay both app threads waiting on the fence as well as command submissions to any queues that wait on said fence. To solve this, we instead queue up a CPU-side wait on the last submission performed by the signaling command queue and signal the fence manually.

This also takes the early signal idea from #2075 and queues up a CPU signal in case the virtual queue has no pending submissions.

This expands upon the per-queue submission tracker introduced in 5ac0781, which now needs to be updated for all submissions made from d3d12 scope (waits, sparse binding, 11on12 interop stuff, etc) for correctness.

Adding even more parameters to this would get a bit silly.

Signed-off-by: Philip Rebohle <[email protected]>
@doitsujin doitsujin force-pushed the cpu-signal branch 2 times, most recently from 3ea4dbf to 507210c Compare August 24, 2024 15:47
@doitsujin doitsujin marked this pull request as ready for review August 24, 2024 16:27
May reduce some signaling delays for multiplexed queues.

Signed-off-by: Philip Rebohle <[email protected]>
This way, the wait/signal logic will detect an external submission
and may allow pending Signal calls to skip this submission.

Signed-off-by: Philip Rebohle <[email protected]>
Copy link
Owner

@HansKristian-Work HansKristian-Work left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@HansKristian-Work HansKristian-Work merged commit be5143a into HansKristian-Work:master Aug 26, 2024
3 checks passed
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.

2 participants