From 1774cc9d620fa0a9fc9692f02fffe765019987a1 Mon Sep 17 00:00:00 2001 From: tezzgod74 <204015000+tezzgod74@users.noreply.github.com> Date: Fri, 9 Oct 2026 06:09:32 -0500 Subject: [PATCH 1/2] fix(shader): splat the FMASK read condition into a bool vector for SPIR-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 (#2138), as in #574. Co-Authored-By: Claude Opus 5.5 --- .../shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp b/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp index e9fde5d68279..687237e94e3f 100644 --- a/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp +++ b/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp @@ -1548,7 +1548,10 @@ void EmitImage(SpirvValueEmitContext& ctx, const IrValue& inst) { if (inst.Opcode() == IrOpcode::ImageRead && memory.dataBits == 32u) { const auto value = state.module.AllocateId(); state.module.AddFunction(spv::OpCompositeConstruct, TypeU32Vector(state, 4u), value, ConstantU32(state, 0x76543210u), ConstantU32(state, 0xfedcba98u), ConstantU32(state, 0u), ConstantU32(state, 0u)); - ctx.Define(inst, Select(state, TypeU32Vector(state, 4u), ctx.Arg(inst, 2u), value, ConstantU32CompositeZero(state, 4u))); + const auto active = ctx.Arg(inst, 2u); + const auto mapped = state.module.AllocateId(); + state.module.AddFunction(spv::OpCompositeConstruct, TypeBoolVector(state, 4u), mapped, active, active, active, active); + ctx.Define(inst, Select(state, TypeU32Vector(state, 4u), mapped, value, ConstantU32CompositeZero(state, 4u))); } else { ctx.Fail(inst, "FMASK requires a 32-bit image read"); } From 5463ea47842e4c3e32aa1b37767c4c0fd30fe858 Mon Sep 17 00:00:00 2001 From: tezzgod74 <204015000+tezzgod74@users.noreply.github.com> Date: Fri, 9 Oct 2026 06:09:32 -0500 Subject: [PATCH 2/2] fix(tests): target SPIR-V 1.4 where the prepared graphics test adds mesh 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 --- .../prx/libSceAgcDriver/tests/execution/PreparedGraphics.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/core/libs/prx/libSceAgcDriver/tests/execution/PreparedGraphics.cpp b/core/libs/prx/libSceAgcDriver/tests/execution/PreparedGraphics.cpp index 7708197535c6..be49830029dd 100644 --- a/core/libs/prx/libSceAgcDriver/tests/execution/PreparedGraphics.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/execution/PreparedGraphics.cpp @@ -125,6 +125,7 @@ void Check(AgcDriver::VulkanDevice& device, AgcDriver::Graphics::ShaderPath path target.supportedCapabilities = capabilities; target.supportedExtensions = extensions; target.mesh = MeshTargetLimits{{128, 1, 1}, 128, 32768, 256, 256, 128, 32768, 1, 1}; + target.spirvVersion = 0x00010400u; } const auto stages = PrepareGraphicsStages(prepared, target); Require(stages.size() == (tessellation ? 4u : 2u), "graphics preparation compiled the wrong stages");