gpu: add VICTORY_TEXTURE_MAX and VRAM-budget mip cap for 8 GB cards #318
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/readmet3xt-lab--foxhound!318
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-318"
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?
@neversuptou on GitHub · 2026-12-01 13:11 UTC · original
neversuptou:pr-texture-max→main· +14 −47 · 1 files · 73 commits · closed without mergingSummary
Implements the VRAM-budget mip cap discussed in #68 to reduce PC-memory texture spill on 8 GB GPUs:
VICTORY_TEXTURE_MAX=<n>(0disables capping; any positive value sets a fixed max texture side in pixels).moment()tick):< 95%: 1024 px>= 95%: 512 px>= 98%: 256 pxbase_level()path incrates/victory-gpu/src/resource.rs(preserving BC block alignment and tail mip layout) and applies the same floor inwant_level()to prevent thrashing when views request mip 0.Testing
texture_max_side_follows_vram_budget_and_overrideandover_cap_skips_mips_down_to_cap.cargo test --locked -p victory-gpu --lib -- --test-threads=1 over_cap texture_max_side a_placed_texture_is_kept_from_the_level_viewed(3 passed, 0 failed).VICTORY_TEXTURE_MAX=512) — kept VRAM within budget and eliminated spill stalls.@Aniseto on GitHub · 2026-12-01 13:18 UTC · original
Ran the named
over_cap/texture_max_side/a_placed_texture_is_kept_from_the_level_viewedtests at80dd4c0on an NVIDIA Blackwell desktop part with 16 GB of VRAM.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own
CARGO_TARGET_DIR, no local patches.All three named tests pass here, including
texture_max_side_follows_vram_budget_and_overrideandover_cap_skips_mips_down_to_cap. The description's in-game check was on an 8 GB RTX 5060; this card has 16 GB of VRAM and 64 GB of host RAM, so the budget-driven cap path was exercised only by the synthetic tests, not by a scene that approaches the limit.Not tested: the full workspace suite, a retail title, VRAM spill on an 8 GB card,
VICTORY_TEXTURE_MAXin a scene, Wine, AMD adapters, release profile, game data.AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@readmet3xt-lab on GitHub · 2026-12-01 14:32 UTC · original
Thanks. The explicit switch is welcome; the default is the problem.
With
VICTORY_TEXTURE_MAXunset,texture_max_sidereturns 1,024 for any card below 95% of its budget, so every streamed 2D texture is cut to 1,024 pixels on every card, a 12 or 16 GB card with room to spare included. That takes detail from everyone to help the cards that are full, and the project does not trade fidelity away on cards that have the room.It can come in one of two ways:
VICTORY_TEXTURE_MAX=<n>as you have it, and no cap when it is unset. The launcher can then offer it on small cards.Either way, please keep it on the same road as the existing level mechanisms in
resource.rs(the level a view asks for, and textures made from their small levels when there is no room) so there are not three rules deciding a texture's first level; another change in that area is in progress and I can point to where they meet. A before/after on an 8 GB card with the fps line and the card-memory line would be the measurement that decides it.@Aniseto on GitHub · 2026-12-01 14:53 UTC · original
This is a new response on the same thread as my report at
80dd4c0(#318); the head moved to5be3373(the cap is now explicit-only, no cap whenVICTORY_TEXTURE_MAXis unset), so I am not editing that comment.Ran the named
over_cap/texture_max_side/a_placed_texture_is_kept_from_the_level_viewedtests at5be3373on an NVIDIA Blackwell desktop part with 16 GB of VRAM.Environment: Windows 11 Pro build 26200 x64, NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, 16 GB, mesh shaders) driver 32.0.16.2140 (621.40), Intel Core i5-12400F, 64 GB RAM, rustc 1.98.1 (48a229cea 2026-09-01), MSVC 14.44.35207, debug build, detached worktree at the exact PR head, own
CARGO_TARGET_DIR, no local patches.The same three tests still pass at the new head, with the same counts as at
80dd4c0. The description's in-game check was on an 8 GB RTX 5060; this card has 16 GB and no title was run.Not tested: the full workspace suite, a retail title, VRAM spill on an 8 GB card,
VICTORY_TEXTURE_MAXin a scene, Wine, AMD adapters, release profile, game data.AI-assisted (OpenCode), model: MiMo-V2.6-Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
@neversuptou on GitHub · 2026-12-01 15:02 UTC · original
Measured A/B on the RTX 5060 8 GB with the explicit-only build (same switches, cap removed vs
VICTORY_TEXTURE_MAX=512): VRAM settled at ~82% of budget in both runs (5663/6880 vs 5656/6874 MB), nono room for morestalls, no E_OUTOFMEMORY, and frame times were scene-bound rather than texture-bound — the cap never engaged because the card was never near full. Median fps 18.9 (uncapped run) vs 30 (capped run) reflects a lighter scene in the second run, not the cap: the uncapped run carried ~13 ms/frame of copies against ~4.8 in the capped one.For contrast, the same card without the whole current patch set — and with the old always-on 1024 default absent — did fill the card:
textures picked by index: the card has no room for more; they waitplusE_OUTOFMEMORY (0x8007000E)on pipeline creation, with dips to 3 fps. So the cap is a tool for cards that actually fill; on this title the card sits at ~82% either way, and the explicit switch is the right shape.Happy to align with the in-progress resource.rs level work when you can point me to where it lands.
Pull request closed