fix(recompiler): give a dynamic-mip storage image a slot for every level #7238
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7238"
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?
Imported from boykopovar/AnyPS5. Originally posted by gjonn on 2026-10-17T18:43:12Z.
What
A dynamic-mip storage image reserved
RuntimeAbi::StorageMipSlots = 4mip slots, so a compute shader whose storage T# spans more levels was poisoned withruntime storage image mip capacity exceeded.On PPSA01317 a compute T# over a 512x512 surface with ten mip levels hits this on boot and the title aborts with that message; with this change it gets past it on
main.An RDNA T# addresses at most sixteen levels (4-bit
BASE_LEVELandLAST_LEVEL), so a dynamic-mip storage image now reserves sixteen slots.StorageHeapCapacitygoes from 16 to 64 so four such images still share one typed storage class, as before. Heap arrays keep their compact length.RuntimeAbi::Versiongoes to 14, so existing shader caches are invalidated.The new
verifyDynamicStorageMipChaincase inagc_shader_memoryselects a runtime mode for a ten-level and a sixteen-level 2D storage T#. It fails onmainwitha dynamic-mip storage image of a 512x512 surface with ten levels was rejectedand passes with the change.Tested
Windows 11, MinGW GCC Release build with
BUILD_TESTING=ON.agc_shader_memoryfails onmain(with only the test applied) and passes with the change.agc_shader_memory_tests,agc_shader_device_profile_testsandagc_driver_graphics_tests(22 tests) passes.python tools/check_conventions.py --base origin/mainpasses;tools/check_test_registration.pyreports no unregistered tests.runtime storage image mip capacity exceededno longer occurs and the title continues past it.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-17T19:08:04Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppL5755, L5884Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/RuntimeAbi.hppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/shader/recompiler/RuntimeAbi.hppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppcore/libs/prx/libSceAgcDriver/tests/ShaderMemory.cppImported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-17T20:05:53Z.
Independent hardware run, head
4aaf276999, Windows 11, MinGW (WinLibs GCC 15.2.0), Release:agc_shader_memory(incl. the dynamic-mip storage-image cases),agc_shader_device_profile,agc_driver_graphicsall pass on NVIDIA RTX 3070 (driver 617.42);agc_driver_graphicsalso passes on Intel UHD 630 (ANYPS5_GPU=UHD, igvk64).Imported from boykopovar/AnyPS5. Originally posted by ps54all on 2026-10-17T21:58:10Z.
Tested on God of War Ragnarök (PPSA08330, 06.006.000): the
runtime storage image mip capacity exceededabort is gone.82f0c9aec+ #6946 + #6958 + a few open picks) with and without this PR.runtime storage image mip capacity exceeded.computed/data-dependent s_swappc_b64 call target ... is not statically resolvable, ~400 s on a warm cache). Still a black window at ~0.1 FPS on our stack, so this doesn't show the dynamic-mip images render correctly, only that they no longer abort.LLM assistance used (Claude); runs on our machine.
Imported from boykopovar/AnyPS5. Originally posted by frankea on 2026-10-18T04:15:16Z.
RTX 4090 data point on PPSA01317, following my #7243 run from earlier tonight, where the title stopped on
runtime storage image mip capacity exceeded. Short version: with this PR on top of that stack the mip-capacity abort is gone on this GPU too, 3 of 3 completed runs plus a cold-cache rerun, and the next stop is the unnormalized-sampler refusal that #7240 covers. One run of four stalled on the splash for the whole 900 s cap; a cold rerun did not reproduce that.Setup. Gran Turismo 7 PPSA01317 01.000.001 (base package), Windows 11 (26200), RTX 4090 (NVIDIA 616.92), AMD Ryzen 7 5800X, MinGW-w64 GCC 15.2.0 r7 (UCRT), Release
libstarget only (no tests built).app.exeis the relink frommain31cbb55d7(--windows --registry --module-dir .); onlylibs/is swapped between runs. Tree:maine1041f6a5+ #71372aa6bfca6+ #7207 ec28b6be8 + #7175 555b7e824 + #5958 87a9b8d28 + #7243da158d61f(f76397990, the set that stopped on the mip capacity) + #72384aaf27699cherry-picked (clean, 1be778eea;RuntimeAbi.hppandResourceMaterializer.cpprebuilt). ThelibSceSsl.prxis the one from #7319 (1f267559e), because the title callssceSslConnectafter its save-data mount and the stock export throws there. Currentmainis not usable as the base for this title since #7323 (sceHmd2ReprojectionQueryBufferSizeAlign not implemented5 s in, see the #7243 comment). No controller, no input, nobody at the keyboard; one-shot interactive task per run, box otherwise idle.Result. The ABI bump invalidates the shader cache, so run 1 recompiled all 1,785 shaders (793 MiB written). Runs 2 and 3 (warm) and a fourth run with the shader and pipeline caches moved aside (cold again, 1,785 misses) all get past the mip-capacity throw: splash, then the black loading screen with the GT spinner (title-bar counter 15 to 60 FPS, about 490 frames at the last capture), save data mounted, three
sceNetResolverStartNtoa -> host DNS lookup failed, 26 new shaders compiled, and then, identically in all three:That is the bind-time refusal #7240 describes for this title (
image_sample_othrough an unnormalized point S#), so #7243 + #7238 + #7240 is the next combination here. Nothing else new appears in between: nopartial writes, nocolor export formatrefusal, no device loss.compute shader 0x1258d58300: runtime storage image mip capacity exceededshader 0x1258d04700 stage 5: ... unnormalized guest sampler is used by an implicit-LOD sampleThe stalled run. Run 1 wrote its 1,785 cache entries in the first two 10 s windows, mounted the save data and opened the same files as the other runs (
/download0/gt7save.tmp,/temp0/vegas_downloads/temp/d_5.tmp,/app0/cs), then stopped presenting: the title-bar counter froze at 63 frames (3.1 FPS) 56 s after launch and still read 63 at 15 min, the splash stayed on screen, no further log line of any kind (no resolver lookups, no shader-cache summary), and the process kept about two cores busy (685 CPU-seconds at 6 min). It was killed at the cap, so there is no abort block. The cold rerun with the shader cache and the Vulkan pipeline cache both moved aside went through the same point in 36 s, so I cannot tie the stall to the first compile after the ABI bump; I am noting it in case someone else sees a first run hang after this PR.stderr of run 3 (warm, box idle) from the second 10 s summary to the abort, per-shader
ShaderRegistrylines removedAI-assisted: yes (Claude Code)