GPU: cache registered shadow buffer lookups, with the generation bump after the take #53
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!53
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-53"
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?
@Barba2k2 on GitHub · 2026-11-25 22:08 UTC · original
Barba2k2:fix/find-cache-generation-order→main· +160 −12 · 1 files · 2 commits · openTwo commits. The first (
4784a4a, authored by Adika713, unchanged) adds a one-entry thread-local cache for registered-buffer hits inshadow::find/find_any, validated by the buffer generation. The second fixes the ordering of that generation bump inin_place_let_go.The cache validates a hit by reading the generation before and after
lookup, which only works if a change is followed by its bump. With the bump at the top ofin_place_let_go, a recording thread can read the new generation, find the copy that is about to be taken, and cache it with nothing left to invalidate it. The fix bumps under thebuffers()lock right after thetake, and only when something was taken.registerandunregisteralready bump under that lock. Also uses?incached_lookup(clippy::question_mark).The race only affects
VICTORY_INPLACE=2(off by default).Tested:
cargo clippy -p victory-gpu --lib --tests --lockedclean;cargo test -p victory-gpu --lib --locked -- --test-threads=1189 passed, 0 failed, 4 ignored. No regression test for the interleaving (it needs a real placed shadow). Not run in-game.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.