Repository navigation
fix(shader): keep vector selects valid on SPIR-V 1.3 targets - #2191
Conversation
…IR-V 1.3 The FMASK identity read selected a uvec4 with a scalar bool condition, which needs SPIR-V 1.4. Devices without mesh shaders target 1.3, so every image test that reaches the path failed validation with ANYPS5_ENABLE_SPIRV_TOOLS (boykopovar#2138), as in boykopovar#574. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…esh shading The geometry pass adds the mesh capability and extension to the device target but kept its SPIR-V version. On a device without mesh shaders that is 1.3, and the mesh module was rejected as exceeding the target. VulkanDevice targets 1.4 whenever mesh shading is enabled. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
I reached the same fix independently and confirmed it on a mesh-capable GPU by forcing 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 request.useCache = false;
auto withoutMesh = request;
withoutMesh.target.spirvVersion = 0x00010300u;
static_cast<void>(ShaderRecompiler::Recompile(withoutMesh));
const auto result = ShaderRecompiler::Recompile(request);On the RTX 5060 Ti (mesh=1, so the device itself targets 1.4), and passes with it. All 26 AI-assisted: yes |
|
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 |
|
Windows run with a title for this PR. Astro Bot PPSA21567 v01.018 (retail, owned; Tree:
AI-assisted: yes (Claude Code). |
|
Checked the FMASK select now uses a |
…sh-targets fix(shader): keep vector selects valid on SPIR-V 1.3 targets
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 fix(shader): splat the bindless table hit into a bool vector for SPIR-V 1.3 #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 onmainat 745b775. FullctestwithANYPS5_GPUset to each device:The 10 tests listed in #2138, which failed on the iGPU at f145139 before 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