From 33efffe7594bb4a7e4e5e63382152a7e9984ba1c Mon Sep 17 00:00:00 2001 From: Henrik Rydgard Date: Tue, 3 Dec 2013 11:27:31 +0100 Subject: [PATCH] When blending (and we thus can't use stencil-to-alpha in frag shader), always write zero to alpha. It seems the PSP doesn't blend in the alpha channel. Reduces glow problems in Gods Eater Burst and Wipeout - although Wipeout loses some glow that should be there. --- GPU/GLES/StateMapping.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/GPU/GLES/StateMapping.cpp b/GPU/GLES/StateMapping.cpp index 31aa57063e..0243b9d167 100644 --- a/GPU/GLES/StateMapping.cpp +++ b/GPU/GLES/StateMapping.cpp @@ -243,14 +243,12 @@ void TransformDrawEngine::ApplyDrawState(int prim) { #endif // At this point, through all paths above, glBlendFuncA and glBlendFuncB will be set right somehow. - if (!gstate.isStencilTestEnabled() && gstate.isDepthWriteEnabled()) { - // Fixes some Persona 2 issues, may be correct? (that is, don't change dest alpha at all if blending) - // If this doesn't break anything else, it's likely to be right. - // I guess an alternative solution would be to simply disable alpha writes if alpha blending is enabled. - glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, GL_ZERO, GL_ZERO); - } else { - glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, glBlendFuncA, glBlendFuncB); - } + + // The stencil-to-alpha in fragment shader doesn't apply here (blending is enabled), and we shouldn't + // do any blending in the alpha channel as that doesn't seem to happen on PSP. So lacking a better option, + // the only value we can set alpha to here without multipass and dual source alpha is zero (by setting + // the factors to zero). So let's do that. + glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, GL_ZERO, GL_ZERO); // Don't report on Android device (why?) #if !defined(USING_GLES2)