diff --git a/GPU/Common/SoftwareTransformCommon.cpp b/GPU/Common/SoftwareTransformCommon.cpp index ebbbfac279..a15c83e47f 100644 --- a/GPU/Common/SoftwareTransformCommon.cpp +++ b/GPU/Common/SoftwareTransformCommon.cpp @@ -60,7 +60,7 @@ static void SwapUVs(TransformedVertex &a, TransformedVertex &b) { // Note: 0 is BR and 2 is TL. -static void RotateUV(TransformedVertex v[4], float flippedMatrix[16]) { +static void RotateUV(TransformedVertex v[4], float flippedMatrix[16], float ySign) { // Transform these two coordinates to figure out whether they're flipped or not. Vec4f tl; Vec3ByMatrix44(tl.AsArray(), v[2].pos, flippedMatrix); @@ -72,8 +72,8 @@ static void RotateUV(TransformedVertex v[4], float flippedMatrix[16]) { const float invbrw = 1.0f / br.w; const float x1 = tl.x * invtlw; const float x2 = br.x * invbrw; - const float y1 = tl.y * invtlw; - const float y2 = br.y * invbrw; + const float y1 = tl.y * invtlw * ySign; + const float y2 = br.y * invbrw * ySign; if ((x1 < x2 && y1 < y2) || (x1 > x2 && y1 > y2)) SwapUVs(v[1], v[3]); @@ -130,7 +130,7 @@ static bool IsReallyAClear(const TransformedVertex *transformed, int numVerts) { void SoftwareTransform( int prim, u8 *decoded, int vertexCount, u32 vertType, u16 *&inds, int indexType, - const DecVtxFormat &decVtxFormat, int &maxIndex, FramebufferManagerCommon *fbman, TextureCacheCommon *texCache, TransformedVertex *transformed, TransformedVertex *transformedExpanded, TransformedVertex *&drawBuffer, int &numTrans, bool &drawIndexed, SoftwareTransformResult *result) { + const DecVtxFormat &decVtxFormat, int &maxIndex, FramebufferManagerCommon *fbman, TextureCacheCommon *texCache, TransformedVertex *transformed, TransformedVertex *transformedExpanded, TransformedVertex *&drawBuffer, int &numTrans, bool &drawIndexed, SoftwareTransformResult *result, float ySign) { bool throughmode = (vertType & GE_VTYPE_THROUGH_MASK) != 0; bool lmode = gstate.isUsingSecondaryColor() && gstate.isLightingEnabled(); @@ -540,7 +540,7 @@ void SoftwareTransform( if (throughmode) RotateUVThrough(trans); else - RotateUV(trans, flippedMatrix); + RotateUV(trans, flippedMatrix, ySign); // Triangle: BR-TR-TL indsOut[0] = i * 2 + 0; diff --git a/GPU/Common/SoftwareTransformCommon.h b/GPU/Common/SoftwareTransformCommon.h index 2b8e99574f..581bfbfbd5 100644 --- a/GPU/Common/SoftwareTransformCommon.h +++ b/GPU/Common/SoftwareTransformCommon.h @@ -39,4 +39,4 @@ struct SoftwareTransformResult { }; void SoftwareTransform(int prim, u8 *decoded, int vertexCount, u32 vertexType, u16 *&inds, int indexType, const DecVtxFormat &decVtxFormat, int &maxIndex, FramebufferManagerCommon *fbman, TextureCacheCommon *texCache, TransformedVertex *transformed, TransformedVertex *transformedExpanded, TransformedVertex *&drawBuffer, - int &numTrans, bool &drawIndexed, SoftwareTransformResult *result); + int &numTrans, bool &drawIndexed, SoftwareTransformResult *result, float ySign); diff --git a/GPU/Directx9/TransformPipelineDX9.cpp b/GPU/Directx9/TransformPipelineDX9.cpp index 533fcffd9c..6b7eb88252 100644 --- a/GPU/Directx9/TransformPipelineDX9.cpp +++ b/GPU/Directx9/TransformPipelineDX9.cpp @@ -826,7 +826,7 @@ rotateVBO: SoftwareTransform( prim, decoded, indexGen.VertexCount(), dec_->VertexType(), inds, GE_VTYPE_IDX_16BIT, dec_->GetDecVtxFmt(), - maxIndex, framebufferManager_, textureCache_, transformed, transformedExpanded, drawBuffer, numTrans, drawIndexed, &result); + maxIndex, framebufferManager_, textureCache_, transformed, transformedExpanded, drawBuffer, numTrans, drawIndexed, &result, -1.0f); if (result.action == SW_DRAW_PRIMITIVES) { if (result.setStencil) { diff --git a/GPU/GLES/TransformPipeline.cpp b/GPU/GLES/TransformPipeline.cpp index 0ccba4ccaf..748bc9fae4 100644 --- a/GPU/GLES/TransformPipeline.cpp +++ b/GPU/GLES/TransformPipeline.cpp @@ -809,7 +809,7 @@ rotateVBO: SoftwareTransform( prim, decoded, indexGen.VertexCount(), dec_->VertexType(), inds, GE_VTYPE_IDX_16BIT, dec_->GetDecVtxFmt(), - maxIndex, framebufferManager_, textureCache_, transformed, transformedExpanded, drawBuffer, numTrans, drawIndexed, &result); + maxIndex, framebufferManager_, textureCache_, transformed, transformedExpanded, drawBuffer, numTrans, drawIndexed, &result, 1.0); if (result.action == SW_DRAW_PRIMITIVES) { if (result.setStencil) {