Intel GPUs that sample ASTC natively: the texture budget counts those textures 16 to 144 times too big #2333
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#2333
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
Hookshot version
main
49f75dc8, built from sourceWhat kind of problem
Something else
What happened
Intel GPUs sample ASTC textures directly, and the texture budget counts each of those textures 16 to 144 times too big. On an Intel UHD 770 the count in Kokiri Forest reached 17.6 GB against the integrated GPU's 2.5 GB budget, while the whole process held 4.8 GB of GPU memory. So the texture cache keeps evicting textures it has room for.
Expected: a count near what the textures take.
The cause, in
gpu/vk/vk_texture.cppcreate: for an ASTC image that the GPU samples natively the budget counts texels, but with the size of a whole block (16 bytes) for each. A texture with 4x4 blocks counts 16 times its size, one with 12x12 blocks 144 times. GPUs that decode ASTC on upload (NVIDIA and AMD) are not affected.Where in the game
Kokiri Forest, after loading a save
How often
Every time
Graphics card and driver version
Intel UHD 770, Mesa 26.2.5
CPU, RAM and operating system
i9-13900K, 93 GB, Arch Linux
Changes from the defaults
None
Other software hooked into the game
No, nothing hooked in
hookshot_log.txt
The lines that show it on main:
textures 17608 MB (budget 2560 MB)beside4884 MB usedfor every allocation of the process together. With the fix the same scene counts2241 MB (budget 2560 MB).Claim
I'm working on this: #2288 is open with the fix and its test; it belongs under #999. Open pull requests in the same file: #1569 (the dynamic iGPU budget, which only means something once the count is right), #2198 and #2226 merge cleanly with it; #1892 conflicts with it textually in
vk_texture.cpp. Bydocs/workflow.md: S2 (3) at most, since I measured the count and not what the needless evictions cost in play; reach: Intel GPUs that sample ASTC natively (Tier 2); confidence 1.0 for the count. I can test on Linux with an RTX 4090 (NVIDIA 615.78.08) and an Intel UHD 770 (Mesa 26.2.5), not on Windows or AMD.