feat(vk): 6 GB cards at Low leave out the big textures' top levels #3024

Merged
HumanBean merged 1 commit from HumanBean/Longshot:feat/six-gb-texture-mips into main 2026-12-02 18:51:52 +00:00
Owner

Summary

On a 6 GB card, textures may take about 3.5 GB and the mirrors up to 1.7 GB, beside render targets, buffers and pipelines. Cards the driver allows 4.5 GiB or less already leave the top mip level out of big decoded ASTC textures at Minimum settings. This gives 6 GB cards the same limits at Low (what Auto (this PC) picks for them) and Minimum: textures wider than 1024 that would take over 8 MB as RGBA8 lose top levels.

A 6 GB card here is a discrete GPU with more than 4.5 and at most 6.5 GiB of its own memory (mirror_rule::six_gb_card). Balanced and up keep the full textures, and RX_VK_LOW_VRAM_MIPS=0 turns it off. The small BC3 scratch is chosen as before.

Read first: six_gb_texture_mips in gpu/vk/vk_texture.cpp.

Testing

Tested: nothing. Not compiled, no tests run, not run in the game (asked to open it without testing).

Still to test:

  • Linux and Windows: build, then tests/test_low_vram_texture_mips.py (six new cases), expecting a pass (by hand or CI).
  • A 6 GB card, Low settings, Hyrule Field and the Market: the log's vk: budget: line shows less texture memory than main, textures look acceptable up close, no new artefacts (@Beanstalk with a 6 GB tag, or by hand).

Measurements

Verdict: none yet. How much VRAM this saves on a 6 GB card, and what it does to the picture and frame rate, is unmeasured.

Risks

  • Visibly softer big textures on 6 GB cards at Low, which is the setting they get by default. This is the main thing to judge before merging.
  • A revert is enough; RX_VK_LOW_VRAM_MIPS=0 turns it off. No cache or save changes.

Checklist

Ready for review

  • One topic, on current main; the title is a Conventional Commit.
  • Tested on my own PC, in the game for a change the game runs, as Testing says. (Not tested.)
  • mise run test passes (any failure that also fails on main is named). (Not run.)
  • Measured against main, or Measurements says why there is nothing to measure. (Not measured.)
  • No game files, build output or hand-edited generated files; third_party/ untouched; nothing GPL-incompatible.

πŸ€– Generated with Claude Code

## Summary On a 6 GB card, textures may take about 3.5 GB and the mirrors up to 1.7 GB, beside render targets, buffers and pipelines. Cards the driver allows 4.5 GiB or less already leave the top mip level out of big decoded ASTC textures at Minimum settings. This gives 6 GB cards the same limits at Low (what Auto (this PC) picks for them) and Minimum: textures wider than 1024 that would take over 8 MB as RGBA8 lose top levels. A 6 GB card here is a discrete GPU with more than 4.5 and at most 6.5 GiB of its own memory (`mirror_rule::six_gb_card`). Balanced and up keep the full textures, and `RX_VK_LOW_VRAM_MIPS=0` turns it off. The small BC3 scratch is chosen as before. Read first: `six_gb_texture_mips` in `gpu/vk/vk_texture.cpp`. ## Testing **Tested:** nothing. Not compiled, no tests run, not run in the game (asked to open it without testing). **Still to test:** - Linux and Windows: build, then `tests/test_low_vram_texture_mips.py` (six new cases), expecting a pass (by hand or CI). - A 6 GB card, Low settings, Hyrule Field and the Market: the log's `vk: budget:` line shows less texture memory than `main`, textures look acceptable up close, no new artefacts (@Beanstalk with a 6 GB tag, or by hand). ## Measurements **Verdict:** none yet. How much VRAM this saves on a 6 GB card, and what it does to the picture and frame rate, is unmeasured. ## Risks - **Visibly softer big textures on 6 GB cards at Low,** which is the setting they get by default. This is the main thing to judge before merging. - A revert is enough; `RX_VK_LOW_VRAM_MIPS=0` turns it off. No cache or save changes. ## Checklist ### Ready for review - [ ] One topic, on current `main`; the title is a Conventional Commit. - [ ] Tested on my own PC, in the game for a change the game runs, as Testing says. (Not tested.) - [ ] `mise run test` passes (any failure that also fails on `main` is named). (Not run.) - [ ] Measured against `main`, or Measurements says why there is nothing to measure. (Not measured.) - [ ] No game files, build output or hand-edited generated files; `third_party/` untouched; nothing GPL-incompatible. πŸ€– Generated with [Claude Code](https://claude.com/claude-code)
feat(vk): 6 GB cards at Low leave out the big textures' top levels
Some checks failed
CI / What the change needs (pull_request) Successful in 12s
CI / Third-party parts and guide screenshots (pull_request) Failing after 11s
PR description / Title and description (pull_request_target) Failing after 7s
CI / Lint (pre-commit, ShellCheck, actionlint) (pull_request) Successful in 16s
CI / Website build and checks (pull_request) Failing after 37s
CI / Rust (rustfmt, clippy, cargo test, end to end) (pull_request) Successful in 4m10s
CI / Host C for Windows (llvm-mingw, compile only) (pull_request) Successful in 1m56s
CI / Renderer build check (Windows, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m42s
CI / Renderer build check (Linux, compile --only renderer, without and with FSR 4) (pull_request) Successful in 4m51s
CI / Game-free checks (run_all.py, part 1/2) (pull_request) Failing after 16m5s
CI / Game-free checks (run_all.py, part 2/2) (pull_request) Failing after 40m16s
a2f102e51d
The limits of the low-VRAM rule (1024 wide, from 8 MB as RGBA8) on a
discrete card of 4.5 to 6.5 GiB at Low or Minimum settings.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Member

Possibly related, for context:

  • issue #939 Game: on a 6 GB card VRAM goes over the driver's allowance after a few area changes, Hyrule Field falls from 31 to 14 fps until a restart (GTX 1060, nightly-189) β€” Reports sustained VRAM over-budget and FPS drops on a 6 GB GTX 1060; this targets 6 GB texture use.
  • issue #586 Idea: Smaller Texture Size for 4GB VRAM β€” Requests skipping top texture mip levels to reduce VRAM on small cards.
  • PR #1987 perf(vk): a BC3-kept ASTC texture's mip levels re-encode in groups, on by default β€” Merged Vulkan texture mip-level work and low-VRAM mip policy precedent.
  • PR #1388 perf(vk): Custom with no preset behind it trims the large textures where Auto would pick Minimum β€” Merged change established low-VRAM mip trimming policy for Auto/Minimum tiers.
Possibly related, for context: - issue #939 Game: on a 6 GB card VRAM goes over the driver's allowance after a few area changes, Hyrule Field falls from 31 to 14 fps until a restart (GTX 1060, nightly-189) β€” Reports sustained VRAM over-budget and FPS drops on a 6 GB GTX 1060; this targets 6 GB texture use. - issue #586 Idea: Smaller Texture Size for 4GB VRAM β€” Requests skipping top texture mip levels to reduce VRAM on small cards. - PR #1987 perf(vk): a BC3-kept ASTC texture's mip levels re-encode in groups, on by default β€” Merged Vulkan texture mip-level work and low-VRAM mip policy precedent. - PR #1388 perf(vk): Custom with no preset behind it trims the large textures where Auto would pick Minimum β€” Merged change established low-VRAM mip trimming policy for Auto/Minimum tiers.
HumanBean changed title from WIP: feat(vk): 6 GB cards at Low leave out the big textures' top levels to feat(vk): 6 GB cards at Low leave out the big textures' top levels 2026-12-02 18:51:49 +00:00
HumanBean deleted branch feat/six-gb-texture-mips 2026-12-02 18:51:53 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/Longshot!3024
No description provided.