GPU: cache registered shadow buffer lookups #46
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/DexNom--VIctory!46
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-46"
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?
@Adika713 on GitHub · 2026-11-25 20:31 UTC · original
Adika713:perf/dexnom-find-cache→main· +155 −12 · 1 files · 1 commits · openAvoid the global buffer-map lock on repeated host buffer lookups.
Every
shadow::find/find_anycall took theBUFFERSmutex and scannedthe buffer map. Draws bind the same vertex/index buffer repeatedly, so a
recording thread can reuse its last registered-buffer hit. A weak reference
avoided keeping a released copy alive; the existing buffer generation
invalidates the entry when a buffer is registered, unregistered or taken out
of place. Generation bumps now happen before the map change, so a second
generation read cannot miss an invalidation. Loose windows are not cached:
they have no generation and can be let go under another thread's lock.
What is in it
shadow.rs.BUFFERSmutation inregister,unregisterandin_place_let_go.ignored CPU-only A/B benchmark.
Tested
Hardware/toolchain: AMD Radeon RX 6950 XT (RDNA2), Ryzen 5 3600, 32 GB RAM,
Windows 11,
rustc 1.98.1,cargo 1.98.1.cargo check --manifest-path <worktree>/Cargo.toml -p victory-gpu --lib --tests --locked: exit 0.cargo test --manifest-path <worktree>/Cargo.toml -p victory-gpu --lib shadow::find_cache_tests:: -- --test-threads=1: 1 passed; 0 failed; 1 ignored.cargo test --release --manifest-path <worktree>/Cargo.toml -p victory-gpu --lib cached_find_lookup -- --ignored --nocapture --test-threads=1, 3 runs, median of 5 samples of 300,000 calls: locked30.5 / 30.5 / 30.1 ns, cached15.8 / 15.5 / 16.7 nsper lookup.cargo test --manifest-path <worktree>/Cargo.toml -p victory-gpu --lib -- --test-threads=1: 20 serial runs, 0 failed; each189 passed; 0 failed; 4 ignored.cargo test --manifest-path <worktree>/Cargo.toml --workspace -- --test-threads=1: exit 0, 0 failed suites.Not tested
No game files or paths were supplied, so the game was not run and no in-game
FPS was measured. The benchmark is synthetic and CPU-only.
AI-assisted: OpenCode, model Big Pickle. No game data.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.