diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index fc9a38f3bb..173d44ee2a 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -530,6 +530,9 @@ void TransformAndDrawPrim(void *verts, void *inds, int prim, int vertexCount, Li // TODO: All this setup is soon so expensive that we'll need dirty flags, or simply do it in the command writes where we detect dirty by xoring. Silly to do all this work on every drawcall. + // TODO: The top bit of the alpha channel should be written to the stencil bit somehow. This appears to require very expensive multipass rendering :( Alternatively, one could do a + // single fullscreen pass that converts alpha to stencil (or 2 passes, to set both the 0 and 1 values) very easily. + // Set cull bool wantCull = !gstate.isModeClear() && !gstate.isModeThrough() && gstate.isCullEnabled(); glstate.cullFace.set(wantCull); @@ -588,6 +591,11 @@ void TransformAndDrawPrim(void *verts, void *inds, int prim, int vertexCount, Li glBlendFuncB = GL_ONE_MINUS_CONSTANT_COLOR; const float blendColor[4] = {(fixA & 0xFF)/255.0f, ((fixA >> 8) & 0xFF)/255.0f, ((fixA >> 16) & 0xFF)/255.0f, 1.0f}; glstate.blendColor.set(blendColor); + } else if (fixA == fixB) { + glBlendFuncA = GL_CONSTANT_COLOR; + glBlendFuncB = GL_CONSTANT_COLOR; + const float blendColor[4] = {(fixA & 0xFF)/255.0f, ((fixA >> 8) & 0xFF)/255.0f, ((fixA >> 16) & 0xFF)/255.0f, 1.0f}; + glstate.blendColor.set(blendColor); } else { NOTICE_LOG(HLE, "ERROR INVALID blendcolorstate: FixA=%06x FixB=%06x FuncA=%i FuncB=%i", gstate.getFixA(), gstate.getFixB(), gstate.getBlendFuncA(), gstate.getBlendFuncB()); glBlendFuncA = GL_ONE; diff --git a/GPU/GLES/VertexDecoder.cpp b/GPU/GLES/VertexDecoder.cpp index 7e2a0e30db..167aab7fc0 100644 --- a/GPU/GLES/VertexDecoder.cpp +++ b/GPU/GLES/VertexDecoder.cpp @@ -190,7 +190,7 @@ void VertexDecoder::DecodeVerts(DecodedVertex *decoded, const void *verts, const { const u8 *uvdata = (const u8*)(ptr + tcoff); for (int j = 0; j < 2; j++) - uv[j] = (float)uvdata[j]/255.0f; + uv[j] = (float)uvdata[j] / 255.0f; break; } @@ -213,8 +213,13 @@ void VertexDecoder::DecodeVerts(DecodedVertex *decoded, const void *verts, const case GE_VTYPE_TC_FLOAT: { const float *uvdata = (const float*)(ptr + tcoff); - for (int j = 0; j < 2; j++) - uv[j] = uvdata[j]; + if (throughmode) { + uv[0] = uvdata[0] / (float)(gstate_c.curTextureWidth); + uv[1] = uvdata[1] / (float)(gstate_c.curTextureHeight); + } else { + uv[0] = uvdata[0]; + uv[1] = uvdata[1]; + } } break; } diff --git a/native b/native index 975986f79b..5ca7692912 160000 --- a/native +++ b/native @@ -1 +1 @@ -Subproject commit 975986f79b693952d64272a752ffaded21a84afd +Subproject commit 5ca7692912c7bb53e1019bffbedbb09fd9d0a525