gsdx hw: allow overlapping of texture (alpha) and framebuffer (RGB)

Fix HUD on Berserk

v2: use fbmask instead of hacking the target format to 24 bits.
This commit is contained in:
Gregory Hainaut 2016-10-03 20:34:04 +02:00
parent 25e76d0564
commit a4658eac24
3 changed files with 4 additions and 4 deletions

View File

@ -493,7 +493,7 @@ void GSRendererHW::Draw()
GSTextureCache::Target* rt = NULL;
GSTexture* rt_tex = NULL;
if (!no_rt) {
rt = m_tc->LookupTarget(TEX0, m_width, m_height, GSTextureCache::RenderTarget, true);
rt = m_tc->LookupTarget(TEX0, m_width, m_height, GSTextureCache::RenderTarget, true, fm);
rt_tex = rt->m_texture;
}

View File

@ -403,7 +403,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const GIFRegTEX0& TEX0, con
return src;
}
GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int w, int h, int type, bool used)
GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int w, int h, int type, bool used, uint32 fbmask)
{
const GSLocalMemory::psm_t& psm_s = GSLocalMemory::m_psm[TEX0.PSM];
uint32 bp = TEX0.TBP0;
@ -432,7 +432,7 @@ GSTextureCache::Target* GSTextureCache::LookupTarget(const GIFRegTEX0& TEX0, int
dst->Update();
dst->m_dirty_alpha |= (psm_s.trbpp != 24);
dst->m_dirty_alpha |= (psm_s.trbpp == 32 && (fbmask & 0xFF000000) != 0xFF000000) || (psm_s.trbpp == 16);
} else if (CanConvertDepth()) {

View File

@ -154,7 +154,7 @@ public:
Source* LookupSource(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, const GSVector4i& r);
Source* LookupDepthSource(const GIFRegTEX0& TEX0, const GIFRegTEXA& TEXA, const GSVector4i& r, bool palette = false);
Target* LookupTarget(const GIFRegTEX0& TEX0, int w, int h, int type, bool used);
Target* LookupTarget(const GIFRegTEX0& TEX0, int w, int h, int type, bool used, uint32 fbmask = 0);
Target* LookupTarget(const GIFRegTEX0& TEX0, int w, int h, int real_h);
void InvalidateVideoMemType(int type, uint32 bp);