From 7188ab863aa30c7afb57a7147bc118f0cdbaf8ac Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 28 Jan 2025 17:34:53 +1000 Subject: [PATCH] GPU/HW: Treat fill-like sprites as fills if TC is enabled Umihara Kawase Shun clears the framebuffer with a single large sprite, which causes the texture cache to think the pages have been drawn. --- src/core/gpu_hw.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index 5208df1d9..6dd9f1be5 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -2663,6 +2663,13 @@ void GPU_HW::DrawLine(const GSVector4 bounds, u32 col0, u32 col1, float depth) void GPU_HW::DrawSprite(const GPUBackendDrawRectangleCommand* cmd) { + // Treat non-textured sprite draws as fills, so we don't break the TC on framebuffer clears. + if (m_use_texture_cache && !cmd->transparency_enable && !cmd->shading_enable && !cmd->texture_enable) + { + FillVRAM(cmd->x, cmd->y, cmd->width, cmd->height, cmd->color, cmd->interlaced_rendering, cmd->active_line_lsb); + return; + } + const GSVector2i pos = GSVector2i::load(&cmd->x); const GSVector2i size = GSVector2i::load(&cmd->width).u16to32(); const GSVector4i rect = GSVector4i::xyxy(pos, pos.add32(size));