GPU: a read slot is resolved once, not twice #3215
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!3215
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3215"
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?
@borosf on GitHub · 2026-11-26 13:21 UTC · original
borosf:vibe/read-slots-842ca5→main· +13 −10 · 2 files · 1 commits · openSummary
descriptor::make_readresolved every read slot twice: firstHostHeap::mirror— the made-keys lock, the global views lock, a clone of the view, plus the kept lock when a texture view needs remaking — and thenstamp_read, which looked the same slot up again through the same two locks and a second clone, only to stamp theHostTexturethe view holds.mirroralready has the view in hand and returns it, so the stamp now takes the view:stamp_read_view(&view).stamp_readhad no other caller, so it is deleted rather than left as a second way to do the same thing.mirrorrefuses are exactly the onesstamp_readfound no made key for and returned on (itskey != 0guard), so the set of stamped textures is identical.descriptor.rs,make_read), against the world's 1,300–14,400 written slots a frame quoted in that file's own comment.ViewisClonebut notCopy, so the placed-texture upgrade clones rather than moves; that is the only new clone, and it replaces a dropped one.Verification
Intel Arc B580, Windows 11:
cargo test -p victory-gpu --lib --locked -- --test-threads=1→ 229 passed, 2 failed, 1 ignored. The two failures are the known Intel heap-cap pair (descriptor::host::tests::dynamic_slots_are_held_until_released,memory::tests::lists_share_a_table_and_copies_keep_their_views— #1744/#1829) that pristinemain63bcca4also fails on this card.cargo clippy -p victory-gpu --all-targets -- -D warningsclean with and without thediagnosticsfeature.No game data used; synthetic tests only.
Stacked on nothing: branched from
main63bcca4, two files, +13/−10. The magnitude is modelled from the slot rate × the two lock pairs and clone it removes, not measured — that needs a world frame with the title.claiming: GPU: descriptor::make_read resolves every read slot twice (mirror, then stamp_read, each taking the made lock and the global VIEWS lock and cloning the view) — resolve once per slot and pass the view to the stamp, with a ReadSlots counter so the frame line can price it
@Dukestar69 on GitHub · 2026-11-26 13:27 UTC · original · approved these changes
Verified on RTX 5090 against
origin/main(63bcca4):cargo test -p victory-gpu --lib descriptor::host:: -- --test-threads=1 --skip dynamic_slots_are_held_until_released: 14/14 passed.cargo test -p victory-gpu --lib draw:: -- --test-threads=1: 20/20 passed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Cleanly avoids resolving each read slot twice.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.