GS/HW: Avoid corrections on new targets.

This commit is contained in:
lightningterror 2024-02-27 02:26:22 +01:00
parent 500e86c43c
commit 6a5ac4fe54
3 changed files with 17 additions and 3 deletions

View File

@ -3122,6 +3122,9 @@ void GSRendererHW::Draw()
}
}
if (rt)
rt->m_last_draw = s_n;
#ifdef DISABLE_HW_TEXTURE_CACHE
if (rt)
g_texture_cache->Read(rt, m_r);
@ -5308,8 +5311,13 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
if (rta_decorrection)
{
rt->RTADecorrect(rt);
m_conf.rt = rt->m_texture;
if (rt->m_last_draw == s_n)
rt->m_rt_alpha_scale = false;
else
{
rt->RTADecorrect(rt);
m_conf.rt = rt->m_texture;
}
}
m_conf.ps.rta_correction = rt->m_rt_alpha_scale;

View File

@ -1690,7 +1690,7 @@ GSTextureCache::Source* GSTextureCache::LookupSource(const bool is_color, const
}
#endif
if (dst && dst->m_rt_alpha_scale)
if (dst && dst->m_rt_alpha_scale && (GSUtil::GetChannelMask(TEX0.PSM) & 0x8))
dst->RTADecorrect(dst);
src = CreateSource(TEX0, TEXA, dst, half_right, x_offset, y_offset, lod, &r, gpu_clut, region);
@ -2350,6 +2350,11 @@ GSTextureCache::Target* GSTextureCache::CreateTarget(GIFRegTEX0 TEX0, const GSVe
dst->readbacks_since_draw = 0;
dst->m_last_draw = GSState::s_n;
if (dst->m_dirty.empty())
dst->m_rt_alpha_scale = true;
pxAssert(dst && dst->m_texture && dst->m_scale == scale);
return dst;
}

View File

@ -217,6 +217,7 @@ public:
bool m_valid_alpha_high = false;
bool m_valid_rgb = false;
bool m_rt_alpha_scale = false;
int m_last_draw = 0;
bool m_is_frame = false;
bool m_used = false;