fix(shader): splat the bindless table hit into a bool vector for SPIR-V 1.3 #574
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/574"
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 CnRJay on 2026-10-04T23:05:16Z.
What
TableResult(bindless image tables) emittedOpSelect %v4uint <scalar bool> .... A scalar condition on a vector select is only valid from SPIR-V 1.4, and the recompiler also accepts 1.3 targets (the emitter default, and the targetagc_shader_memoryuses). With-DANYPS5_ENABLE_SPIRV_TOOLS=ONthe test failed:The condition is now built into a
bvec4withOpCompositeConstructfirst. This is valid in every SPIR-V version and gives the same result.Tested
Windows 11, MinGW GCC 15.2.0 r7, NVIDIA Vulkan,
-DANYPS5_ENABLE_SPIRV_TOOLS=ON:agc_shader_memorynow passes, and the fullctestrun passes 213/213.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 oneandonlydean on 2026-10-04T23:44:03Z.
Thanks. A scalar condition on a vector
OpSelectis only valid from SPIR-V 1.4, and the runtime builds every non-mesh shader for 1.3 (VulkanDevice.cpp,meshShader ? 0x00010400 : 0x00010300), so every bindless-table image op on main emits invalid SPIR-V that drivers happen to accept. Splatting the condition into abvec4gives the same per-component result in every version, and this is the only vector select with a scalar condition I could find. The shader cache version is derived from the recompiler sources, so existing caches are rebuilt automatically.There's no new test, since
agc_shader_memoryonly validates with-DANYPS5_ENABLE_SPIRV_TOOLS=ON, which is off by default and in CI. I built it that way: on main it fails with "Expected vector sizes of Result Type and the condition to be equal: Select" (OpSelect %v4uintwith a scalar condition), and on this branch it passes. That's enough for a fix like this.Ready to merge from my side once CI has run (it still needs approval).