diff --git a/plugins/GSdx/GSRendererDX.cpp b/plugins/GSdx/GSRendererDX.cpp index 0b0129ebbe..6c75f7e06b 100644 --- a/plugins/GSdx/GSRendererDX.cpp +++ b/plugins/GSdx/GSRendererDX.cpp @@ -276,7 +276,7 @@ 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() : m_filter; + bool bilinear = m_filter == 2 ? m_vt.IsLinear() : (bool)m_filter; ps_sel.wms = context->CLAMP.WMS; ps_sel.wmt = context->CLAMP.WMT; @@ -285,6 +285,8 @@ void GSRendererDX::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sourc 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.aem = env.TEXA.AEM; diff --git a/plugins/GSdx/GSTextureCache.cpp b/plugins/GSdx/GSTextureCache.cpp index 7a1ae9d91c..06984c49b2 100644 --- a/plugins/GSdx/GSTextureCache.cpp +++ b/plugins/GSdx/GSTextureCache.cpp @@ -56,6 +56,7 @@ void GSTextureCache::RemoveAll() GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, const GSVector4i& r) { const GSLocalMemory::psm_t& psm = GSLocalMemory::m_psm[TEX0.PSM]; + const GSLocalMemory::psm_t& cpsm = psm.pal > 0 ? GSLocalMemory::m_psm[TEX0.CPSM] : psm; const uint32* clut = m_renderer->m_mem.m_clut; Source* src = NULL; @@ -71,7 +72,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con continue; } - if((psm.trbpp == 16 || psm.trbpp == 24) && TEX0.TCC && TEXA != s->m_TEXA) + if(!m_paltex && TEX0.TCC && cpsm.fmt > 0 && TEXA != s->m_TEXA) { continue; } @@ -582,6 +583,9 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con bool hack = false; + if (dst) + dst->Update(); + if(m_spritehack && (TEX0.PSM == PSM_PSMT8 || TEX0.PSM == PSM_PSMT8H)) { src->m_spritehack_t = true; @@ -600,8 +604,6 @@ GSTextureCache::Source* GSTextureCache::CreateSource(const GIFRegTEX0& TEX0, con src->m_target = true; - dst->Update(); - GSTexture* tmp = NULL; if(dst->m_texture->IsMSAA())