From 7b5a33f8785308bd6ad569a8dcae7d5771443085 Mon Sep 17 00:00:00 2001 From: nmzik Date: Tue, 15 Sep 2026 06:20:35 +0400 Subject: [PATCH] Fix PS5 front-face VGPR encoding to restore scene lighting --- .../shader/recompiler/backend/spirv/spirvEmitterFlow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp b/src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp index 629e5ad52..106ebaa30 100644 --- a/src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp +++ b/src/graphics/shader/recompiler/backend/spirv/spirvEmitterFlow.cpp @@ -46,8 +46,9 @@ uint32_t EmitBuiltinU32(EmitterState& state, IR::StageInputKind kind, uint32_t c const auto value = state.builder.AllocateId(); const auto bits = state.builder.AllocateId(); state.builder.AddFunction(spv::OpLoad, TypeBool(state), value, variable); - state.builder.AddFunction(spv::OpSelect, TypeU32(state), bits, value, ConstantU32(state, 1), - ConstantU32(state, 0)); + // PS5 initializes v_front_face with float +1.0/-1.0 bits. + state.builder.AddFunction(spv::OpSelect, TypeU32(state), bits, value, + ConstantU32(state, 0x3f800000u), ConstantU32(state, 0xbf800000u)); return bits; } if (kind == IR::StageInputKind::VertexIndex || kind == IR::StageInputKind::InstanceIndex ||