Skip to content

[Review import] GPU: retain indirect argument buffer until next clamp (upstream #3307) - #10

Draft
maok625 wants to merge 1 commit into
mainfrom
review/upstream-pr-3307-indirect-args-barrier
Draft

maok625 wants to merge 1 commit into
mainfrom
review/upstream-pr-3307-indirect-args-barrier

Conversation

@maok625

@maok625 maok625 commented Nov 26, 2026 •

Copy link
Copy Markdown
Owner

Imported from Marvisak#3307 for review on this fork.

Upstream source head: f23c88f90d322f2dcb7b13b143711e0d4dc34f39 (from KainanP/VIctory). It is directly based on the current fork main commit 63bcca43c6a00a758510398fa43096ce7e4f7df0.

Dependency note: upstream describes this as a follow-up to Marvisak#2586. Verify that prerequisite is present in current main before treating this as independently mergeable.

Draft import only. Inspect all touched code and tests, resolve interactions with sibling review branches, and run Windows/D3D12 tests before merging. No local build or GPU validation has been performed by this import.

Dependency clarification / integration warning

The upstream description calls this a follow-up to Marvisak#2586, but Marvisak#2586 is an open design proposal about deferring command-list translation to worker threads, not a code prerequisite. This PR can therefore be reviewed independently for its own barrier/lifetime change. It shares crates/victory-gpu/src/host.rs with Marvisak#3305 and Marvisak#3312, and draw.rs with Marvisak#2177. Reconcile those edits and test indirect dispatch/draw ordering, argument-buffer lifetime, and submission synchronization before merging.

… next clamp

Each indirect execution recorded three barrier calls for the list's
argument buffer (common -> unordered access, -> indirect argument, then
back to common right after the execution). The buffer now stays readable
as arguments after the execution: the next clamp's barrier moves it
from there (one call fewer per execution), and the list's close, or a
bigger buffer replacing it, puts it back to common, so between lists it
is common as before. The arguments and the barriers' ordering the GPU
sees are the same.

Also on the per-call path of every indirect execution:
- a pipeline bound again only because the clamp replaced it is not kept
  and named again (two QueryInterface + AddRef and a set lookup a call);
- command signatures are made once for good and each thread remembers
  the last one, so no shared lock or reference count per call;
- the argument buffer's width and the budget's address are remembered
  instead of asked of the driver each call.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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