From d9bf99cb208beed8601675bcc3a56757cf995b5f Mon Sep 17 00:00:00 2001 From: Samuliak Date: Thu, 9 Jan 2025 20:34:49 +0100 Subject: [PATCH] fix: a typo in texture index --- .../LegacyShaderDecompiler/LatteDecompilerAnalyzer.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerAnalyzer.cpp b/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerAnalyzer.cpp index 0f9f28c6..9a40d743 100644 --- a/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerAnalyzer.cpp +++ b/src/Cafe/HW/Latte/LegacyShaderDecompiler/LatteDecompilerAnalyzer.cpp @@ -872,6 +872,14 @@ void LatteDecompiler_analyze(LatteDecompilerShaderContext* shaderContext, LatteD if (dim != Latte::E_DIM::DIM_2D) continue; + // Check for mip level + // TODO: uncomment? + /* + auto lastMip = texRegister.word5.get_LAST_LEVEL(); + if (lastMip != 0) + continue; + */ + // Check if the texture is used as render target for (sint32 j = 0; j < LATTE_NUM_COLOR_TARGET; j++) { @@ -886,7 +894,7 @@ void LatteDecompiler_analyze(LatteDecompilerShaderContext* shaderContext, LatteD // TODO: check if mip matches as well? if (physAddr == colorBufferPhysMem) { - shader->textureRenderTargetIndex[i] = j; + shader->textureRenderTargetIndex[textureIndex] = j; break; } }