fix(shader): keep vector selects valid on SPIR-V 1.3 targets #2191
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2191"
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 tezzgod74 on 2026-10-09T11:11:48Z.
What
Fixes #2138. Devices without mesh shaders target SPIR-V 1.3, and 10 execution tests failed validation there since #639.
fix(shader): the FMASK identity read inEmitImageselected auvec4with the scalar bool conditionctx.Arg(inst, 2). A scalar condition for a vector result needs SPIR-V 1.4. The condition is now splatted into abvec4, as #574 did for the bindless table hit. This was the source of all nineExpected vector sizes of Result Type and the condition to be equal: Selectfailures; the module dumped fromagc_driver_typed_heapshad%1008 = OpSelect %v4uint %true %1005 %137with%1005 = uvec4(0x76543210, 0xfedcba98, 0, 0).fix(tests): the geometry pass ofagc_driver_prepared_graphicsadds the mesh capability and extension to the device target but kept the target's SPIR-V version. On a 1.3 device the mesh module was rejected withmodule version exceeds requested SPIR-V target. The test now targets 1.4 there, asVulkanDevicedoes whenever mesh shading is enabled.Tested
Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
-DBUILD_TESTING=ON -DANYPS5_ENABLE_SPIRV_TOOLS=ON, rebased onmainat745b775e. FullctestwithANYPS5_GPUset to each device:The 10 tests listed in #2138, which failed on the iGPU at
f1451396before this change, pass. The failures left are unrelated and fail the same way without this change:agc_driver_pixel_interlock(#2009),agc_driver_sdwa_float_selectorsandagc_driver_sdwa_ldexp_f16(#1463) on the iGPU,agc_driver_vopc_compare_table(#825) on the RX 9060 XT, andagc_driver_storage_cache_budgeton both (vkAllocateMemoryreturnsVK_ERROR_OUT_OF_DEVICE_MEMORY, also onmainwithout these commits). Not tested with a title.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by rmz-24 on 2026-10-09T11:21:05Z.
I reached the same fix independently and confirmed it on a mesh-capable GPU by forcing
meshShaderoff locally (RTX 5060 Ti, NVIDIA 617.42, Windows 11, MinGW GCC 15.2.0 r7,-DANYPS5_ENABLE_SPIRV_TOOLS=ON). With this change the full ctest passes 510/510, with mesh forced off and with it on.One suggestion: CI can't catch a regression of this class, since lavapipe exposes mesh shaders and every CI module targets 1.4. A 3-line guard in
ImageSint8.cpp'sRunalso compiles each shader for a 1.3 target, so the SPIRV-Tools job validates the 1.3 module on any device:On the RTX 5060 Ti (mesh=1, so the device itself targets 1.4),
agc_driver_image_sint8fails without your emitter change:and passes with it. All 26
agc_driver_image*tests pass with the guard. Feel free to take it into this PR; otherwise I can send it as a separate test PR after this one merges.AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by tezzgod74 on 2026-10-09T12:11:33Z.
Thanks for confirming it on NVIDIA with mesh forced off, and for the guard. It closes the gap where CI can't see 1.3-only failures. Please send it as its own PR after this one merges so it carries your name; I'll test it on the RDNA 2 iGPU here (mesh=0, so it targets 1.3 natively) when it's up.
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by danielradosa on 2026-10-09T22:44:20Z.
Windows run with a title for this PR. Astro Bot PPSA21567 v01.018 (retail, owned;
eboot.binandsce_moduleunwrapped from their SELF containers, relinked with--windows). Windows 11 Pro 10.0.26300, MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,-DANYPS5_ENABLE_SPIRV_TOOLS=ON. GPU: Ryzen 5 7600 iGPU (RDNA 2, 0x164e), driver 32.0.21045.5002, selected withANYPS5_GPU="Radeon(TM) Graphics". The device reportsmesh=0, so programs target SPIR-V 1.3.Tree:
maind70b8998plus the #2340 stack (#1836, #1837, #2257, CouchRiv'sfix-shader-sampled-heap-capacity) and other open PRs; none of them touchSpirvImageEmitter.cpp. Onmainalone the title stops earlier, at the #1817s_swappc_b64registration stop.agc_driver_typed_heapsmodule in the description.APS5_HANG_DUMP_SECS=450while the main thread was still registering shaders; no frame is presented yet.agc_driver_prepared_graphicsandagc_driver_typed_heapspass on this iGPU with the PR.AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T06:13:34Z.
Checked the FMASK select now uses a
bvec4condition (valid on SPIR-V 1.3, same per-component result), the prepared graphics test targets 1.4 where it adds mesh, andagc_driver_prepared_graphicsplus the Agc/AgcDriver ctest pass (296/296). Note that the tests can't fail without the change on CI, which targets 1.4; the 1.3 guard suggested in the thread is a good follow-up. Merging.