diff --git a/GPU/GLES/FragmentShaderGenerator.cpp b/GPU/GLES/FragmentShaderGenerator.cpp index 65b76c2a0b13..eeac7f593c93 100644 --- a/GPU/GLES/FragmentShaderGenerator.cpp +++ b/GPU/GLES/FragmentShaderGenerator.cpp @@ -71,8 +71,8 @@ static bool IsAlphaTestTriviallyTrue() { // Non-zero check. If we have no depth testing (and thus no depth writing), and an alpha func that will result in no change if zero alpha, get rid of the alpha test. // Speeds up Lumines by a LOT on PowerVR. case GE_COMP_NOTEQUAL: - if ((gstate_c.vertexFullAlpha && (gstate_c.textureFullAlpha || !gstate.isTextureAlphaUsed())) && gstate.getAlphaTestRef() == 255) { - // Likely to be rare. Let's just have the alpha test take care of this instead of adding + if (gstate.getAlphaTestRef() == 255) { + // Likely to be rare. Let's just skip the vertexFullAlpha optimization here instead of adding // complicated code to discard the draw or whatnot. return false; } diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index c39709c04412..56ad4d08e512 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -609,6 +609,7 @@ void TransformDrawEngine::DoFlush() { vai->numVerts = indexGen.VertexCount(); vai->prim = indexGen.Prim(); vai->maxIndex = indexGen.MaxIndex(); + vai->flags = gstate_c.vertexFullAlpha ? VAI_FLAG_VERTEXFULLALPHA : 0; useElements = !indexGen.SeenOnlyPurePrims(); if (!useElements && indexGen.PureCount()) { vai->numVerts = indexGen.PureCount(); @@ -635,14 +636,13 @@ void TransformDrawEngine::DoFlush() { glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vai->ebo); useElements = vai->ebo ? true : false; gpuStats.numCachedVertsDrawn += vai->numVerts; + gstate_c.vertexFullAlpha = vai->flags & VAI_FLAG_VERTEXFULLALPHA; } vbo = vai->vbo; ebo = vai->ebo; vertexCount = vai->numVerts; maxIndex = vai->maxIndex; prim = static_cast(vai->prim); - - gstate_c.vertexFullAlpha = vai->flags & VAI_FLAG_VERTEXFULLALPHA; break; } diff --git a/GPU/GLES/VertexDecoder.cpp b/GPU/GLES/VertexDecoder.cpp index f8cae9348bf4..4ec327610979 100644 --- a/GPU/GLES/VertexDecoder.cpp +++ b/GPU/GLES/VertexDecoder.cpp @@ -849,7 +849,6 @@ void VertexDecoder::DecodeVerts(u8 *decodedptr, const void *verts, int indexLowe jitted_(ptr_, decoded_, count); } else { // Interpret the decode steps - // TODO: Init gstate_c.vertexFullAlpha here? Or in Setup? When is it reset? for (; count; count--) { for (int i = 0; i < numSteps_; i++) { ((*this).*steps_[i])();