Skip to content

Commit a676981

Browse files
GS/HW: DATE setup changes.
DATE one can run on complex alpha test if there's no overlap. Make sure DATE one doesn't run if complex alpha test is enabled and there's overlap. Enable DATE barrier on complex alpha test if there's overlap.
1 parent 9553521 commit a676981

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

pcsx2/GS/Renderers/HW/GSRendererHW.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5900,10 +5900,12 @@ void GSRendererHW::EmulateDATESelectMethod(DATEOptions& date_options, GSTextureC
59005900

59015901
const GSDevice::FeatureSupport& features = g_gs_device->Features();
59025902

5903+
// Date one can run with complex alpha test if there's no overlap.
59035904
const bool complex_alpha_test = m_cached_ctx.TEST.ATE &&
59045905
m_cached_ctx.TEST.ATST != ATST_ALWAYS &&
59055906
m_cached_ctx.TEST.ATST != ATST_NEVER &&
5906-
m_cached_ctx.TEST.AFAIL != AFAIL_KEEP;
5907+
m_cached_ctx.TEST.AFAIL != AFAIL_KEEP &&
5908+
m_prim_overlap != PRIM_OVERLAP_NO;
59075909
if (m_cached_ctx.TEST.DATM)
59085910
{
59095911
blend_alpha_min = std::max(blend_alpha_min, 128);
@@ -5946,9 +5948,15 @@ void GSRendererHW::EmulateDATESelectMethod(DATEOptions& date_options, GSTextureC
59465948
m_conf.require_full_barrier = true;
59475949
date_options.barrier = true;
59485950
}
5951+
else if (m_conf.colormask.wa && complex_alpha_test && features.feedback_loops())
5952+
{
5953+
GL_PERF("DATE: Accurate with complex alpha test.");
5954+
m_conf.require_full_barrier = true;
5955+
date_options.barrier = true;
5956+
}
59495957
// When Blending is disabled and Edge Anti Aliasing is enabled,
59505958
// the output alpha is Coverage (which we force to 128) so DATE will fail/pass guaranteed on second pass.
5951-
else if (m_conf.colormask.wa && (m_context->FBA.FBA || IsCoverageAlphaFixedOne()) && features.stencil_buffer)
5959+
else if (m_conf.colormask.wa && !complex_alpha_test && (m_context->FBA.FBA || IsCoverageAlphaFixedOne()) && features.stencil_buffer)
59525960
{
59535961
GL_PERF("DATE: Fast with FBA, all pixels will be >= 128");
59545962
date_options.stencil_one = !m_cached_ctx.TEST.DATM;

0 commit comments

Comments
 (0)