GS/HW: Also check if blend will update the rt.

If it doesn't and there is no depth buffer we can abort the draw(s) safely.
This commit is contained in:
lightningterror 2025-11-14 02:59:21 +01:00
parent 53d1320d83
commit 3234e45f33

View File

@ -7662,6 +7662,21 @@ __ri void GSRendererHW::DrawPrims(GSTextureCache::Target* rt, GSTextureCache::Ta
if ((!IsOpaque() || m_context->ALPHA.IsBlack()) && rt && ((m_conf.colormask.wrgba & 0x7) || (m_texture_shuffle && !m_copy_16bit_to_target_shuffle && !m_same_group_texture_shuffle)))
{
EmulateBlending(blend_alpha_min, blend_alpha_max, DATE, DATE_PRIMID, DATE_BARRIER, rt, can_scale_rt_alpha, new_scale_rt_alpha);
// Similar to IsRTWritten(), check if the rt will change.
const bool no_rt = (!DATE && !m_conf.colormask.wrgba && !m_channel_shuffle);
const bool no_ds = !m_conf.ds ||
// Depth will be written through the RT.
(!no_rt && m_cached_ctx.FRAME.FBP == m_cached_ctx.ZBUF.ZBP && !PRIM->TME && m_cached_ctx.ZBUF.ZMSK == 0 &&
(m_cached_ctx.FRAME.FBMSK & GSLocalMemory::m_psm[m_cached_ctx.FRAME.PSM].fmsk) == 0 && m_cached_ctx.TEST.ZTE) ||
// No color or Z being written.
(no_rt && m_cached_ctx.ZBUF.ZMSK != 0);
if (no_rt && no_ds)
{
GL_INS("HW: Late draw cancel EmulateBlending().");
return;
}
}
else
{