GSDX: Fix splinter cell double agent (and others) regression. Texture cache hits no longer depend on TEXA ever, GPU load however is increased. The last regression I think?

So, in the end I only properly understood the old code after finding all the problems with my version.  I'm not sure whether any changes I've made are improvements any more, I'll need to review it with what I've learned in mind.  This effort might've been a big waste of time.

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@5329 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
sudonim1@gmail.com 2012-06-27 00:57:44 +00:00
parent 540d098794
commit 80ba8ff16a
3 changed files with 16 additions and 20 deletions

View File

@ -276,23 +276,20 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
if(tex)
{
const GSLocalMemory::psm_t &psm = GSLocalMemory::m_psm[context->TEX0.PSM];
bool bilinear = m_filter == 2 ? m_vt.IsLinear() : (bool)m_filter;
const GSLocalMemory::psm_t &cpsm = psm.pal > 0 ? GSLocalMemory::m_psm[context->TEX0.CPSM] : psm;
bool bilinear = m_filter == 2 ? m_vt.IsLinear() : m_filter != 0;
bool simple_sample = !tex->m_palette && cpsm.fmt == 0 && context->CLAMP.WMS < 3 && context->CLAMP.WMT < 3;
ps_sel.wms = context->CLAMP.WMS;
ps_sel.wmt = context->CLAMP.WMT;
if (tex->m_palette)
{
const GSLocalMemory::psm_t &cpsm = GSLocalMemory::m_psm[context->TEX0.CPSM];
ps_sel.fmt = cpsm.fmt | 4;
}
else if (psm.pal > 0)
ps_sel.fmt = 0;
else
ps_sel.fmt = psm.fmt;
ps_sel.fmt = cpsm.fmt;
ps_sel.aem = env.TEXA.AEM;
ps_sel.tfx = context->TEX0.TFX;
ps_sel.tcc = context->TEX0.TCC;
ps_sel.ltf = bilinear && !(ps_sel.fmt <= 2 && ps_sel.wms < 3 && ps_sel.wmt < 3);
ps_sel.ltf = bilinear && !simple_sample;
ps_sel.rt = tex->m_target;
ps_sel.spritehack = tex->m_spritehack_t;
@ -324,7 +321,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
ps_ssel.tau = (context->CLAMP.WMS + 3) >> 1;
ps_ssel.tav = (context->CLAMP.WMT + 3) >> 1;
ps_ssel.ltf = bilinear && ps_sel.fmt <= 2 && ps_sel.wms < 3 && ps_sel.wmt < 3;
ps_ssel.ltf = bilinear && simple_sample;
}
else
{

View File

@ -80,11 +80,6 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
continue;
}
if(!m_paltex && TEX0.TCC && cpsm.fmt > 0 && TEXA != s->m_TEXA)
{
continue;
}
if(s->m_palette == NULL && psm.pal > 0 && !GSVector4i::compare64(clut, s->m_clut, psm.pal * sizeof(clut[0])))
{
continue;
@ -1039,13 +1034,17 @@ void GSTextureCache::Source::Flush(uint32 count)
GSLocalMemory::readTexture rtx = psm.rtx;
GIFRegTEXA plainTEXA;
plainTEXA.AEM = 1;
plainTEXA.TA0 = 0;
plainTEXA.TA1 = 0x80;
if(m_palette)
{
pitch >>= 2;
rtx = psm.rtxP;
}
else if (psm.pal > 0)
m_renderer->m_mem.m_clut.Read32(m_TEX0, m_TEXA);
uint8* buff = m_temp;
@ -1065,13 +1064,13 @@ void GSTextureCache::Source::Flush(uint32 count)
if(m_texture->Map(m, &r))
{
(mem.*rtx)(o, r, m.bits, m.pitch, m_TEXA);
(mem.*rtx)(o, r, m.bits, m.pitch, plainTEXA);
m_texture->Unmap();
}
else
{
(mem.*rtx)(o, r, buff, pitch, m_TEXA);
(mem.*rtx)(o, r, buff, pitch, plainTEXA);
m_texture->Update(r, buff, pitch);
}

View File

@ -362,12 +362,12 @@ float4 sample(float2 st, float q)
float2 dd;
/*
if(PS_FMT <= FMT_16 && PS_WMS < 2 && PS_WMT < 2)
if(!PS_LTF && PS_FMT <= FMT_16 && PS_WMS < 2 && PS_WMT < 2)
{
c[0] = sample_c(st);
}
*/
if(PS_FMT <= FMT_16 && PS_WMS < 3 && PS_WMT < 3)
if (!PS_LTF && PS_FMT <= FMT_16 && PS_WMS < 3 && PS_WMT < 3)
{
c[0] = sample_c(clampuv(st));
}