From 815c99b6e4c20e90eabc48ebc714a438fbddaf75 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 12 Apr 2015 17:57:37 +0200 Subject: [PATCH] gsdx-hack: remove an extra offset + duplicate linear computing Initially code aligned texture on pixel boundary + 1/16th. It seems to work without it. --- plugins/GSdx/GSRendererHW.cpp | 40 ++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/plugins/GSdx/GSRendererHW.cpp b/plugins/GSdx/GSRendererHW.cpp index 39414347ec..c8fc81a45c 100644 --- a/plugins/GSdx/GSRendererHW.cpp +++ b/plugins/GSdx/GSRendererHW.cpp @@ -282,21 +282,41 @@ void GSRendererHW::RoundSpriteOffset() // will be sampled so (t0 - 8) and (t1 - 8 + 16) must be valid. // // Minus half for t1 case might be too much - if (tx0 <= tx1) { - v[i].U = tx0 + half + 1; - v[i+1].U = tx1 - half + 1 + 15; + if (linear) { + if (tx0 <= tx1) { + v[i].U = tx0 + half; + v[i+1].U = tx1 - half + 16; + } else { + v[i].U = tx0 + 15; + v[i+1].U = tx1 + 15 + 16; + } } else { - v[i].U = tx0 + 15; - v[i+1].U = tx1 + 15 + 16; + if (tx0 <= tx1) { + v[i].U = tx0; + v[i+1].U = tx1 + 16; + } else { + v[i].U = tx0 + 15; + v[i+1].U = tx1 + 15 + 16; + } } #endif #if 1 - if (ty0 <= ty1) { - v[i].V = ty0 + half + 1; - v[i+1].V = ty1 - half + 1 + 15; + if (linear) { + if (ty0 <= ty1) { + v[i].V = ty0 + half; + v[i+1].V = ty1 - half + 16; + } else { + v[i].V = ty0 + 15; + v[i+1].V = ty1 + 15 + 16; + } } else { - v[i].V = ty0 + 15; - v[i+1].V = ty1 + 15 + 16; + if (ty0 <= ty1) { + v[i].V = ty0; + v[i+1].V = ty1 + 16; + } else { + v[i].V = ty0 + 15; + v[i+1].V = ty1 + 15 + 16; + } } #endif