GPU: heap slot writes do not wait for a submission's texture uploads #1980
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!1980
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1980/head"
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?
@0xkn0wh3r3 on GitHub · 2026-11-25 02:15 UTC · original
0xkn0wh3r3:gpu/bindless-uploads-unlocked→main· +15 −4 · 1 files · 1 commits · closed without mergingThe problem
While a submission brought its textures up to date, the title could not write any slot of the view heaps that submission uses. Title threads creating or copying descriptors, and draws mirroring a changed slot, stalled until the uploads were done.
The mechanism, in
bindless.rs:bindless::uploadschecks every title-written texture the heaps view, and detiles (or hashes, where the memory is not watched) each one that changed.Viewedlock through all of that. The only reason was that a texture the title releases meanwhile must not be freed under it (forgettakes the same lock).Viewed::set, which every write of a slot of that heap goes through (HostHeap::mirror, under the host heap's lock), needs that lock too, so it waited the whole time.The fix
UPLOADING, now keeps released textures alive.forgetanduploadstake it.uploadsholds a heap'sViewedlock only to copy out its texture list, then detiles and hashes without it.Viewed::set) no longer wait for the uploads. Releasing a texture (forget) still does, as before.The heaps' contents and the textures uploaded are the same.
Testing
No dedicated test: the gain shows only under contention in a game run, which I could not do here.
cargo test -p victory-gpuon an RTX 5070 Ti (driver 621.24): all pass exceptdescriptor::host::tests::dynamic_slots_are_held_until_releasedandmemory::tests::lists_share_a_table_and_copies_keep_their_views, which fail the same way onmain(the NVIDIA 1,000,000-descriptor heap cap, #1835).cargo clippy -p victory-gpu --all-targets, with and without--features diagnostics: clean.@DesertGamer on GitHub · 2026-11-25 02:15 UTC · original
VIctory V2: community PRs, merged and tested
Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.
Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).
⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.
Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2
Unofficial community fork of Marvisak/VIctory, GPL-3.0.
@0xkn0wh3r3 on GitHub · 2026-11-25 06:35 UTC · original
@catminou4: the ordering against the upload work is unchanged.
bindless::uploadsstill runs at submission, before the lists do. What changed is which lock it holds. It takes the heap's lock only long enough to copy out the list of textures to check, and a lock of its own (UPLOADING, also taken byforget) keeps released textures alive while it uploads. A slot write during the upload no longer waits for it. That write's texture is checked at the next submission, the same as before, when it waited for this submission's uploads to finish and then missed them anyway.@Marvisak on GitHub · 2026-11-25 08:25 UTC · original · edited 2026-11-25 16:05 UTC
Automated triage for the maintainers.
This pull request no longer merges cleanly into
main(conflicts incrates/victory-gpu/src/bindless.rs). It will be reviewed once it is rebased onto the currentmain. The earlier verdict (merge candidate) was for an older state ofmain.Generated by Claude Code
@0xkn0wh3r3 on GitHub · 2026-11-25 18:51 UTC · original
Closing: upstream
56f75f8(textures are brought up outside the heaps' locks, several at a time) does what this did.bindless::uploadstakes its work list under eachViewedlock, then refreshes and detiles without it, soViewed::setno longer waits on uploads.cea278cand42ea09fextend the same approach to making textures and views.Pull request closed