From c13c8046d47cf6e7a1a0654406ccb7129356f697 Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Thu, 18 Jan 2024 03:11:41 +0200 Subject: [PATCH] Detect passthrough TEV stages --- include/PICA/regs.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/PICA/regs.hpp b/include/PICA/regs.hpp index 100a0573..b807ae5c 100644 --- a/include/PICA/regs.hpp +++ b/include/PICA/regs.hpp @@ -447,5 +447,17 @@ namespace PICA { u32 getColorScale() { return (colorScale <= 2) ? (1 << colorScale) : 1; } u32 getAlphaScale() { return (alphaScale <= 2) ? (1 << alphaScale) : 1; } + + bool isPassthroughStage() { + // clang-format off + // Thank you to the Citra dev that wrote this out + return ( + colorOp == Operation::Replace && alphaOp == Operation::Replace && + colorSource1 == Source::Previous && alphaSource1 == Source::Previous && + colorOperand1 == ColorOperand::SourceColor && alphaOperand1 == AlphaOperand::SourceAlpha && + getColorScale() == 1 && getAlphaScale() == 1 + ); + // clang-format on + } }; } // namespace PICA