GPU/draw: reuse staging for repeated unaligned root CBVs #1212

Open
github-bot wants to merge 1 commit from github-bot/gh-1212 into main AGit
Owner

@⁠nicolasveilleux on GitHub · 2026-11-26 00:12 UTC · original
nicolasveilleux:perf/reuse-root-cbv-scratch → main · +102 −5 · 2 files · 1 commits · open

Reuse submission-time scratch for repeated bindings of the same unaligned root constant-buffer view on one command-list recording. Key the bounded cache by source address and byte count, invalidate on deferred title-memory writes and reset, and leave aligned bindings unchanged. Opt in with VICTORY_REUSE_ROOT_CBV=1.

Adapted from avatarmanz/VIctory-7900XTX c96525d, itself based on romainhedouin's Belobug change 84ea9c12.

Validation

Native Windows 11 / i7-10700F / RTX 2070 Super, release tests with synthetic data only:

  • The regression passed: repeated bindings reuse one scratch allocation, different lengths remain distinct, both types of deferred title-memory writes force a fresh fill with the correct bytes, and reset clears the cache.
  • Native A/B submission test, 20 paired samples after warm-up, median for repeated 16 KiB binding requests: 1 request, 0.0857 -> 0.0859 ms; 128, 0.3571 -> 0.0885 ms; 2,048, 4.5126 -> 0.1725 ms. At 2,048 requests, deferred fills go from 32 MiB to 16 KiB.

No gameplay FPS claim. The frequency of this path in a shipping workload is not yet measured, so this remains off by default.

**@⁠nicolasveilleux** on GitHub · 2026-11-26 00:12 UTC · [original](https://github.com/fxceless/victory-fork/pull/1212) `nicolasveilleux:perf/reuse-root-cbv-scratch` → `main` · +102 −5 · 2 files · 1 commits · open Reuse submission-time scratch for repeated bindings of the same unaligned root constant-buffer view on one command-list recording. Key the bounded cache by source address and byte count, invalidate on deferred title-memory writes and reset, and leave aligned bindings unchanged. Opt in with VICTORY_REUSE_ROOT_CBV=1. Adapted from [avatarmanz/VIctory-7900XTX c96525d](https://github.com/avatarmanz/VIctory-7900XTX/commit/c96525dbb29daa12bc224813a3e64745520fae29), itself based on romainhedouin's Belobug change 84ea9c12. ## Validation Native Windows 11 / i7-10700F / RTX 2070 Super, release tests with synthetic data only: - The regression passed: repeated bindings reuse one scratch allocation, different lengths remain distinct, both types of deferred title-memory writes force a fresh fill with the correct bytes, and reset clears the cache. - Native A/B submission test, 20 paired samples after warm-up, median for repeated 16 KiB binding requests: 1 request, 0.0857 -> 0.0859 ms; 128, 0.3571 -> 0.0885 ms; 2,048, 4.5126 -> 0.1725 ms. At 2,048 requests, deferred fills go from 32 MiB to 16 KiB. No gameplay FPS claim. The frequency of this path in a shipping workload is not yet measured, so this remains off by default.
Adapt avatarmanz/VIctory-7900XTX c96525dbb2, based on romainhedouin (VIctory-Belobug-AMD 84ea9c12). Keep the experiment opt-in, bound the cache, and invalidate on deferred title writes and list reset.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:59:36 +00:00
Author
Owner

@⁠Marukooh on GitHub · 2026-11-26 17:34 UTC · original

I tried a per-list root CBV reuse port on a local Series X build (RTX 5070 Ti / Proton) with the constants heap able to use in-place placement. The synthetic case exercised reuse and invalidation. The opening scene produced zero reuse hits in the sampled windows, so I cannot attribute any frame-time gain to this path on that configuration. It would help to record miss reasons and in-place placement alongside reuse hits when comparing Windows or other memory paths.

**@⁠Marukooh** on GitHub · 2026-11-26 17:34 UTC · [original](https://github.com/fxceless/victory-fork/pull/1212#issuecomment-7199262411) I tried a per-list root CBV reuse port on a local Series X build (RTX 5070 Ti / Proton) with the constants heap able to use in-place placement. The synthetic case exercised reuse and invalidation. The opening scene produced zero reuse hits in the sampled windows, so I cannot attribute any frame-time gain to this path on that configuration. It would help to record miss reasons and in-place placement alongside reuse hits when comparing Windows or other memory paths.
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/draw.rs
  • crates/victory-gpu/src/host.rs
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.
git fetch -u origin '+refs/pull/1212/head:github-bot/gh-1212'
git switch 'github-bot/gh-1212'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1212'
git switch 'github-bot/gh-1212'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1212'
git switch 'github-bot/gh-1212'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1212'
git switch 'main'
git merge --squash 'github-bot/gh-1212'
git switch 'main'
git merge --ff-only 'github-bot/gh-1212'
git switch 'main'
git merge 'github-bot/gh-1212'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.