texture: the spare detile pool trims under pressure #2633

Merged
sh3nw4ld merged 6 commits from upstream-pr/2633 into main 2026-11-30 14:12:01 +00:00
sh3nw4ld commented 2026-11-29 15:15:30 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by sh3nw4ld on 2026-11-29T15:15:30Z.


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).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5552076709 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2633). Originally posted by [sh3nw4ld](https://github.com/sh3nw4ld) on 2026-11-29T15:15:30Z. --- ## 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).
dyshay commented 2026-11-29 15:40:08 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by dyshay on 2026-11-29T15:40:08Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7258271321 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2633#issuecomment-7258271321). Originally posted by [dyshay](https://github.com/dyshay) on 2026-11-29T15:40:08Z. --- 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.
Sign in to join this conversation.
No reviewers
No labels
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.

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