D3D12.X: release large texture upload buffers after idle #3194
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3194"
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 ivall/xcl. Originally posted by gefydev on 2026-11-28T17:59:54Z.
Release completed texture-upload staging allocations of at least 64 MiB after 20 seconds of inactivity. Small staging allocations and uploader command objects remain cached.
Related to #3050, which bounds idle upload buffers in the title texture uploader (
hle/d3d12x/texture_upload.rs). This change is ingpu/texture.rsand does not overlap its files.What is in it
Tested
Regression run
Same title, 45 seconds, shader preparation disabled in both runs.
Not tested
The 45-second retail smoke did not log an eligible idle release. Runtime peak savings under sustained retail streaming and AMD behavior were not measured. AMD and other adapters were not tested.
AI use
Codex (gpt-6.2-sol) implemented the change, wrote and ran the tests, and drafted this description.
Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:08:14Z.
Review (head
39874bf7, diff read, not a merge-check; draft and conflicting, so not built or run):f0e8fdd5nothing callsgpu::texture::upload_batch/upload_batch_with_zero_mipsfrom outsidegpu/texture.rs; title texture uploads go throughhle/d3d12x/texture_upload.rs(title_textures.rs~2675). So theUPLOADERScache this PR trims is never filled. The idle buffers kept today aretexture_upload.rs'sFREEpool (fixed 512 MiB cap, ~795 / ~839), which #3050 (XCL_UPLOAD_KEEP_MB) already bounds. The same merge deleted the GPU test this PR edits, which is the conflict. #3050 also toucheshost.rs, so the "does not overlap" note isn't accurate.gpu/texture.rs~207-209) puts these D3D12 calls at 200-650 ms while streaming, so bursts more than ~20 s apart could stall each time.release_idle_stagingwith synthetic times but not thetrim_idle_stagingsweep, and the PR's smoke run ends at "36 1 0" presents per 2 s without explanation.Fine: the release is safe against the GPU (only cached uploaders are trimmed, and they enter the cache only after a successful fence wait), and the allocation is detached under the lock and dropped outside it. Given the first point, I'd close this or redo it in
texture_upload.rstogether with #3050.AI review: Claude Code (Claude Opus 5.5), posted by Foniass without a human check of each point.
Imported from ivall/xcl. Originally posted by throny on 2026-12-01T13:01:13Z.
Closing as superseded: this change is already on
main(f0e8fdd5). main gpu::texture upload_batch is not called outside texture.rs, so UPLOADERS is never filled at runtime (uploads moved to texture_upload.rs); the PR trims an empty cacheTwo independent checks found this: Foniass's close list on #1607 and ours against current
main. If something here is still missing onmain, say so and reopen it, or ask and I will.AI use: Claude Code (Claude Opus 5.5); the per-PR comparison was done by Claude Sonnet 5.5 sub-agents.
Pull request closed