From 89fcff6dd8ad76eab49ffc4e3637bb5df13e30fc Mon Sep 17 00:00:00 2001 From: Maz Date: Tue, 20 Oct 2026 15:38:04 +0400 Subject: [PATCH] fix(shader): broadcast the first pixel LDS slot without a dynamic lane --- core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp | 4 ++-- .../SpirvBackend/src/SpirvMemory/SpirvBufferAccess.cpp | 6 +----- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp b/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp index 9aa30d1018..167de17f59 100644 --- a/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp @@ -5453,8 +5453,8 @@ void verifyMergedHullConfiguration() { require(!serializer.Deserialize(separate).request.graphics->tessellation->mergedHull, "a separate hull configuration was read as merged"); constexpr std::size_t pointTailBytes = 13u; auto legacy = decodeBase64(merged); - require(legacy.size() > 54u + pointTailBytes && legacy[4] == 44u, "a merged hull request did not use serialization version 44"); - legacy.resize(legacy.size() - 1u - pointTailBytes); + require(legacy.size() > 54u + pointTailBytes && legacy[4] == 45u, "a merged hull request did not use serialization version 45"); + legacy.resize(legacy.size() - 2u - pointTailBytes); legacy.pop_back(); require(legacy[legacy.size() - 52u] == 1u, "the merged hull flag is not the last byte of the tessellation configuration"); legacy.erase(legacy.end() - 52); diff --git a/core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvBufferAccess.cpp b/core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvBufferAccess.cpp index 30ce436187..1a0ebafe6d 100644 --- a/core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvBufferAccess.cpp +++ b/core/shader/recompiler/SpirvBackend/src/SpirvMemory/SpirvBufferAccess.cpp @@ -99,14 +99,10 @@ void EmitPixelFunctionLdsBase(SpirvEmitterState& state) { state.module.AddFunction(spv::OpSelect, TypeU32(state), claimed, exhausted, ConstantU32(state, 0u), acquired); state.module.AddFunction(spv::OpStore, slotVar, claimed); }); - const auto ballot = state.module.AllocateId(); - state.module.AddFunction(spv::OpGroupNonUniformBallot, TypeU32Vector(state, 4u), ballot, ConstantU32(state, spv::ScopeSubgroup), elected); - const auto source = state.module.AllocateId(); - state.module.AddFunction(spv::OpGroupNonUniformBallotFindLSB, TypeU32(state), source, ConstantU32(state, spv::ScopeSubgroup), ballot); const auto local = state.module.AllocateId(); state.module.AddFunction(spv::OpLoad, TypeU32(state), local, slotVar); const auto slot = state.module.AllocateId(); - state.module.AddFunction(spv::OpGroupNonUniformBroadcast, TypeU32(state), slot, ConstantU32(state, spv::ScopeSubgroup), local, source); + state.module.AddFunction(spv::OpGroupNonUniformBroadcastFirst, TypeU32(state), slot, ConstantU32(state, spv::ScopeSubgroup), local); std::uint32_t lane; if (state.splitSubgroup) { if (state.subgroupLocalInvocationIdVariable == 0) FailEmit("pixel function LDS lane was not declared");