Generator changes

Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
This commit is contained in:
Isaac Marovitz 2025-03-16 14:37:39 -04:00
parent 342a7224ee
commit 2efa88dbd4
No known key found for this signature in database
GPG key ID: 97250B2B09A132E1

View file

@ -556,22 +556,38 @@ void ShaderRecompiler::recompile(const AluInstruction& instr)
{
case AluVectorOpcode::KillEq:
indent();
#ifdef XENOS_RECOMP_AIR
println("if (any({} == {})) discard_fragment();", op(VECTOR_0), op(VECTOR_1));
#else
println("clip(any({} == {}) ? -1 : 1);", op(VECTOR_0), op(VECTOR_1));
#endif
break;
case AluVectorOpcode::KillGt:
indent();
#ifdef XENOS_RECOMP_AIR
println("if (any({} > {})) discard_fragment();", op(VECTOR_0), op(VECTOR_1));
#else
println("clip(any({} > {}) ? -1 : 1);", op(VECTOR_0), op(VECTOR_1));
#endif
break;
case AluVectorOpcode::KillGe:
indent();
#ifdef XENOS_RECOMP_AIR
println("if (any({} >= {})) discard_fragment();", op(VECTOR_0), op(VECTOR_1));
#else
println("clip(any({} >= {}) ? -1 : 1);", op(VECTOR_0), op(VECTOR_1));
#endif
break;
case AluVectorOpcode::KillNe:
indent();
#ifdef XENOS_RECOMP_AIR
println("if (any({} != {})) discard_fragment();", op(VECTOR_0), op(VECTOR_1));
#else
println("clip(any({} != {}) ? -1 : 1);", op(VECTOR_0), op(VECTOR_1));
#endif
break;
}
@ -727,7 +743,11 @@ void ShaderRecompiler::recompile(const AluInstruction& instr)
break;
case AluVectorOpcode::Frc:
#ifdef XENOS_RECOMP_AIR
print("fract({})", op(VECTOR_0));
#else
print("frac({})", op(VECTOR_0));
#endif
break;
case AluVectorOpcode::Trunc:
@ -795,7 +815,11 @@ void ShaderRecompiler::recompile(const AluInstruction& instr)
break;
case AluVectorOpcode::Dst:
#ifdef XENOS_RECOMP_AIR
print("distance({}, {})", op(VECTOR_0), op(VECTOR_1));
#else
print("dst({}, {})", op(VECTOR_0), op(VECTOR_1));
#endif
break;
}
@ -901,7 +925,11 @@ void ShaderRecompiler::recompile(const AluInstruction& instr)
break;
case AluScalarOpcode::Frcs:
#ifdef XENOS_RECOMP_AIR
print("fract({})", op(SCALAR_0));
#else
print("frac({})", op(SCALAR_0));
#endif
break;
case AluScalarOpcode::Truncs: