fix(vk): shorten the rendered-texture keep near the VRAM limit on AMD too #961
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!961
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/keep-rendered-at-limit"
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 changed
An unused texture the GPU drew (a render target the game may sample later) is kept for 3600 presents before the eviction
pass lets it go, or for 600 when the process is "over what the driver allows":
AMD's driver never reports the process's use of the device heap above what it allows. Once the VRAM is full it reports
exactly the limit (
VRAM: 6940 MB used of 6940 MB allowedin the log, line after line, while VMA alone held up to 6.4 GBand the rest of the process's VRAM came on top). So
used > allowedis never true on AMD, and the shorter keep neverapplies there.
The 600 now starts at the same line the texture budget already uses, 97% of what the driver allows. The rule is in
gpu/vk/keep_rendered.h.RX_VK_KEEP_RENDERED_OVER=1restores the old condition. Nothing changes below 97%, and nothingchanges on drivers that report usage past the limit.
Why
Without it, an 8 GB AMD card slowly fills up during play. In a ~12-minute session (Hyrule Field, Lon Lon Ranch, Hyrule
Castle Town) the log showed:
6940 of 6940 MBfor most of the session;paging VRAM to system memory, and the game went to stutters until the area was reloaded.
How it was tested
RX 7700S Laptop (8 GB, 6.9-7.1 GB allowed by the driver), Ryzen 7 7735HS, Adrenalin 26.10.1, Windows 11, v2.0.5. Played
normally (field, ranch, market) for about 12 minutes per build.
The local build that fixed it carried this condition together with other VRAM changes that are separate PRs (#899's
3-frame update and BC3 for large ASTC textures on 8 GB cards). I can't isolate this one's share of the fps. What this
change does on its own, the logs show directly: before it, the rendered textures were never let go under the 600-present
rule while the VRAM sat at the limit; with it, they go, and the GPU time no longer creeps up over the session (median
9.3 ms, p90 13.2 ms, no paging slowdowns). The player reported no degradation over time.
Game-free check:
tests/test_keep_rendered.pycompilestests/test_keep_rendered.cppagainst the rule (unknown usage, farfrom the limit, under and at 97%, the clamped report, past the limit, and the old rule behind the switch). It also checks
that the eviction pass still uses the rule. It is listed in
tests/run_all.pywith--cxx g++, in a different spot from#899 and #900 so they don't conflict.
🤖 Generated with Claude Code