Prescale UV bugfixes

This commit is contained in:
Henrik Rydgard 2013-10-09 23:09:16 +02:00
parent d0c3988eea
commit 5c3f6bae25
4 changed files with 14 additions and 3 deletions

View file

@ -441,6 +441,7 @@ GLES_GPU::GLES_GPU()
// No need to flush before the tex scale/offset commands if we are baking
// the tex scale/offset into the vertices anyway.
if (g_Config.bPrescaleUV) {
commandFlags_[GE_CMD_TEXSCALEU] &= ~FLAG_FLUSHBEFOREONCHANGE;
commandFlags_[GE_CMD_TEXSCALEV] &= ~FLAG_FLUSHBEFOREONCHANGE;

View file

@ -946,6 +946,9 @@ void TransformDrawEngine::SubmitPrim(void *verts, void *inds, GEPrimitiveType pr
}
void TransformDrawEngine::DecodeVerts() {
UVScale origUV;
if (uvScale)
origUV = gstate_c.uv;
for (int i = 0; i < numDrawCalls; i++) {
const DeferredDrawCall &dc = drawCalls[i];
@ -975,7 +978,7 @@ void TransformDrawEngine::DecodeVerts() {
while (j < numDrawCalls) {
if (drawCalls[j].verts != dc.verts)
break;
if (uvScale && memcmp(&uvScale[j], &uvScale[i], sizeof(uvScale[0]) != 0))
if (uvScale && memcmp(&uvScale[j], &uvScale[i], sizeof(uvScale[0])) != 0)
break;
indexLowerBound = std::min(indexLowerBound, (int)drawCalls[j].indexLowerBound);
@ -1016,6 +1019,8 @@ void TransformDrawEngine::DecodeVerts() {
// Force to points (0)
indexGen.AddPrim(GE_PRIM_POINTS, 0);
}
if (uvScale)
gstate_c.uv = origUV;
}
u32 TransformDrawEngine::ComputeHash() {
@ -1036,6 +1041,11 @@ u32 TransformDrawEngine::ComputeHash() {
fullhash += XXH32((const char *)drawCalls[i].inds, indexSize * drawCalls[i].vertexCount, 0x955FD1CA);
}
}
if (uvScale) {
for (int i = 0; i < numDrawCalls; i++) {
fullhash += XXH32(&uvScale[i], sizeof(uvScale[0]), 0x0123e658);
}
}
return fullhash;
}

2
lang

@ -1 +1 @@
Subproject commit 60b4010fb4b16fb83718172a08a4850df6f0d8da
Subproject commit 50fe9235cde6004892fe3bb04f8780c693d5b38a

2
native

@ -1 +1 @@
Subproject commit 67bea6c7ed9eba715d42164944c70ba5a2838223
Subproject commit c18d1bcc6d8690145211fd4f65260930d28d44e6