Fix kill instructions.

This commit is contained in:
Skyth 2025-01-24 22:56:27 +03:00
parent ab277869d4
commit 96458eb7bc

View file

@ -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)