GPU: retry texture staging with smaller blocks after out-of-memory #1472

Merged
yumaste merged 2 commits from upstream-pr/1472 into main 2026-11-30 14:12:04 +00:00
yumaste commented 2026-11-28 20:26:31 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by yumaste on 2026-11-28T20:26:31Z.


Replaces #986, rebased onto 923e38cc. Port of Marvisak/VIctory#3259.

The staging pool starts with 64 MiB blocks. If D3D12 returns E_OUTOFMEMORY, retry with smaller blocks down to the request rounded to 64 KiB. Reuse a successful smaller size for 500 ms and account for its actual capacity when suballocating, reclaiming, and reporting memory. Block creation still runs outside the pool lock, and speculative growth keeps the existing budget check.

Windows / WARP: cargo test --locked -p victory-gpu --lib --features diagnostics pool::tests -- --test-threads=1 passed 18 tests, with 2 benchmarks ignored. The tests cover allocation refusals, reuse of smaller blocks, recovery to the default size, and concurrent staging.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5544264116 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1472). Originally posted by [yumaste](https://github.com/yumaste) on 2026-11-28T20:26:31Z. --- Replaces #986, rebased onto `923e38cc`. Port of Marvisak/VIctory#3259. The staging pool starts with 64 MiB blocks. If D3D12 returns `E_OUTOFMEMORY`, retry with smaller blocks down to the request rounded to 64 KiB. Reuse a successful smaller size for 500 ms and account for its actual capacity when suballocating, reclaiming, and reporting memory. Block creation still runs outside the pool lock, and speculative growth keeps the existing budget check. Windows / WARP: `cargo test --locked -p victory-gpu --lib --features diagnostics pool::tests -- --test-threads=1` passed 18 tests, with 2 benchmarks ignored. The tests cover allocation refusals, reuse of smaller blocks, recovery to the default size, and concurrent staging.
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!1472
No description provided.