From cb2440d79c8ce126da5cf46629d5bc2375ea883c Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Mon, 7 Mar 2022 22:08:48 -0800 Subject: [PATCH] CTevCombiners: Remove hack in CTevPass::Execute --- Runtime/Graphics/CTevCombiners.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/Runtime/Graphics/CTevCombiners.cpp b/Runtime/Graphics/CTevCombiners.cpp index 8035ad221..07e0f658b 100644 --- a/Runtime/Graphics/CTevCombiners.cpp +++ b/Runtime/Graphics/CTevCombiners.cpp @@ -4,18 +4,7 @@ namespace metaforce::CTevCombiners { u32 CTevPass::sNextUniquePass = 0; void CTevPass::Execute(ERglTevStage stage) const { - if (*this == skPassThru) { - // TODO proper handling of # tev stages - if (stage > ERglTevStage::Stage0) { - aurora::gfx::disable_tev_stage(stage); - } else { - aurora::gfx::disable_tev_stage(ERglTevStage::Stage1); - } - } else { - aurora::gfx::update_tev_stage(stage, x4_colorPass, x14_alphaPass, x24_colorOp, x38_alphaOp); - aurora::gfx::set_tev_order(static_cast(stage), GX::TEXCOORD_NULL, static_cast(stage), - GX::COLOR_NULL); - } + aurora::gfx::update_tev_stage(stage, x4_colorPass, x14_alphaPass, x24_colorOp, x38_alphaOp); } constexpr u32 maxTevPasses = 2; @@ -104,7 +93,10 @@ bool SetPassCombiners(ERglTevStage stage, const CTevPass& pass) { } void RecomputePasses() { - sNumEnabledPasses = std::count(sValidPasses.begin(), sValidPasses.end(), true); + sNumEnabledPasses = 1 - static_cast(sValidPasses[1]); + for (u32 i = sNumEnabledPasses; i < u32(ERglTevStage::MAX); ++i) { + aurora::gfx::disable_tev_stage(ERglTevStage(i)); + } // CGX::SetNumTevStages(sNumEnabledPasses); }