GPU: reuse submit-time snapshots for repeated table CBVs #1316
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!1316
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1316"
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?
@ByFxbian on GitHub · 2026-11-26 14:06 UTC · original
ByFxbian:perf/cbv-snapshot-reuse→main· +631 −17 · 7 files · 2 commits · openSummary
Reuse submit-time constant-buffer snapshots when multiple descriptor table
bindings reference the same source range within a recording epoch.
Opt-in via
VICTORY_CBV_SNAPSHOT_REUSE=1(off by default).The existing copied snapshot semantics, shader ABI and shader cache
compatibility are preserved.
Changes
avoided bytes and invalidations.
Performance
Windows, Ryzen 5 5600X, RTX 3070 8 GB, 32 GB RAM, ReBAR enabled.
22,000 synthetic constant-buffer bindings through the production
descriptor-table path.
Median CPU preparation and enqueue time:
With 64 distinct sources:
With entirely unique sources, median recording time increases from
36.288 to 40.761 ms. The benefit depends on the actual reuse rate,
which is why the optimization remains opt-in.
Validation
event-log permission failure.
Gameplay testing
No gameplay FPS improvement is claimed.
An A/B test with
VICTORY_CBV_SNAPSHOT_REUSE=0and1wouldestablish the actual reuse rate and whether the reduction in submission
work outweighs the recording overhead.
Related work
@grosterr on GitHub · 2026-11-26 21:45 UTC · original
A heads-up for whoever merges this together with #860: the two do not conflict textually, but the result does not compile its tests. #860 changes
fill_ahead::on()tofill_ahead::on(src, len)(whether a fill oflenbytes atsrcmay read ahead). This PR'scopy_join_title_work_reset_and_pending_gpu_write_preserve_cbv_snapshotsstill callsfill_ahead::on():With #860 in, the test should ask about the same fill that
blocked_bylooks at, the 256 bytes ataddress:With that one change, all 290
victory-gpulib tests pass on our tree (fork main52ac4ec+ #1316 + #860 + others, Windows, RTX 3060). The release build is not affected, since only the test calls it that way.@akimfomin on GitHub · 2026-11-26 22:15 UTC · original · edited 2026-11-26 22:42 UTC
A source check against Zignixx’s current
nvidia-wip(90fe3144a4c5fe8ca4e6ce1b5f0e42f4fb28696b) found that it does not containVICTORY_CBV_SNAPSHOT_REUSE. Applying this PR’s58de9bf..c5b0898delta in a three-way check conflicts incopystat.rs,draw.rs,host.rsandlist.rs. This is separate from grosterr’s #860 test helper note.For the gameplay comparison mentioned in the description, I prepared a matched six-run checklist and tested the aggregate script on fixed inputs. It reports frame times and 1% lows plus the fraction of eligible lookups that hit. It flags missing ON diagnostics. I shared the optional check in #1379 with one person who already ran the scene. No scene result yet. Checklist and reproduction
AI-assisted source comparison and test tooling (Codex).
Update: I built the pinned diagnostic head and independently ran the same synthetic regression with reuse OFF and ON on RTX 4070 Ti SUPER (617.14). Both passed. Exact build, per-case measurements and analyzer controls. The game-scene A/B remains open.
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.