From 635ae5de31f355c0bc5248c2592d29af4190e39b Mon Sep 17 00:00:00 2001 From: Stenzek Date: Fri, 31 Jan 2025 19:44:05 +1000 Subject: [PATCH] GPU/HW: Don't use sprites-as-fills for small/offscreen points --- src/core/gpu_hw.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/gpu_hw.cpp b/src/core/gpu_hw.cpp index 6dd9f1be5..513fb5cf0 100644 --- a/src/core/gpu_hw.cpp +++ b/src/core/gpu_hw.cpp @@ -2664,7 +2664,9 @@ 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) + if (m_use_texture_cache && !cmd->transparency_enable && !cmd->shading_enable && !cmd->texture_enable && cmd->x >= 0 && + cmd->y >= 0 && cmd->width >= TEXTURE_PAGE_WIDTH && cmd->height >= TEXTURE_PAGE_HEIGHT && + (cmd->x + cmd->width) <= VRAM_WIDTH && (cmd->y + cmd->height) <= VRAM_HEIGHT) { FillVRAM(cmd->x, cmd->y, cmd->width, cmd->height, cmd->color, cmd->interlaced_rendering, cmd->active_line_lsb); return;