texture: the spare detile pool trims under pressure #2633

Manually merged
github merged 6 commits from github-bot/gh-2633 into gh-pr/2633/base 2026-11-30 14:17:15 +00:00 AGit
Owner

@⁠sh3nw4ld on GitHub · 2026-11-29 15:15 UTC · original
sh3nw4ld:fix-spare-linear-trim → main · +180 −60 · 32 files · 6 commits · merged 2026-11-30 14:12 UTC

What this fixes

The pressure sweep trimmed every sibling spare pool — uploads, chunks, read-backs, the send bar, the UAV spare — and the spare detile targets it did not touch: SPARE_LINEAR grew to LINEAR_POOL_MOST and never shrank, so up to 256 MiB of idle device-local bytes stayed committed while the texture queue refused uploads at the budget line. On an 8 GB card that is a quarter of a gigabyte the working set fights for; every committed byte of it is in the card's CurrentUsage, and nothing credits it as free.

The trim gives the pool back whole when the card's memory is under pressure (the buffers re-make on demand in linear_buffer, their contents are whatever the last texture left); Drop keeps filling it in ordinary times, as before.

Tests

the_spare_detile_pool_trims_whole: a pooled detile target of the pool's own making goes in, the trim empties it (bytes and map). Needs a GPU, skips without one.

cargo test -p victory-gpu --lib --locked the_spare_detile_pool: 1 passed, 0 failed.

Environment

Windows 11, RTX 4060 Ti (8 GB), Rust 1.98.1 (pinned).

**@⁠sh3nw4ld** on GitHub · 2026-11-29 15:15 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2633) `sh3nw4ld:fix-spare-linear-trim` → `main` · +180 −60 · 32 files · 6 commits · merged 2026-11-30 14:12 UTC ## What this fixes The pressure sweep trimmed every sibling spare pool — uploads, chunks, read-backs, the send bar, the UAV spare — and the spare detile targets it did not touch: `SPARE_LINEAR` grew to `LINEAR_POOL_MOST` and never shrank, so up to 256 MiB of idle device-local bytes stayed committed while the texture queue refused uploads at the budget line. On an 8 GB card that is a quarter of a gigabyte the working set fights for; every committed byte of it is in the card's `CurrentUsage`, and nothing credits it as free. The trim gives the pool back whole when the card's memory is under pressure (the buffers re-make on demand in `linear_buffer`, their contents are whatever the last texture left); `Drop` keeps filling it in ordinary times, as before. ## Tests `the_spare_detile_pool_trims_whole`: a pooled detile target of the pool's own making goes in, the trim empties it (bytes and map). Needs a GPU, skips without one. `cargo test -p victory-gpu --lib --locked the_spare_detile_pool`: 1 passed, 0 failed. ## Environment Windows 11, RTX 4060 Ti (8 GB), Rust 1.98.1 (pinned).
The sweep trimmed every sibling spare pool when the card's memory was
under pressure, and this one it did not: up to LINEAR_POOL_MOST of
idle device-local bytes stayed committed while the texture queue
refused uploads at the budget line — on an 8 GB card, a quarter of a
gigabyte the working set fights for. The buffers re-make on demand,
so the trim gives them back whole; the test fills the pool with one
of its own and empties it.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 15:19:41 +00:00
github-bot force-pushed github-bot/gh-2633 from 7db2eea742 to 62477e2cf0 2026-11-29 15:35:58 +00:00 Compare
Author
Owner

@⁠dyshay on GitHub · 2026-11-29 15:40 UTC · original

Merged into our fork's integration branch for testing (dyshay/VIctory-NVIDIA, branch janus-prs). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with --profile diag --features diagnostics, and the CPU tests of the touched crates pass. Runs on an RTX 4090 are queued (Series X 1440p, and Series S with ray tracing, DLSS Quality). Frame times will follow here.

**@⁠dyshay** on GitHub · 2026-11-29 15:40 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2633#issuecomment-7258271321) Merged into our fork's integration branch for testing ([dyshay/VIctory-NVIDIA](https://github.com/dyshay/VIctory-NVIDIA/tree/janus-prs), branch `janus-prs`). I read the full diff first: no network access, process spawning, binaries, build or dependency changes, or game data. It builds with `--profile diag --features diagnostics`, and the CPU tests of the touched crates pass. Runs on an RTX 4090 are queued (Series X 1440p, and Series S with ray tracing, DLSS Quality). Frame times will follow here.
github-bot force-pushed github-bot/gh-2633 from 62477e2cf0 to 999b9bb256 2026-11-29 15:47:14 +00:00 Compare
github-bot force-pushed github-bot/gh-2633 from 999b9bb256 to df09b4c52e 2026-11-29 16:04:21 +00:00 Compare
github-bot force-pushed github-bot/gh-2633 from df09b4c52e to 8da1528d50 2026-11-29 16:21:19 +00:00 Compare
github-bot force-pushed github-bot/gh-2633 from 8da1528d50 to 308fe0ff72 2026-11-29 16:26:55 +00:00 Compare
github-bot changed target branch from main to gh-pr/2633/base 2026-11-30 14:17:13 +00:00
github manually merged commit 308fe0ff72 into gh-pr/2633/base 2026-11-30 14:17:15 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2633
No description provided.