From 0a5f796c337e0066b36285a7863fcee2ab2c09a9 Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Sun, 5 Mar 2017 20:23:59 +0100 Subject: [PATCH] gsdx sw: missing texture due to wrong optimization fix Typical bug, missing/wrong texture on the SW renderer but working fine on the HW renderer Debugged on ATV Quad Power Racing 2 but I suspect couple of game are impacted Bug description: GSdx flatten the Q value of sprite. So m_vt.m_eq.q is true when Q(2N+1) are the same. Q(2N) values could be random. The fix replaces Q0 by Q1 for the uniform Q value. --- plugins/GSdx/GSRendererSW.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/GSdx/GSRendererSW.cpp b/plugins/GSdx/GSRendererSW.cpp index 5d0de3480f..a4915580f5 100644 --- a/plugins/GSdx/GSRendererSW.cpp +++ b/plugins/GSdx/GSRendererSW.cpp @@ -1163,7 +1163,9 @@ bool GSRendererSW::GetScanlineGlobalData(SharedData* data) { gd.sel.fst = 1; - const GSVector4& t = v[data->index[0]].t; + // Q is flat on sprite (at least GSdx is based on this Hypothesis). So it means + // that Q0 could be invalid for example ATV Quad Power Racing 2. + const GSVector4& t = v[data->index[primclass == GS_SPRITE_CLASS ? 1 : 0]].t; if(t.z != 1.0f) {