diff --git a/GPU/GLES/FragmentShaderGenerator.cpp b/GPU/GLES/FragmentShaderGenerator.cpp index cef7641172a5..1d33d3f51c4c 100644 --- a/GPU/GLES/FragmentShaderGenerator.cpp +++ b/GPU/GLES/FragmentShaderGenerator.cpp @@ -130,6 +130,7 @@ void ComputeFragmentShaderID(FragmentShaderID *id) { id->d[0] |= gstate.getTextureFunction() << 2; id->d[0] |= (doTextureAlpha & 1) << 5; // rgb or rgba } + id->d[0] |= (lmode & 1) << 7; id->d[0] |= gstate.isAlphaTestEnabled() << 8; if (enableAlphaTest) diff --git a/GPU/GLES/StateMapping.cpp b/GPU/GLES/StateMapping.cpp index 92f8a94f2444..369f5af2095e 100644 --- a/GPU/GLES/StateMapping.cpp +++ b/GPU/GLES/StateMapping.cpp @@ -217,7 +217,13 @@ void TransformDrawEngine::ApplyDrawState(int prim) { } // At this point, through all paths above, glBlendFuncA and glBlendFuncB will be set right somehow. - glstate.blendFunc.set(glBlendFuncA, glBlendFuncB); +#if 1 + // 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. + glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, GL_ZERO, GL_ONE); +#else + glstate.blendFuncSeparate.set(glBlendFuncA, glBlendFuncB, glBlendFuncA, glBlendFuncB); +#endif glstate.blendEquation.set(eqLookup[blendFuncEq]); } diff --git a/GPU/GeDisasm.cpp b/GPU/GeDisasm.cpp index 7c002126762c..e7e34f7864f2 100644 --- a/GPU/GeDisasm.cpp +++ b/GPU/GeDisasm.cpp @@ -749,9 +749,26 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *buffer) { "unsupported1", "unsupported2", }; - const char *blendFactors[] = { - "a", - "1.0 - a", + const char *blendFactorsA[16] = { + "dst", + "1.0 - dst", + "src.a", + "1.0 - src.a", + "dst.a", + "1.0 - dst.a", + "2.0 * src.a", + "1.0 - 2.0 * src.a", + "2.0 * dst.a", + "1.0 - 2.0 * dst.a", + "fixed", + "fixed2", + "fixed3", + "fixed4", + "fixed5", + }; + const char *blendFactorsB[16] = { + "src", + "1.0 - src", "src.a", "1.0 - src.a", "dst.a", @@ -765,11 +782,10 @@ void GeDisassembleOp(u32 pc, u32 op, u32 prev, char *buffer) { "fixed3", "fixed4", "fixed5", - "fixed6", }; - const char *blendFactorA = blendFactors[(data >> 0) & 0xF]; - const char *blendFactorB = blendFactors[(data >> 4) & 0xF]; + const char *blendFactorA = blendFactorsA[(data >> 0) & 0xF]; + const char *blendFactorB = blendFactorsB[(data >> 4) & 0xF]; const char *blendMode = blendModes[(data >> 8) & 0x7]; if (data & ~0xFF0007FF) diff --git a/UI/UIShader.cpp b/UI/UIShader.cpp index 8401ce292c5b..a47a85965e18 100644 --- a/UI/UIShader.cpp +++ b/UI/UIShader.cpp @@ -98,7 +98,7 @@ void UIShader_Prepare() glstate.dither.enable(); glstate.blend.enable(); - glstate.blendFunc.set(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glstate.blendFuncSeparate.set(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glstate.blendEquation.set(GL_FUNC_ADD); glstate.depthWrite.set(GL_TRUE); diff --git a/native b/native index a8b45a68b961..45d65225a6f2 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit a8b45a68b961d655b68c7166a798cb0b6447f039 +Subproject commit 45d65225a6f2fe8b8befe43786d6e54b066a7fbf