mirror of
https://github.com/hedge-dev/XenosRecomp.git
synced 2026-05-09 18:31:36 +00:00
More generator changes
Signed-off-by: Isaac Marovitz <isaacryu@icloud.com>
This commit is contained in:
parent
2efa88dbd4
commit
a223077258
1 changed files with 21 additions and 1 deletions
|
|
@ -952,7 +952,11 @@ void ShaderRecompiler::recompile(const AluInstruction& instr)
|
|||
case AluScalarOpcode::Rcpc:
|
||||
case AluScalarOpcode::Rcpf:
|
||||
case AluScalarOpcode::Rcp:
|
||||
#ifdef XENOS_RECOMP_AIR
|
||||
print("clamp((1.0 / {}), FLT_MIN, FLT_MAX)", op(SCALAR_0));
|
||||
#else
|
||||
print("clamp(rcp({}), FLT_MIN, FLT_MAX)", op(SCALAR_0));
|
||||
#endif
|
||||
break;
|
||||
|
||||
case AluScalarOpcode::Rsqc:
|
||||
|
|
@ -1108,7 +1112,11 @@ void ShaderRecompiler::recompile(const AluInstruction& instr)
|
|||
if (instr.scalarOpcode >= AluScalarOpcode::KillsEq && instr.scalarOpcode <= AluScalarOpcode::KillsOne)
|
||||
{
|
||||
indent();
|
||||
#ifdef XENOS_RECOMP_AIR
|
||||
out += "if (ps != 0.0) discard_fragment();\n";
|
||||
#else
|
||||
out += "clip(ps != 0.0 ? -1 : 1);\n";
|
||||
#endif
|
||||
}
|
||||
|
||||
if (closeIfBracket)
|
||||
|
|
@ -1674,7 +1682,9 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi
|
|||
{
|
||||
indent();
|
||||
#ifdef UNLEASHED_RECOMP
|
||||
#ifndef XENOS_RECOMP_AIR
|
||||
print("[unroll] ");
|
||||
#endif
|
||||
#endif
|
||||
println("for (aL = 0; aL < i{}.x; aL++)", uint32_t(cfInstr.loopStart.loopId));
|
||||
indent();
|
||||
|
|
@ -1827,12 +1837,22 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi
|
|||
specConstantsMask |= SPEC_CONSTANT_ALPHA_TEST;
|
||||
|
||||
indent();
|
||||
out += "[branch] if (g_SpecConstants() & SPEC_CONSTANT_ALPHA_TEST)";
|
||||
|
||||
#ifndef XENOS_RECOMP_AIR
|
||||
out += "[branch] ";
|
||||
#endif
|
||||
|
||||
out += "if (g_SpecConstants() & SPEC_CONSTANT_ALPHA_TEST)";
|
||||
indent();
|
||||
out += '{';
|
||||
|
||||
indent();
|
||||
|
||||
#ifdef XENOS_RECOMP_AIR
|
||||
out += "\tif ((oC0.w - g_AlphaThreshold) < 0.0) discard_fragment();\n";
|
||||
#else
|
||||
out += "\tclip(oC0.w - g_AlphaThreshold);\n";
|
||||
#endif
|
||||
|
||||
indent();
|
||||
out += "}";
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue