Skip to content

Commit

Permalink
Make sure vai->flags are set while hashing.
Browse files Browse the repository at this point in the history
Since we decode the verts in this case we have a fresh flag.  Might
be #5718?
  • Loading branch information
unknownbrackets committed Mar 25, 2014
1 parent c8ce5d6 commit 69c2500
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions GPU/GLES/FragmentShaderGenerator.cpp
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions GPU/GLES/TransformPipeline.cpp
Expand Up @@ -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();
Expand All @@ -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<GEPrimitiveType>(vai->prim);

gstate_c.vertexFullAlpha = vai->flags & VAI_FLAG_VERTEXFULLALPHA;
break;
}

Expand Down
1 change: 0 additions & 1 deletion GPU/GLES/VertexDecoder.cpp
Expand Up @@ -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])();
Expand Down

0 comments on commit 69c2500

Please sign in to comment.