From 0a5c679fe08869e98c11c04dc77f3ffead142d12 Mon Sep 17 00:00:00 2001 From: gabest11 Date: Fri, 18 Mar 2011 01:58:16 +0000 Subject: [PATCH] GSdx: the TEX1.LCM == 1 mode was still unfinished, the field in PES 2011 for example. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@4449 96395faa-99c1-11dd-bbfe-3dabce05a288 --- plugins/GSdx/GSDrawScanlineCodeGenerator.x86.avx.cpp | 10 +++++++--- plugins/GSdx/GSDrawScanlineCodeGenerator.x86.cpp | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.avx.cpp b/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.avx.cpp index 4fcb0fa798..51b5a7674f 100644 --- a/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.avx.cpp +++ b/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.avx.cpp @@ -1250,6 +1250,8 @@ return; vmovq(xmm4, ptr[&m_local.gd->t.minmax]); + vpsrlw(xmm4, xmm0); + vpunpcklwd(xmm4, xmm4); vpunpckldq(xmm5, xmm4, xmm4); vpunpckhdq(xmm6, xmm4, xmm4); @@ -1728,7 +1730,7 @@ return; vpsrlw(xmm6, 8); } - vmovdqa(xmm0, ptr[&m_local.temp.lod.f]); + vmovdqa(xmm0, ptr[m_sel.lcm ? &m_local.gd->lod.f : &m_local.temp.lod.f]); vpsrlw(xmm0, xmm0, 1); vmovdqa(xmm2, ptr[&m_local.temp.trb]); @@ -2761,6 +2763,8 @@ void GSDrawScanlineCodeGenerator::ReadTexel(int pixels, int mip_offset) mip_offset *= sizeof(void*); + const GSVector4i* lod_i = m_sel.lcm ? &m_local.gd->lod.i : &m_local.temp.lod.i; + if(m_sel.mmin) { int r[] = {5, 6, 2, 4, 0, 1, 3, 7}; @@ -2771,7 +2775,7 @@ void GSDrawScanlineCodeGenerator::ReadTexel(int pixels, int mip_offset) for(int j = 0; j < 4; j++) { - mov(ebx, ptr[&m_local.temp.lod.i.u32[j]]); + mov(ebx, ptr[&lod_i->u32[j]]); mov(ebx, ptr[edx + ebx * sizeof(void*) + mip_offset]); for(int i = 0; i < 4; i++) @@ -2787,7 +2791,7 @@ void GSDrawScanlineCodeGenerator::ReadTexel(int pixels, int mip_offset) { for(int j = 0; j < 4; j++) { - mov(ebx, ptr[&m_local.temp.lod.i.u32[j]]); + mov(ebx, ptr[&lod_i->u32[j]]); mov(ebx, ptr[edx + ebx * sizeof(void*) + mip_offset]); ReadTexel(xmm6, xmm5, j); diff --git a/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.cpp b/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.cpp index 0eace8f3a1..5da468bf88 100644 --- a/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.cpp +++ b/plugins/GSdx/GSDrawScanlineCodeGenerator.x86.cpp @@ -1299,6 +1299,8 @@ void GSDrawScanlineCodeGenerator::SampleTextureLOD() movq(xmm4, ptr[&m_local.gd->t.minmax]); + psrlw(xmm4, xmm0); + punpcklwd(xmm4, xmm4); movdqa(xmm5, xmm4); movdqa(xmm6, xmm4); @@ -1803,7 +1805,7 @@ void GSDrawScanlineCodeGenerator::SampleTextureLOD() psrlw(xmm6, 8); } - movdqa(xmm0, ptr[&m_local.temp.lod.f]); + movdqa(xmm0, ptr[m_sel.lcm ? &m_local.gd->lod.f : &m_local.temp.lod.f]); psrlw(xmm0, 1); movdqa(xmm2, ptr[&m_local.temp.trb]); @@ -2916,6 +2918,8 @@ void GSDrawScanlineCodeGenerator::ReadTexel(int pixels, int mip_offset) mip_offset *= sizeof(void*); + const GSVector4i* lod_i = m_sel.lcm ? &m_local.gd->lod.i : &m_local.temp.lod.i; + if(m_sel.mmin) { #if _M_SSE >= 0x401 @@ -2928,7 +2932,7 @@ void GSDrawScanlineCodeGenerator::ReadTexel(int pixels, int mip_offset) for(int j = 0; j < 4; j++) { - mov(ebx, ptr[&m_local.temp.lod.i.u32[j]]); + mov(ebx, ptr[&lod_i->u32[j]]); mov(ebx, ptr[edx + ebx * sizeof(void*) + mip_offset]); for(int i = 0; i < 4; i++) @@ -2944,7 +2948,7 @@ void GSDrawScanlineCodeGenerator::ReadTexel(int pixels, int mip_offset) { for(int j = 0; j < 4; j++) { - mov(ebx, ptr[&m_local.temp.lod.i.u32[j]]); + mov(ebx, ptr[&lod_i->u32[j]]); mov(ebx, ptr[edx + ebx * sizeof(void*) + mip_offset]); ReadTexel(xmm6, xmm5, j);