GS-hw: Adjust DATE selection.

Remove fbmask check from DATE,
Enable DATE_BARRIER with one barrier when alpha isn't written and there is no alpha test.
This commit is contained in:
lightningterror 2022-02-26 17:48:27 +01:00
parent cd5ce6e162
commit 753da789a0
1 changed files with 10 additions and 9 deletions

View File

@ -1304,14 +1304,12 @@ void GSRendererNew::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
// DATE: selection of the algorithm. Must be done before blending because GL42 is not compatible with blending // DATE: selection of the algorithm. Must be done before blending because GL42 is not compatible with blending
if (DATE) if (DATE)
{ {
// It is way too complex to emulate texture shuffle with DATE. So just use // It is way too complex to emulate texture shuffle with DATE, so use accurate path.
// the slow but accurate algo
// No overlap should be triggered on gl/vk only as they support DATE_BARRIER. // No overlap should be triggered on gl/vk only as they support DATE_BARRIER.
const bool fbmask = (m_context->FRAME.FBMSK & 0x80000000);
const bool no_overlap = (g_gs_device->Features().texture_barrier) && (m_prim_overlap == PRIM_OVERLAP_NO); const bool no_overlap = (g_gs_device->Features().texture_barrier) && (m_prim_overlap == PRIM_OVERLAP_NO);
if (fbmask || no_overlap || m_texture_shuffle) if (no_overlap || m_texture_shuffle)
{ {
GL_PERF("DATE: Accurate with %s", m_texture_shuffle ? "texture shuffle" : no_overlap ? "no overlap" : "FBMASK"); GL_PERF("DATE: Accurate with %s", no_overlap ? "no overlap" : "texture shuffle");
if (g_gs_device->Features().texture_barrier) if (g_gs_device->Features().texture_barrier)
{ {
m_conf.require_full_barrier = true; m_conf.require_full_barrier = true;
@ -1320,8 +1318,8 @@ void GSRendererNew::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
} }
else if (m_context->FBA.FBA) else if (m_context->FBA.FBA)
{ {
DATE_one = !m_context->TEST.DATM;
GL_PERF("DATE: Fast with FBA, all pixels will be >= 128"); GL_PERF("DATE: Fast with FBA, all pixels will be >= 128");
DATE_one = !m_context->TEST.DATM;
} }
else if (m_conf.colormask.wa && !m_context->TEST.ATE) else if (m_conf.colormask.wa && !m_context->TEST.ATE)
{ {
@ -1372,9 +1370,12 @@ void GSRendererNew::DrawPrims(GSTexture* rt, GSTexture* ds, GSTextureCache::Sour
} }
else if (!m_conf.colormask.wa && !m_context->TEST.ATE) else if (!m_conf.colormask.wa && !m_context->TEST.ATE)
{ {
// TODO: is it legal ? Likely but it need to be tested carefully GL_PERF("DATE: Accurate with no alpha write");
// DATE_BARRIER = true; if (g_gs_device->Features().texture_barrier)
// m_conf.require_one_barrier = true; << replace it with a cheap barrier {
m_conf.require_one_barrier = true;
DATE_BARRIER = true;
}
} }
// Will save my life ! // Will save my life !