WIP: fix(vk): cut a texture cache far over the VRAM rules to 7/8 of their budget #519
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/upscaling
beanstalk: approved @ 1697603
beanstalk: approved @ 2c5a62e
beanstalk: approved @ 4fd82b7
beanstalk: approved @ 64d6d09
beanstalk: approved @ 6f91fae
beanstalk: approved @ 70a78f9
beanstalk: approved @ 8d361dc
beanstalk: approved @ 9d8356e
beanstalk: approved @ abf2227
beanstalk: approved @ d82f202
beanstalk: approved @ e5f1e40
beanstalk: approved @ ee8ab5f
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
testing wanted
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!519
Loading…
Reference in a new issue
No description provided.
Delete branch "Amateurwizrd/Longshot:fix/vram-excess-cut"
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?
Why
When an area keeps the texture cache far over the 90% rule's or the driver's limit, the rules let go of only the excess
and 64 MB more, so the cache sits at the line and every pass is another eviction, with what went uploaded again: a
stutter that does not stop while the player stays there.
What changed
vram_compact::rule_targetingpu/vk/vram_compact.hkeeps the trim for an excess of up to a sixteenth of therule's budget (
kExcessSmall), so a cache a few MB over the line still does not lose an eighth of its textures; alarger excess is cut to 7/8 of that budget, as before the trim. The budget's own size still asks for its 7/8, and
RX_VK_EVICT_EXCESS=0(the cut on any excess) is unchanged.tests/test_vram_compact.cppchecks the large excess, a grid of budgets and excesses around the edge, and azero budget.
docs/development.md'sRX_VK_EVICT_EXCESSrow says what the default does now.Flags and settings
RX_VK_EVICT_EXCESS=0Measurements
main:
9c9d69ed(2026-11-14)this PR: fix/vram-excess-cut @
bf3637f2Hardware: RTX 5070 Ti 16 GB, driver 621.01, Ryzen 7 7800X3D, 32 GB, Windows 11 Pro 26200
Scene: none (game-free check)
Method: the new test cases, run 2 times on each side, interleaved (main, this PR, main, this PR); main gets this PR's
tests/test_vram_compact.cppwithkExcessSmallwritten as its value, 16, since main has no such constantHow to reproduce:
python -I -B tests/run_all.py vram_compacton this branch, and on main with the test file copied in andb / kExcessSmallreplaced byb / 169c9d69edbf3637f2rule_target(4022 MB, 4096 MB, 3639 MB): a 383 MB excess over a 3639 MB rule budgetTesting
Tested:
python -I -B tests/run_all.pyon Windows 11 (llvm-mingw): main @9c9d69ed531 passed, 5 failed; this PR530 passed and the same 5 failing on main (
test_oot_state_tap,test_portable_builder_home,test_portable_builder_startup,test_tested_configurations,test_walk_key), plustest_gpu_hang_watch, whichfails and passes on reruns of main @
9c9d69editself (a 4 s timing bound) and passed alone on this branch. The rendererbuilds.
Not tested: the game on a card whose cache goes far over the line (a 16 GB card never got there in the scenes
tried); a Linux build (no Linux machine here).
Needs other testers:
gpu/vk/vram_compact.h(request to open)Screenshots
Nothing on screen
Risk and rollback
A cache far over the line loses an eighth of its textures at once again, as before the trim, which is one larger burst
of uploads instead of an eviction every pass.
RX_VK_EVICT_EXCESS=0cuts on any excess; reverting the commit restoresthe trim for every excess.
Reviewer notes
The rule was first seen in Hookshot-old's 030b4e9a, reported there for Lake Hylia on a 10 GB card (383 MB over at each
pass) and not reproduced here; the code and the edge cases are written for Longshot.
Issues
None
Checklist
For everyone
type(scope): description).main.python -I -B tests/run_all.pyrun and passing (any failure that also fails onmainis named above).third_party/untouched (a new folder with aPROVENANCE.mdinstead).If applicable
Assisted-by:/Co-Authored-By:trailers.mainand passing here.tests/that reads changed source updated in this PR, not weakened.bf3637f22e4a39da2cdeRebased onto
main@bbe6fdf2. No tests were run here; the test boxes stay yours. One conflict in docs/development.md: main rewrote the commit-reserve rows next to theRX_VK_EVICT_EXCESSrow, so main's rows are kept and only theRX_VK_EVICT_EXCESStext is this PR's.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.