fix(shader): keep image mode switches valid inside loops #2124
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2124"
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 nikhilpanchal1 on 2026-10-09T09:29:40Z.
What
Fixes #1921.
Runtime image mode switches can terminate inside a loop's continue construct, causing SPIR-V validation to fail. Route invalid/default and disabled-mode edges to the switch merge, with an undefined result where needed. Valid image behavior and host-side descriptor rejection are unchanged.
This stays in one emitter, with no helper function, loop-context flag or intermediate result phis. Alternative to #1964.
Tested
Linux x86_64, GCC 12.2, Release, Mesa llvmpipe 26.1.6.
No physical-GPU, Windows or original-title replay. Direct-read coverage starts at SPIR-V 1.4 because of an existing 1.3 FMASK limitation.
Checklist
main(d9484c71).Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-09T23:00:20Z.
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/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cppL1595-1596, L1602-1603, L1605-1617, L1619-1622, L1628-1630core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cppL1595-1596, L1602-1603, L1605-1617, L1619-1622, L1628-1630core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cppL1593, L1599, L1602, L1610-1615, L1619-1622, L1629-1630core/libs/prx/libSceAgcDriver/tests/execution/RuntimeImages.cppL7, L15-17, L52-53Imported from boykopovar/AnyPS5. Originally posted by popcoder565 on 2026-10-10T05:21:45Z.
Native Windows run, since no Windows results were posted. Setup: Windows 10 (19045), RTX 3060 Laptop (NVIDIA 616.92), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release. Head
6653457d, merged ontomainbc40a6b5atogether with #1960 and #1959.agc_shader_control_flow,agc_driver_runtime_imagesandagc_driver_runtime_images_wave64.amd64_only_windows(a relinker test) segfaulted once under-j 8; it then passed 10 of 10 on its own.No title was run.
🤖 Addressed by Claude Code
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T05:46:48Z.
Closing: #1964 fixes #1921 the same way, came first, and has a title that gets past the stop. If this catches a case #1964 misses, a test for that case on top of #1964 is welcome.
Pull request closed