From a0e960b77dc396fb844dcdcdd1d225bd86fb7b1d Mon Sep 17 00:00:00 2001 From: "sudonim1@gmail.com" Date: Tue, 9 Apr 2013 22:17:49 +0000 Subject: [PATCH] GSDX: Disable a buggy vertex tracer optimisation in GetTextureMinMax (produces a rectangle with a negative dimension leaving it still empty after the follow block which is likely a hack itself). Fixes textures in Kingdom Hearts 2's tron stage. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5610 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSState.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugins/GSdx/GSState.cpp b/plugins/GSdx/GSState.cpp index 093b2ec814..af6289f914 100644 --- a/plugins/GSdx/GSState.cpp +++ b/plugins/GSdx/GSState.cpp @@ -2562,6 +2562,9 @@ void GSState::GetTextureMinMax(GSVector4i& r, const GIFRegTEX0& TEX0, const GIFR __assume(0); } +// Kingdom Hearts 2's tron section shows a bug with the CLAMP_REPEAT code here. +// This is just an optimisation so it's disabled until the bug is found. +#if 0 if(wms + wmt < 6) { GSVector4 st = m_vt.m_min.t.xyxy(m_vt.m_max.t); @@ -2577,6 +2580,7 @@ void GSState::GetTextureMinMax(GSVector4i& r, const GIFRegTEX0& TEX0, const GIFR int mask = 0; + // This part is suspicious, as far as I can tell it zeroes fields if tw/th aren't 0, which is probably not the intent if(wms == CLAMP_REPEAT || wmt == CLAMP_REPEAT) { u = uv & GSVector4i::xffffffff().srl32(32 - tw); @@ -2622,6 +2626,7 @@ void GSState::GetTextureMinMax(GSVector4i& r, const GIFRegTEX0& TEX0, const GIFR __assume(0); } } +#endif vr = vr.rintersect(tr);