From a6769818fd3253315ccd8522c284713e424d66b7 Mon Sep 17 00:00:00 2001 From: lightningterror <18107717+lightningterror@users.noreply.github.com> Date: Wed, 17 Jun 2026 23:54:37 +0200 Subject: [PATCH] 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. --- pcsx2/GS/Renderers/HW/GSRendererHW.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp index d4fe5f97e0..627c2bc946 100644 --- a/pcsx2/GS/Renderers/HW/GSRendererHW.cpp +++ b/pcsx2/GS/Renderers/HW/GSRendererHW.cpp @@ -5900,10 +5900,12 @@ void GSRendererHW::EmulateDATESelectMethod(DATEOptions& date_options, GSTextureC const GSDevice::FeatureSupport& features = g_gs_device->Features(); + // Date one can run with complex alpha test if there's no overlap. const bool complex_alpha_test = m_cached_ctx.TEST.ATE && m_cached_ctx.TEST.ATST != ATST_ALWAYS && m_cached_ctx.TEST.ATST != ATST_NEVER && - m_cached_ctx.TEST.AFAIL != AFAIL_KEEP; + m_cached_ctx.TEST.AFAIL != AFAIL_KEEP && + m_prim_overlap != PRIM_OVERLAP_NO; if (m_cached_ctx.TEST.DATM) { blend_alpha_min = std::max(blend_alpha_min, 128); @@ -5946,9 +5948,15 @@ void GSRendererHW::EmulateDATESelectMethod(DATEOptions& date_options, GSTextureC m_conf.require_full_barrier = true; date_options.barrier = true; } + else if (m_conf.colormask.wa && complex_alpha_test && features.feedback_loops()) + { + GL_PERF("DATE: Accurate with complex alpha test."); + m_conf.require_full_barrier = true; + date_options.barrier = true; + } // When Blending is disabled and Edge Anti Aliasing is enabled, // the output alpha is Coverage (which we force to 128) so DATE will fail/pass guaranteed on second pass. - else if (m_conf.colormask.wa && (m_context->FBA.FBA || IsCoverageAlphaFixedOne()) && features.stencil_buffer) + else if (m_conf.colormask.wa && !complex_alpha_test && (m_context->FBA.FBA || IsCoverageAlphaFixedOne()) && features.stencil_buffer) { GL_PERF("DATE: Fast with FBA, all pixels will be >= 128"); date_options.stencil_one = !m_cached_ctx.TEST.DATM;