Reclaim idle textures when the texture budget fills #512
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/512"
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 Belobug/VIctory-Belobug-AMD. Originally posted by suren1013 on 2026-11-27T07:58:20Z.
No description provided.
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by MamaLeVrai on 2026-11-27T11:40:28Z.
Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At
d58c262:victory-gpu398 passed, 1 failed, 34 ignored. The failure,watch::tests::a_view_mapped_beside_a_guarded_one_makes_it_check_again, did not come back in 10 runs alone, here or on the base. It is awatchflake (#450 fixes them), not this PR.AI-assisted (Claude Code); no game data.
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-27T13:08:44Z.
Review: COMMENTED
AI-assisted review. I checked the texture-budget boundary handling and left one input-validation edge case inline.
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by gut0to on 2026-11-27T13:08:45Z.
Code review location:
crates/victory-gpu/src/resource.rs; line 1785AI-assisted review: A left shift here silently discards high bits when the parsed MiB value exceeds u64::MAX / (1 << 20), so an extreme but valid u64 input can become a much smaller budget (or zero) and change eviction behavior. Could this use checked_mul(1 << 20) and treat overflow as an invalid setting, with a boundary test?
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by Gabriel-Ramaldes on 2026-11-27T13:33:00Z.
In-game test on AMD RDNA 4 with 32 GB, at
d58c262(a-publier4eb6cfd+ this PR).Setup:
cargo test --locked -p victory-gpu --lib -- --test-threads=1: 399 passed, 0 failed, 34 ignored.scripts\play.ps1's settings (Series X), the same manual save restored before each run (balcony, ~6,500 draws), 300 s, warm-up first, mirrored order.VICTORY_TEXTURE_BUDGET_MB=6144. That is below the ~7-8 GB of host textures this scene ends with on4eb6cfdwithout a budget.VICTORY_TEXTURE_BUDGET_MB=6144)memory:line)4eb6cfd* The second run of the PR ended on another camera (11,100 draws against ~6,500), so its frame time is not comparable.
filled_texture_bytes(), so this may be expected, but on this PC the switch did not lower memory.victory-image-…dll+0x2215c35, write 0x0, before the world). #386's build had one too, the same day.AI-assisted (Claude Code); no game files.
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by suren1013 on 2026-11-27T14:17:36Z.
Thanks for the detailed run. The shorter stalls in both completed runs are noted, though two runs aren't enough to conclude much.
How did you pass the budget? It looks like play.ps1 clears inherited VICTORY_* variables, so it may need -More @{ VICTORY_TEXTURE_BUDGET_MB = '6144' }. If you already did that, please ignore this.
If the budget was active, it would also help to compare the budget's own counter with DXGI memory usage on a fixed camera, if the build can print them. I'm keeping this PR as a draft until the budget is shown to hold.
Imported from Belobug/VIctory-Belobug-AMD. Originally posted by suren1013 on 2026-11-27T14:20:20Z.
Code review location:
crates/victory-gpu/src/resource.rs; line 1785Fixed in
5ad5246: the conversion now uses checked_mul, and an out-of-range value falls back to the default budget behavior, like any other invalid setting. The new test covers the largest valid MiB value and the first overflowing value. Unit tests only so far; the full GPU suite hasn't been run on Windows yet, and this hasn't been run in-game.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.