use depth mask when writing to depth

This commit is contained in:
Samuliak 2025-01-17 14:51:25 +01:00
parent 21e7466670
commit 2a218d418f
No known key found for this signature in database
5 changed files with 17 additions and 8 deletions

View file

@ -387,7 +387,7 @@ void LatteDecompiler_analyzeExport(LatteDecompilerShaderContext* shaderContext,
LatteDecompilerShader* shader = shaderContext->shader;
if( shader->shaderType == LatteConst::ShaderType::Pixel )
{
if( cfInstruction->exportType == 0 && cfInstruction->exportArrayBase < 8 )
if (cfInstruction->exportType == 0 && cfInstruction->exportArrayBase < 8)
{
// remember color outputs that are written
for(uint32 i=0; i<(cfInstruction->exportBurstCount+1); i++)
@ -396,9 +396,10 @@ void LatteDecompiler_analyzeExport(LatteDecompilerShaderContext* shaderContext,
shader->pixelColorOutputMask |= (1<<colorOutputIndex);
}
}
else if( cfInstruction->exportType == 0 && cfInstruction->exportArrayBase == 61 )
else if (cfInstruction->exportType == 0 && cfInstruction->exportArrayBase == 61)
{
shader->depthWritten = true;
if (LatteMRT::GetActiveDepthBufferMask(*shaderContext->contextRegistersNew))
shader->depthMask = true;
}
else
debugBreakpoint();