Batch per-draw shadow refresh deferral under one lock #33
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!33
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-33"
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 19:57 UTC · original
Adika713:perf/dexnom-refresh-batch→main· +132 −9 · 3 files · 1 commits · openBatch per-draw shadow refresh deferral under one lock.
Every vertex and index buffer range a draw bound called
Shadow::refresh,which took the list's deferred-work mutex once per range. A draw now collects
its ranges and calls
defer_refreshes()once. Repeated ranges are stilldeduplicated, and the early return for a missing index buffer still defers the
vertex ranges already collected.
What is in it
Shadow::refresh_params()returns the clamped rangerefresh()would defer.HostList::defer_refreshes()takes the deferred lock once for all ranges;defer_refresh()delegates to it.draw.rscollects vertex and index ranges, skips the empty case, and keepsthe existing order of deferred steps.
ignored CPU-only A/B benchmark.
Tested
AMD Radeon RX 6950 XT (RDNA2), Ryzen 5 3600, 32 GB RAM, Windows 11,
rustc/cargo 1.98.1. No game data; the game was not run. Isolated
CARGO_TARGET_DIR. BCPack format tables were installed locally withInitialize-FormatTables.ps1and were not committed.cargo test --release -p victory-gpu --lib defer_refresh_batching -- --ignored --nocapture --test-threads=1,3 runs, median per range over 5 samples:
Correctness:
cargo check -p victory-gpu --lib --tests --locked: exit 0.cargo test -p victory-gpu --lib host::tests::defer_refreshes_matches_one_call_per_range -- --test-threads=1:1 passed, 0 failed, 192 filtered.
draw::: 7 passed;shadow::: 22 passed;host::: 52 passed, 0 failed,2 ignored (serial).
victory-gpulib, 20 serial runs: 0 failed; each 189 passed,0 failed, 4 ignored, 0 filtered.
cargo test --workspace --no-fail-fast --locked: one first run hit thetiming-sensitive
frame::tests::waits_end_on_ticks_and_count_framesfailure;that test then passed 5/5 serial runs and the workspace rerun had 0 failed
suites.
Not tested
about frame rate.
keeps the existing list-lifetime rule.
AI use
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.