From 96458eb7bc01798c951bce9d627852c2870bc54d Mon Sep 17 00:00:00 2001 From: Skyth <19259897+blueskythlikesclouds@users.noreply.github.com> Date: Fri, 24 Jan 2025 22:56:27 +0300 Subject: [PATCH] Fix kill instructions. --- XenosRecomp/shader_recompiler.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/XenosRecomp/shader_recompiler.cpp b/XenosRecomp/shader_recompiler.cpp index 96f8e72..9610cec 100644 --- a/XenosRecomp/shader_recompiler.cpp +++ b/XenosRecomp/shader_recompiler.cpp @@ -540,22 +540,22 @@ void ShaderRecompiler::recompile(const AluInstruction& instr) { case AluVectorOpcode::KillEq: indent(); - println("clip(any({} == {}) ? 1 : -1);", op(VECTOR_0), op(VECTOR_1)); + println("clip(any({} == {}) ? -1 : 1);", op(VECTOR_0), op(VECTOR_1)); break; case AluVectorOpcode::KillGt: indent(); - println("clip(any({} > {}) ? 1 : -1);", op(VECTOR_0), op(VECTOR_1)); + println("clip(any({} > {}) ? -1 : 1);", op(VECTOR_0), op(VECTOR_1)); break; case AluVectorOpcode::KillGe: indent(); - println("clip(any({} >= {}) ? 1 : -1);", op(VECTOR_0), op(VECTOR_1)); + println("clip(any({} >= {}) ? -1 : 1);", op(VECTOR_0), op(VECTOR_1)); break; case AluVectorOpcode::KillNe: indent(); - println("clip(any({} != {}) ? 1 : -1);", op(VECTOR_0), op(VECTOR_1)); + println("clip(any({} != {}) ? -1 : 1);", op(VECTOR_0), op(VECTOR_1)); break; } @@ -1062,7 +1062,7 @@ void ShaderRecompiler::recompile(const AluInstruction& instr) if (instr.scalarOpcode >= AluScalarOpcode::KillsEq && instr.scalarOpcode <= AluScalarOpcode::KillsOne) { indent(); - out += "clip(ps != 0.0 ? 1 : -1);\n"; + out += "clip(ps != 0.0 ? -1 : 1);\n"; } if (closeIfBracket)