From 60be0cde4017f70424bf5fea0dd10fe3fa7a9475 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sat, 3 Oct 2026 13:15:42 -0600 Subject: [PATCH] SoftGPU: Don't count a block ending at the stride as reaching the next row PendingWriteIn took a block that ends exactly at the stride for one running into the next row. Ridge Racer keeps its CLUTs in the framebuffer's stride gap (the last 64 bytes of 1024-byte rows, past the 960 drawn), so every CLUT load flushed all queued drawing. Ridge Racer 8% faster. Co-Authored-By: Claude Opus 5.5 (1M context) --- GPU/Software/BinManager.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GPU/Software/BinManager.cpp b/GPU/Software/BinManager.cpp index b6c76ece3f..7e2675aab0 100644 --- a/GPU/Software/BinManager.cpp +++ b/GPU/Software/BinManager.cpp @@ -932,8 +932,8 @@ bool BinManager::PendingWriteIn(const BinDirtyRange &range, uint32_t start, uint int32_t rangeY = offset / (int32_t)range.strideBytes; uint32_t rangeX = offset % (int32_t)range.strideBytes; if (rangeY >= 0 && (uint32_t)rangeY < range.height) { - // If this row is either within width, or extends beyond stride, overlap. - if (rangeX < range.widthBytes || rangeX + w >= range.strideBytes) + // If this row is either within width, or extends beyond stride (into the next row), overlap. + if (rangeX < range.widthBytes || rangeX + w > range.strideBytes) return true; }