WIP: fix(vk): decode ASTC on the CPU for the Radeon 860M #1296
No reviewers
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
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
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot!1296
Loading…
Reference in a new issue
No description provided.
Delete branch "TrashPanda/Longshot:fix/astc-cpu-860m"
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?
Type: fix · Risk: low · Tested on: Linux, game-free only (g++ and clang++) · Needs: Windows, Radeon 860M
Why
A Radeon 860M (PCI 1002:1114) loses the device in Kokiri Forest while the GPU decodes two 1365x1365x90 ASTC arrays. The same arrays already force CPU decode on the Ryzen 7000 and 9000 desktop iGPUs (PCI 1002:164E and 1002:13C0). The 860M was not in that list, so it still used the GPU decoder.
RX_VK_ASTC_CPU=1avoids the loss. See #1040.The 4,096 MB integrated-GPU texture cap is unchanged. CPU decode stores those arrays as RGBA8, about 5.2-6 GB, so a 32 GB PC can still thrash until
RX_VK_VRAM_MBis raised. That cap applies to every integrated GPU.How to reproduce
Seen on: Windows 11, Radeon 860M (1002:1114), AMD driver 26.10.1, 32 GB RAM. Reported in #1040. Not run on this PC.
Settings and switches: defaults. No
RX_VK_ASTC_CPU.Steps: load Kokiri Forest so the two 1365x1365x90 terrain arrays decode on the GPU.
Expected: the area loads. The log says ASTC is decoded on the CPU.
Actual:
VK_ERROR_DEVICE_LOSTafter the GPU stalls on those arrays.What changed
On Windows,
astc_on_cpu()ingpu/vk/vk_texture.cppalso defaults to the CPU for PCI 1002:1114.RX_VK_ASTC_CPU=0still forces the GPU decoder, and=1still forces the CPU on every GPU. Other APUs (680M, 780M, 890M) are unchanged. The texture budget is unchanged.Measurements
Verdict: the game-free check fails on main and passes here. No game run. Nothing was measured in Kokiri Forest.
Before: main @
e37ee60c,python -I -B tests/test_astc_cpu_860m.py --cxx g++After: this PR @
c11d6c5b, the same command with g++ and with clang++. Both printok. With the0x1114term taken back out of the condition, g++ fails again with that same line, and the term was put back. After merging main @f88e6e3a(this branch @b0fda0b0), both compilers still printok.The check does not model the GPU, the driver, or the 4-6 second stall. It only checks which device id selects the CPU path, and that the switch still overrides it.
Flags and settings
None added.
RX_VK_ASTC_CPUis unchanged: unset keeps the new default on the 860M,0forces the GPU decoder,1forces the CPU.Testing
Tested:
tests/test_astc_cpu_860m.pyon Linux with g++ 15.2 and clang++ 21.1, compiling the Windows branch with-D_WIN32and the Linux branch without it. The cut ofastc_on_cpu()is compiled with-Wall -Wextra -Werror. The whole ofvk_texture.cppwas not compiled.tests/run_all.pywas not run. No other check names this function.Not tested: the game, on any GPU. This PC may not run the game, and it has no 860M.
Must be tested:
RX_VK_ASTC_CPU, load Kokiri Forest, expecting the log line that ASTC is decoded on the CPU and noVK_ERROR_DEVICE_LOST(by hand, or the Test Farm when a Windows iGPU is online). The 4096 MB budget may still thrash; that is not this change.Risks
What could break: an 860M now pauses while those arrays decode on the CPU, about 6 seconds an array on the desktop parts, and the RGBA8 result can evict under the 4096 MB cap. A different AMD GPU that also uses device id 1002:1114 would take the same path. No other id changed.
Turning it off:
RX_VK_ASTC_CPU=0.Compatibility: nothing else changes. Saves, options, caches and the texture budget stay as they are. The first log line on an 860M names the CPU path.
Issues
See #1040
Checklist
Everyone
type(scope): description) of the status line's type.can't be run by hand is in Testing's Not testable by hand, with why. Not ticked yet: Testing's Tested names only game-free checks, and the game was not run on any GPU.
in Risks. Not ticked yet: Risks names a 4 to 6 second CPU decode pause per array, which Measurements leaves unmeasured.
main.python -I -B tests/run_all.pypasses (any failure that also fails onmainis named). Not run this turn. The new check was run on its own, g++ and clang++.third_party/untouched (a new folder with aPROVENANCE.mdinstead).When it applies
Assisted-by:/Co-Authored-By:trailers. Assisted-by: Grok is on both commits. No Co-Authored-By line.mainand passing here.tests/that reads changed source updated in this PR, not weakened.Brought up to the ready-for-review standard (#1454): the checklist's Everyone list has two new boxes, added here from what this PR's description and comments show (please check they match what you know).
**Not testable by hand:**line saying why and what stands in for it. Then tick it.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.