From 06b02183cbabb071f8c6ac653370888d790fffc0 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Sun, 9 Feb 2025 13:06:32 +1000 Subject: [PATCH] GPU/HW: Split transparent draws if dual-source blend unsupported The ordering is not correct otherwise. Ape Escape has a bunch of overlapping sprites that have a mix of opaque and transparent texels, and the transparent texels are repeated multiple times when the opaque texels should cancel them out. Only affects old Mali drivers. --- src/core/gpu_hw.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index a34d4b792..1c1cf48bd 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -3695,9 +3695,8 @@ void GPU_HW::PrepareDraw(const GPUBackendDrawCommand* cmd) if (!IsFlushed()) { if (texture_mode != m_batch.texture_mode || transparency_mode != m_batch.transparency_mode || - (transparency_mode == GPUTransparencyMode::BackgroundMinusForeground && !m_allow_shader_blend) || - dithering_enable != m_batch.dithering || m_texture_window_bits != cmd->window || - m_batch.check_mask_before_draw != cmd->check_mask_before_draw || + (!m_allow_shader_blend && NeedsTwoPassRendering()) || dithering_enable != m_batch.dithering || + m_texture_window_bits != cmd->window || m_batch.check_mask_before_draw != cmd->check_mask_before_draw || m_batch.set_mask_while_drawing != cmd->set_mask_while_drawing || (texture_mode == BatchTextureMode::PageTexture && m_texture_cache_key != texture_cache_key)) {