mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-04 19:55:27 +02:00
Float TC coordinates apparently work in through mode. Add one more special case for blending.
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
+1
-1
Submodule native updated: 975986f79b...5ca7692912
Reference in New Issue
Block a user