GPU: pool HostList upload buffers across resets #2015
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2017"
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 lizapropanol on 2026-11-25T03:10:46Z.
Reuse D3D12 staging upload buffers on
HostListacross resets instead of creating and mapping a new committed buffer for everyHostList::uploadcall (CopyTextureRegion/CopyTextureRegionX).Summary
UploadPool/UploadBufferonHostListincrates/victory-gpu/src/host.rsand return in-use buffers to the free list inHostList::reset.FIRST_UPLOAD_BUFFER) up to 4 MiB (MAX_POOLED_UPLOAD), selecting the smallest free buffer that fits and capping retained pool memory at 32 MiB (MAX_UPLOAD_POOL_BYTES) per list.deferred().uploadsso they drop on reset as before.upload_pool_reuses_smallest_fit_and_enforces_capsandlist_upload_reuses_buffers_after_reset_and_skips_pooling_oversized.Verification
cargo clippy --workspace --all-targets --locked -- -D warningscargo clippy --workspace --all-targets --all-features --locked -- -D warningscargo test --workspace --lockedcargo xtask policyImported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:33:13Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
HostList upload buffers pooled across resets — allocation reuse; check pool growth bounds on long sessions.
Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T03:20:45Z.
Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at
0f4fd8c.victory-gpu: 143 passed, 2 failed, 2 ignored; the newupload_pool_reuses_smallest_fit_and_enforces_capsandlist_upload_reuses_buffers_after_reset_and_skips_pooling_oversizedpass. The 2 are #1744's NVIDIA failures onmain(dynamic_slots_are_held_until_releasedandlists_share_a_table_and_copies_keep_their_views, the heap-cap ones). Same asmainon this hardware. Not run: a title.AI-assisted (Claude Code).
Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T03:34:13Z.
Triage verdict — Choose one upload pool; verify retention and GPU lifetime (
0f4fd8c)Evidence
Checks and limits
Next step
This verification was AI-assisted.
Imported from Marvisak/VIctory. Originally posted by Xvania7 on 2026-11-25T08:52:03Z.
Review: APPROVED
Verified locally merged onto
main(940d32f, Windows 10 x64, NVIDIA GeForce RTX 5060, Rust MSVC):cargo test -p victory-gpu --lib -- --test-threads=1 host::tests::— all 8host::tests::*tests passed (includinglist_upload_reuses_buffers_after_reset_and_skips_pooling_oversizedandupload_pool_reuses_smallest_fit_and_enforces_caps); the 1 unrelated failure in that filter wasdescriptor::host::tests::dynamic_slots_are_held_until_released(#1835, NVIDIA 1M descriptor heap cap).cargo clippy -p victory-gpu --all-targets -- -D warnings— 0 warningscargo xtask policy— ok (182 files ok)Synthetic tests only; no game data.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T09:17:39Z.
Automated triage for the maintainers.
Proposed close.
This pools the mapped upload buffers handed out by
HostList::upload(crates/victory-gpu/src/host.rs), which is theshortcut:note on that function. The same change is already open as #1894 (host-wide pool, returned inHostList::reset, capped at 64 buffers / 64 MiB in total), which merges cleanly and was triaged as a merge candidate earlier; #982 is a third take on it. The reuse here is safe for the same reason as there (resetruns only after the list's submissions finished), but the design is weaker on one point: the 32 MiB cap is perHostList, and buffers stay retained for the list's whole life, so a title with many long-lived command lists can keep far more upload memory than #1894's single shared cap allows. There is also no measurement showing upload creation cost in a session.Proposed for close as a duplicate of #1894; it will be closed in 48 hours unless the author pushes a change (for example, measurements showing the per-list design is better, or porting the cap and oversized-allocation tests onto #1894) or a maintainer removes the label.
CI: passing (
check).Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by borosf on 2026-11-27T17:12:26Z.
Coordination note: #982 by @chemokita13 and #1894 by @n-romanovich do the same pooling of upload buffers across resets. Three PRs, one change — triage in #1633 keeps #982. If yours differs, say how.
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.