gpu: scale texture VRAM floor and per-frame staging budget from VRAM #45

Open
fever308 wants to merge 2 commits from upstream-pr/45 into main
fever308 commented 2026-11-24 20:53:21 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by fever308 on 2026-11-24T20:53:21Z.


Summary

 State::heap_textures()
+  memory = host.video_memory()
-  per_frame = 192 MiB
+  per_frame = staging_budget_per_frame(memory.budget)   # 96 / 192 / 256 / 384 MiB
-  room = resource::room()                               # 2nd video_memory() query + fixed 2 GiB floor
+  room = resource::room(memory)                         # floor = min(2 GiB, budget / 4)

Evidence

  • Before: Fixed 2 GiB unconditional host-texture floor (bypassing the 90% VRAM budget guard on 4–6 GiB adapters) and fixed 192 MiB per-frame staging cap.
    After:
    • cargo test -p victory-gpu scales_with_vram_budget: 2 passed (staging_budget_scales_with_vram_budget, texture_floor_scales_with_vram_budget), 0 failed.
    • cargo clippy -p victory-gpu --all-targets -- -D warnings (default and --all-features): clean.

Merge Danger

Door: two-way

Scoped to draw.rs and resource.rs; VICTORY_TEXTURE_BUDGET_MB still overrides admission directly.

Blast Radius: Textures

Adjusts host texture admission floor on < 8 GiB cards and per-frame texture upload pacing across VRAM tiers.

<!-- greyfinch-sync:fxceless/victory-fork:issue:6591187674 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/45). Originally posted by [fever308](https://github.com/fever308) on 2026-11-24T20:53:21Z. --- ## Summary ```diff State::heap_textures() + memory = host.video_memory() - per_frame = 192 MiB + per_frame = staging_budget_per_frame(memory.budget) # 96 / 192 / 256 / 384 MiB - room = resource::room() # 2nd video_memory() query + fixed 2 GiB floor + room = resource::room(memory) # floor = min(2 GiB, budget / 4) ``` ## Evidence - **Before:** Fixed `2 GiB` unconditional host-texture floor (bypassing the 90% VRAM budget guard on 4–6 GiB adapters) and fixed `192 MiB` per-frame staging cap. **After:** - `cargo test -p victory-gpu scales_with_vram_budget`: 2 passed (`staging_budget_scales_with_vram_budget`, `texture_floor_scales_with_vram_budget`), 0 failed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings` (default and `--all-features`): clean. ## Merge Danger **Door:** two-way Scoped to `draw.rs` and `resource.rs`; `VICTORY_TEXTURE_BUDGET_MB` still overrides admission directly. **Blast Radius:** Textures Adjusts host texture admission floor on `< 8 GiB` cards and per-frame texture upload pacing across VRAM tiers.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/45:upstream-pr/45'
git switch 'upstream-pr/45'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/45'
git switch 'upstream-pr/45'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/45'
git switch 'upstream-pr/45'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/45'
git switch 'main'
git merge --squash 'upstream-pr/45'
git switch 'main'
git merge --ff-only 'upstream-pr/45'
git switch 'main'
git merge 'upstream-pr/45'
git push origin 'main'
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
fxceless/victory-fork!45
No description provided.