GPU: heap slot writes do not wait for a submission's texture uploads #1978
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1980"
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?
Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T02:15:09Z.
The 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.Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T02:48:39Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
Heap slot writes no longer wait for a submission's texture uploads — removes a stall; ordering vs. the upload fence needs Windows stress testing.
Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-25T02:15:35Z.
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.
Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T06:35:33Z.
@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.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T08:25:31Z.
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
Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T18:51:01Z.
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