From c227c6264958f3e1209b734f610ab54a3f4782ff Mon Sep 17 00:00:00 2001 From: Chad Date: Sun, 4 Oct 2026 18:05:13 -0500 Subject: [PATCH] fix(shader): splat the bindless table hit into a bool vector for SPIR-V 1.3 TableResult selected a uvec4 with a scalar bool condition, which needs SPIR-V 1.4. Targets at 1.3 failed validation (agc_shader_memory with ANYPS5_ENABLE_SPIRV_TOOLS). Co-Authored-By: Claude Opus 5.5 --- core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp b/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp index 251b1a045..7ea6a8d40 100644 --- a/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp +++ b/core/shader/recompiler/SpirvBackend/src/SpirvImageEmitter.cpp @@ -245,7 +245,9 @@ std::uint32_t SampledComponentZero(SpirvEmitterState& state, IrTextureNumericCla std::uint32_t TableResult(SpirvValueEmitContext& ctx, const ImageEmitAccess& access, std::uint32_t result) { if (access.table.mapped == 0) return result; auto& state = ctx.state; - return Select(state, TypeU32Vector(state, 4), access.table.mapped, result, ConstantU32CompositeZero(state, 4)); + const auto mapped = state.module.AllocateId(); + state.module.AddFunction(spv::OpCompositeConstruct, TypeBoolVector(state, 4), mapped, access.table.mapped, access.table.mapped, access.table.mapped, access.table.mapped); + return Select(state, TypeU32Vector(state, 4), mapped, result, ConstantU32CompositeZero(state, 4)); } std::uint32_t ResultVector(SpirvValueEmitContext& ctx, const ImageEmitAccess& access, std::uint32_t value, IrTextureNumericClass numericClass, bool dref, bool gather) {