From f6c7a258ed109453e7fc8ecf90d44a9b301b07c1 Mon Sep 17 00:00:00 2001 From: degasus Date: Thu, 29 Dec 2016 18:15:41 +0100 Subject: [PATCH] BlendState: Use masking as a fastpath for the logic op NO_OP. --- Source/Core/VideoCommon/RenderState.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Source/Core/VideoCommon/RenderState.cpp b/Source/Core/VideoCommon/RenderState.cpp index 2750d43695..2e84646ce4 100644 --- a/Source/Core/VideoCommon/RenderState.cpp +++ b/Source/Core/VideoCommon/RenderState.cpp @@ -108,12 +108,21 @@ void BlendingState::Generate(const BPMemory& bp) // The logicop bit has the lowest priority else if (bp.blendmode.logicopenable) { - logicopenable = true; - logicmode = bp.blendmode.logicmode; - - if (dstalpha) + if (bp.blendmode.logicmode == BlendMode::NOOP) { - // TODO: Not supported by backends. + // Fast path for Kirby's Return to Dreamland, they use it with dstAlpha. + colorupdate = false; + alphaupdate = alphaupdate && dstalpha; + } + else + { + logicopenable = true; + logicmode = bp.blendmode.logicmode; + + if (dstalpha) + { + // TODO: Not supported by backends. + } } } }