AGC: since #639, devices without mesh shaders (SPIR-V 1.3 target) get modules that fail validation #2138

Closed
opened 2026-10-09 09:52:48 +00:00 by tezzgod74 · 0 comments
tezzgod74 commented 2026-10-09 09:52:48 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by tezzgod74 on 2026-10-09T09:52:48Z.


Since #639, a device without mesh shaders gets recompiled modules that fail SPIR-V validation. VulkanDevice targets SPIR-V 1.3 when meshShader is off and 1.4 when it is on (VulkanDevice.cpp), and the new code emits instructions that are only valid from 1.4. On an AMD RDNA 2 iGPU (mesh=0), 10 execution tests fail. The RDNA 4 dGPU in the same machine (mesh=1) passes all of them.

Most fail on a vector OpSelect with a scalar condition, which SPIR-V 1.3 rejects. This is the same class #574 fixed for the bindless table hit:

level=2 word=1183: Expected vector sizes of Result Type and the condition to be equal: Select
  %1017 = OpSelect %v4uint %true %1014 %146

agc_driver_prepared_graphics fails on the version check instead:

ShaderRecompiler::Recompile: SPIRV-Tools: module version exceeds requested SPIR-V target
Test Error
agc_driver_image_address_dimension OpSelect condition
agc_driver_image_by OpSelect condition (test added after #639)
agc_driver_image_converted_unorm OpSelect condition
agc_driver_image_sample_reduction OpSelect condition
agc_driver_image_sint8 OpSelect condition
agc_driver_image_srgb_load OpSelect condition
agc_driver_image_store_sint OpSelect condition
agc_driver_image_xor_swizzle_volume OpSelect condition
agc_driver_typed_heaps OpSelect condition
agc_driver_prepared_graphics module version exceeds target

Bisected with agc_driver_image_sint8 on the iGPU, first parent only from 79d23eb7 (passes): first bad is the #639 merge 23941235. Its first parent 2b297842 passes. The commits inside #639 can't be bisected: most don't build on their own, and the earliest that do fail this test for other reasons. The full RequestSerializer dumps from the failing runs are available if useful.

CI doesn't see this. Its lavapipe device and the GPUs used for #639 appear to expose mesh shaders, so every run targets 1.4. The failures only show with ANYPS5_ENABLE_SPIRV_TOOLS=ON. Without validation, the invalid modules would reach the driver.

ANYPS5_GPU Device Driver Vulkan mesh SPIR-V target Result
Radeon(TM) Graphics Ryzen 9 7950X iGPU (RDNA 2, 0x164e) 32.0.21045.5002 1.4.315 0 1.3 10 fail
RX 9060 AMD Radeon RX 9060 XT (RDNA 4, 0x7590) 32.0.31041.1004 1.4.349 1 1.4 pass

Environment: main at f1451396, Release, -DANYPS5_ENABLE_SPIRV_TOOLS=ON, MinGW-w64 GCC 15.2.0 (WinLibs r7), Windows 11 Pro 10.0.26300.

Reproduce

$env:ANYPS5_GPU = "Radeon(TM) Graphics"
ctest --test-dir build -R '^agc_driver_(image_sint8|typed_heaps|prepared_graphics)$' --output-on-failure
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5776211417 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/2138). Originally posted by [tezzgod74](https://github.com/tezzgod74) on 2026-10-09T09:52:48Z. --- Since #639, a device without mesh shaders gets recompiled modules that fail SPIR-V validation. `VulkanDevice` targets SPIR-V 1.3 when `meshShader` is off and 1.4 when it is on ([VulkanDevice.cpp](https://github.com/boykopovar/AnyPS5/blob/f1451396/core/libs/prx/libSceAgcDriver/Execution/src/VulkanDevice.cpp#L2458)), and the new code emits instructions that are only valid from 1.4. On an AMD RDNA 2 iGPU (`mesh=0`), 10 execution tests fail. The RDNA 4 dGPU in the same machine (`mesh=1`) passes all of them. Most fail on a vector `OpSelect` with a scalar condition, which SPIR-V 1.3 rejects. This is the same class #574 fixed for the bindless table hit: ``` level=2 word=1183: Expected vector sizes of Result Type and the condition to be equal: Select %1017 = OpSelect %v4uint %true %1014 %146 ``` `agc_driver_prepared_graphics` fails on the version check instead: ``` ShaderRecompiler::Recompile: SPIRV-Tools: module version exceeds requested SPIR-V target ``` | Test | Error | |---|---| | `agc_driver_image_address_dimension` | `OpSelect` condition | | `agc_driver_image_by` | `OpSelect` condition (test added after #639) | | `agc_driver_image_converted_unorm` | `OpSelect` condition | | `agc_driver_image_sample_reduction` | `OpSelect` condition | | `agc_driver_image_sint8` | `OpSelect` condition | | `agc_driver_image_srgb_load` | `OpSelect` condition | | `agc_driver_image_store_sint` | `OpSelect` condition | | `agc_driver_image_xor_swizzle_volume` | `OpSelect` condition | | `agc_driver_typed_heaps` | `OpSelect` condition | | `agc_driver_prepared_graphics` | module version exceeds target | Bisected with `agc_driver_image_sint8` on the iGPU, first parent only from 79d23eb7 (passes): first bad is the #639 merge 23941235. Its first parent 2b297842 passes. The commits inside #639 can't be bisected: most don't build on their own, and the earliest that do fail this test for other reasons. The full RequestSerializer dumps from the failing runs are available if useful. CI doesn't see this. Its lavapipe device and the GPUs used for #639 appear to expose mesh shaders, so every run targets 1.4. The failures only show with `ANYPS5_ENABLE_SPIRV_TOOLS=ON`. Without validation, the invalid modules would reach the driver. | `ANYPS5_GPU` | Device | Driver | Vulkan | mesh | SPIR-V target | Result | |---|---|---|---|---|---|---| | `Radeon(TM) Graphics` | Ryzen 9 7950X iGPU (RDNA 2, 0x164e) | 32.0.21045.5002 | 1.4.315 | 0 | 1.3 | 10 fail | | `RX 9060` | AMD Radeon RX 9060 XT (RDNA 4, 0x7590) | 32.0.31041.1004 | 1.4.349 | 1 | 1.4 | pass | Environment: `main` at f1451396, Release, `-DANYPS5_ENABLE_SPIRV_TOOLS=ON`, MinGW-w64 GCC 15.2.0 (WinLibs r7), Windows 11 Pro 10.0.26300. ### Reproduce ``` $env:ANYPS5_GPU = "Radeon(TM) Graphics" ctest --test-dir build -R '^agc_driver_(image_sint8|typed_heaps|prepared_graphics)$' --output-on-failure ```
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#2138
No description provided.