GPU: bind 256-byte-aligned table CBVs directly from shadow buffers #144
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/fxceless--victory-fork!144
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-144"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@MartinIndra02 on GitHub · 2026-11-24 21:50 UTC · original
MartinIndra02:perf/fxceless-table-cbv-shadow→main· +24 −6 · 1 files · 1 commits · openSummary
Mirrors
oot_view\ (\draw.rs:391) for \View::Constant(address, size)\ entries inside descriptor tables (\draw.rs:2008):
RTX 3080 A/B Measurement (Windows 11, 10 GB)
On our local RTX 3080 run (paired with #71 + #25, same switches):
@ericomeehan on GitHub · 2026-11-24 22:01 UTC · original
#104 and this PR change the same lines (the
View::Constantarm of table binding incrates/victory-gpu/src/draw.rs, around line 2008), so whichever merges second needs a rebase. They also fit together:main, the table path makes a CBV of the guest's full size (constant_atrounds to 256 but does not cap). D3D12 allows at most 65536 bytes per CBV, androot_viewalready caps constant buffers at1 << 16. #104 adds that cap to the table path.main's code unchanged, so it still gets the oversized view. With #104's cap the fallback is fine, and the direct path could clamp to 64 KiB, asroot_viewdoes, instead of refusing.defer_fillcopies into upload memory private to this list, while the shadow is shared with other lists. Both are brought up to date when the list is submitted.root_viewalready binds shadows this way, so this is consistent with it; the only new exposure is if another list refreshes the same range while this one is still in flight, which depends on the shadow's in-flight tracking.Suggestion: merge #104 first, then rebase this onto it with
aligned_size.min(65536).I only read the code. I didn't build or run it.
Written with an AI assistant (Claude).
@Revens2 on GitHub · 2026-11-25 05:13 UTC · original
Build check only: this PR merges cleanly on main
c96b4f2and the integration build of eight PRs (#115 #66 #36 #144 #147 #141 #139 #130) compiles (diagnostics profile). In the game, that combo was run alone 3 times (900 s,VICTORY_RELAY=2, scripted input): one run to the end (median 4.95 fps, about 4.9k draws per frame, against 4.84-5.04 fps on main), one title breakpoint0x80000003at about 157 s after a failed dstorage request (the pattern is explained on #115), one device removed (0x887A0005) at about 160 s that did not repeat in the two other runs. Nothing is proven for this PR alone: it was not run on its own,cargo testwas not run on the combo, and nothing was checked on the title side of its change. Not verified.@ryotdev on GitHub · 2026-11-25 14:28 UTC · original
I reviewed the direct CBV path at
1ac9b30. There is a dependency missing when a command list is cut. The first physical list recordsshadow.refresh(...)for the table CBV. After the cut,State::replaypreserves the table cache, and a cache hit skips CBVs. The second physical list can therefore bind the cached GPU address without recording that shadow or its byte range among its own refresh dependencies. A title write to the constants between the two parts can go unseen by this binding. #742 discusses the related scratch-buffer lifetime case.Could you retain the shadow and exact byte range for each directly bound CBV and request its refresh on cache hits, or evict CBV-bearing tables at the cut and rebuild them? A focused regression would bind the same table on both sides of a cut, change its constant bytes before the second submission, and check that the second draw sees the update.
One performance detail worth counting in the A/B is the number of new shadows created by the eligibility check.
shadow::findcan allocate on a miss, including a loose window for an unregistered range. The alignment check follows the lookup, so a binding can pay for that allocation and still fall back to scratch.AI-assisted source review. I traced the paths on this PR head. My RTX 5070 timing runs used a separate diagnostics build, so I have no FPS claim for this PR.
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.