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::Rcpc:
|
||||||
case AluScalarOpcode::Rcpf:
|
case AluScalarOpcode::Rcpf:
|
||||||
case AluScalarOpcode::Rcp:
|
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));
|
print("clamp(rcp({}), FLT_MIN, FLT_MAX)", op(SCALAR_0));
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AluScalarOpcode::Rsqc:
|
case AluScalarOpcode::Rsqc:
|
||||||
|
|
@ -1108,7 +1112,11 @@ void ShaderRecompiler::recompile(const AluInstruction& instr)
|
||||||
if (instr.scalarOpcode >= AluScalarOpcode::KillsEq && instr.scalarOpcode <= AluScalarOpcode::KillsOne)
|
if (instr.scalarOpcode >= AluScalarOpcode::KillsEq && instr.scalarOpcode <= AluScalarOpcode::KillsOne)
|
||||||
{
|
{
|
||||||
indent();
|
indent();
|
||||||
|
#ifdef XENOS_RECOMP_AIR
|
||||||
|
out += "if (ps != 0.0) discard_fragment();\n";
|
||||||
|
#else
|
||||||
out += "clip(ps != 0.0 ? -1 : 1);\n";
|
out += "clip(ps != 0.0 ? -1 : 1);\n";
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (closeIfBracket)
|
if (closeIfBracket)
|
||||||
|
|
@ -1674,7 +1682,9 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi
|
||||||
{
|
{
|
||||||
indent();
|
indent();
|
||||||
#ifdef UNLEASHED_RECOMP
|
#ifdef UNLEASHED_RECOMP
|
||||||
|
#ifndef XENOS_RECOMP_AIR
|
||||||
print("[unroll] ");
|
print("[unroll] ");
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
println("for (aL = 0; aL < i{}.x; aL++)", uint32_t(cfInstr.loopStart.loopId));
|
println("for (aL = 0; aL < i{}.x; aL++)", uint32_t(cfInstr.loopStart.loopId));
|
||||||
indent();
|
indent();
|
||||||
|
|
@ -1827,12 +1837,22 @@ void ShaderRecompiler::recompile(const uint8_t* shaderData, const std::string_vi
|
||||||
specConstantsMask |= SPEC_CONSTANT_ALPHA_TEST;
|
specConstantsMask |= SPEC_CONSTANT_ALPHA_TEST;
|
||||||
|
|
||||||
indent();
|
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();
|
indent();
|
||||||
out += '{';
|
out += '{';
|
||||||
|
|
||||||
indent();
|
indent();
|
||||||
|
|
||||||
|
#ifdef XENOS_RECOMP_AIR
|
||||||
|
out += "\tif ((oC0.w - g_AlphaThreshold) < 0.0) discard_fragment();\n";
|
||||||
|
#else
|
||||||
out += "\tclip(oC0.w - g_AlphaThreshold);\n";
|
out += "\tclip(oC0.w - g_AlphaThreshold);\n";
|
||||||
|
#endif
|
||||||
|
|
||||||
indent();
|
indent();
|
||||||
out += "}";
|
out += "}";
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue