Latte: Fix shader compilation error when subroutines are used

Fixes character colors in Tekken Tag Tournament 2
This commit is contained in:
Exzap 2023-09-11 18:20:37 +02:00
parent b902aa2048
commit 92ab87b049
2 changed files with 3 additions and 2 deletions

View file

@ -4037,8 +4037,8 @@ void LatteDecompiler_emitGLSLShader(LatteDecompilerShaderContext* shaderContext,
for (auto& subroutineInfo : shaderContext->list_subroutines)
{
sint32 subroutineMaxStackDepth = 0;
src->addFmt("bool activeMaskStackSub%04x[{}];" _CRLF, subroutineInfo.cfAddr, subroutineMaxStackDepth + 1);
src->addFmt("bool activeMaskStackCSub%04x[{}];" _CRLF, subroutineInfo.cfAddr, subroutineMaxStackDepth + 2);
src->addFmt("bool activeMaskStackSub{:04x}[{}];" _CRLF, subroutineInfo.cfAddr, subroutineMaxStackDepth + 1);
src->addFmt("bool activeMaskStackCSub{:04x}[{}];" _CRLF, subroutineInfo.cfAddr, subroutineMaxStackDepth + 2);
}
}
// helper variables for cube maps (todo: Only emit when used)