RX_VK_VRAM_MB and the integrated-GPU cap win over a preset's texture budget #1376
No reviewers
Labels
No labels
accessibility
autorelease: pending
autorelease: tagged
bug
dependencies
documentation
duplicate
enhancement
github_actions
good first issue
help wanted
invalid
question
testing wanted
wontfix
No milestone
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Hookshot!1376
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/preset-texture-budget-overrides"
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?
What
RX_VK_VRAM_MBand the integrated-GPU texture cap now win over a quality preset's texture budget.Why
In
texture_frame, a preset'svram_mbreplacedownoutright:ownis whereRX_VK_VRAM_MBand the 2560 MB cap for integrated GPUs (added in v2.0.11 for the 16 GB Radeon 780M laptop that ran out of RAM) are applied. So with any preset on:RX_VK_VRAM_MBdid nothing, with no word in the log. The mirrors'RX_VK_MIRROR_MBdoes win over the preset (mirror_budget), so the two budgets disagreed.preset_caps_memoryis true there whenever the shared heap is at most the preset's size + 768 MB, and the 75% clamp doesn't help, because what the driver allows is large too.How
preset_texture_budget(preset_mb, preset_applies, vram_env, integrated, own):RX_VK_VRAM_MBwins over a preset.own.Testing
tests/test_preset_texture_budget.pyextracts the helper and covers six cases: a preset on its card,RX_VK_VRAM_MBwith a preset, an integrated GPU on a large and on a small preset, Custom, and a preset for a smaller card. It fails on the old rule (RX_VK_VRAM_MB wins: 2200 MB, expected 1500,integrated GPU capped: 4800 MB, expected 2560).python -I -B tests/run_all.py preset_texturepasses.hookshot_vk.dllbuilds onmain(llvm-mingw,RX_VK_ONLY=1).Looks right to me. The old line threw away
own, so the integrated-GPU cap andRX_VK_VRAM_MBnever applied while a preset was on. Now the texture budget goes through the same rule asmirror_budget(): the env var wins, the preset only counts on a card it's meant for, and an iGPU never goes past its 2560 MB. On a dedicated card on its own preset nothing changes, and the 75% clamp is still limited to the preset path. The test runs the real helper, makes suretexture_frameactually calls it, and is picked up byrun_all.py's glob, so theARGSentry is fine.Checked against #1358 (Custom keeps the preset's budgets via
opts.budget): the two don't touch the same files, and they fit together. After #1358,opts.vram_mbstays set in Custom more often, and this PR makes sure that kept budget still gives way toRX_VK_VRAM_MBand the iGPU cap. Either merge order works.Small things, none blocking:
own,preset_budgetis still true, so the 75%-of-allowed clamp also runs onown. It can only lower the budget andallowedis big on shared memory, so it makes no practical difference. Just noting it's a small difference from the Custom path.vram_envis checked twice, once inpreset_budgetand again inside the helper. Both checks are needed: the first keeps the clamp off and the second keeps the test meaningful. A short note at the call site would save the next reader from wondering.No CI checks ran on this branch, so I'm going by reading the code.
Nit: nothing outside this file uses it, so it could be
static(or go in one of the anonymous namespaces) to keep it out ofmkwvk's external symbols. The test extracts it by text, so it doesn't care either way.