mirror of https://github.com/PCSX2/pcsx2.git
gsdx tc: remove old plain TEXA hack
It must work fine without it now. From the google code comments: It would be nice to test those games * Ar Tonelico 2 (line in sprite regression?) * breath of fire dragon quarter (overlayed user interface in the game) v2: update Dx code to use the good format
This commit is contained in:
parent
cf13cccb1e
commit
dc365e066d
|
@ -474,8 +474,12 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
|
|||
{
|
||||
const GSLocalMemory::psm_t &psm = GSLocalMemory::m_psm[m_context->TEX0.PSM];
|
||||
const GSLocalMemory::psm_t &cpsm = psm.pal > 0 ? GSLocalMemory::m_psm[m_context->TEX0.CPSM] : psm;
|
||||
// The texture cache will handle various format conversion internally for non-target texture
|
||||
// After the conversion the texture will be RGBA8 (aka 32 bits) hence the 0 below
|
||||
int gpu_tex_fmt = (tex->m_target) ? cpsm.fmt : 0;
|
||||
|
||||
bool bilinear = m_filter == 2 ? m_vt.IsLinear() : m_filter != 0;
|
||||
bool simple_sample = !tex->m_palette && cpsm.fmt == 0 && m_context->CLAMP.WMS < 3 && m_context->CLAMP.WMT < 3;
|
||||
bool simple_sample = !tex->m_palette && gpu_tex_fmt == 0 && m_context->CLAMP.WMS < 3 && m_context->CLAMP.WMT < 3;
|
||||
// Don't force extra filtering on sprite (it creates various upscaling issue)
|
||||
bilinear &= !((m_vt.m_primclass == GS_SPRITE_CLASS) && m_userhacks_round_sprite_offset && !m_vt.IsLinear());
|
||||
|
||||
|
@ -484,7 +488,7 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc
|
|||
if (ps_sel.shuffle) {
|
||||
ps_sel.fmt = 0;
|
||||
} else {
|
||||
ps_sel.fmt = tex->m_palette ? cpsm.fmt | 4 : cpsm.fmt;
|
||||
ps_sel.fmt = tex->m_palette ? gpu_tex_fmt | 4 : gpu_tex_fmt;
|
||||
}
|
||||
ps_sel.aem = m_env.TEXA.AEM;
|
||||
ps_sel.tfx = m_context->TEX0.TFX;
|
||||
|
|
|
@ -548,16 +548,8 @@ void GSRendererHW::Draw()
|
|||
|
||||
m_context->offset.tex = m_mem.GetOffset(TEX0.TBP0, TEX0.TBW, TEX0.PSM);
|
||||
|
||||
/*
|
||||
|
||||
// m_tc->LookupSource will mess with the palette, should not, but we do this after, until it is sorted out
|
||||
|
||||
if(tex_psm.pal > 0)
|
||||
{
|
||||
m_mem.m_clut.Read32(context->TEX0, env.TEXA);
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
GSVector4i r;
|
||||
|
||||
|
@ -565,12 +557,6 @@ void GSRendererHW::Draw()
|
|||
|
||||
tex = tex_psm.depth ? m_tc->LookupDepthSource(TEX0, env.TEXA, r) : m_tc->LookupSource(TEX0, env.TEXA, r);
|
||||
|
||||
// FIXME: Could be removed on openGL
|
||||
if(tex_psm.pal > 0)
|
||||
{
|
||||
m_mem.m_clut.Read32(TEX0, env.TEXA);
|
||||
}
|
||||
|
||||
// Hypothesis: texture shuffle is used as a postprocessing effect so texture will be an old target.
|
||||
// Initially code also tested the RT but it gives too much false-positive
|
||||
//
|
||||
|
|
|
@ -178,17 +178,8 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
|
|||
//const GSLocalMemory::psm_t& cpsm = psm.pal > 0 ? GSLocalMemory::m_psm[TEX0.CPSM] : psm;
|
||||
|
||||
// Until DX is fixed
|
||||
if (s_IS_OPENGL) {
|
||||
if(psm_s.pal > 0)
|
||||
m_renderer->m_mem.m_clut.Read32(TEX0, TEXA);
|
||||
} else {
|
||||
GIFRegTEXA plainTEXA;
|
||||
|
||||
plainTEXA.AEM = 1;
|
||||
plainTEXA.TA0 = 0;
|
||||
plainTEXA.TA1 = 0x80;
|
||||
m_renderer->m_mem.m_clut.Read32(TEX0, plainTEXA);
|
||||
}
|
||||
|
||||
const uint32* clut = m_renderer->m_mem.m_clut;
|
||||
|
||||
|
@ -1671,17 +1662,6 @@ void GSTextureCache::Source::Flush(uint32 count)
|
|||
|
||||
GSLocalMemory::readTexture rtx = psm.rtx;
|
||||
|
||||
GIFRegTEXA plainTEXA;
|
||||
|
||||
// Until DX is fixed
|
||||
if (s_IS_OPENGL) {
|
||||
plainTEXA = m_TEXA;
|
||||
} else {
|
||||
plainTEXA.AEM = 1;
|
||||
plainTEXA.TA0 = 0;
|
||||
plainTEXA.TA1 = 0x80;
|
||||
}
|
||||
|
||||
if(m_palette)
|
||||
{
|
||||
pitch >>= 2;
|
||||
|
@ -1706,13 +1686,13 @@ void GSTextureCache::Source::Flush(uint32 count)
|
|||
|
||||
if(m_texture->Map(m, &r))
|
||||
{
|
||||
(mem.*rtx)(off, r, m.bits, m.pitch, plainTEXA);
|
||||
(mem.*rtx)(off, r, m.bits, m.pitch, m_TEXA);
|
||||
|
||||
m_texture->Unmap();
|
||||
}
|
||||
else
|
||||
{
|
||||
(mem.*rtx)(off, r, buff, pitch, plainTEXA);
|
||||
(mem.*rtx)(off, r, buff, pitch, m_TEXA);
|
||||
|
||||
m_texture->Update(r, buff, pitch);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue