From d8716b5d905208d5742c491d033040077e9ea8f5 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 13 Nov 2022 10:22:09 -0800 Subject: [PATCH] softgpu: Fix off-by-one rendering after half-pixel. If the X is after a half-pixel offset, the first pixel we draw is the next one. This wasn't being accounted for properly in one place. --- GPU/Software/Rasterizer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU/Software/Rasterizer.cpp b/GPU/Software/Rasterizer.cpp index e6d4a5a84f..d86a4447ef 100644 --- a/GPU/Software/Rasterizer.cpp +++ b/GPU/Software/Rasterizer.cpp @@ -893,7 +893,7 @@ void DrawRectangle(const VertexData &v0, const VertexData &v1, const BinCoords & #endif for (int64_t curY = minY; curY <= maxY; curY += SCREEN_SCALE_FACTOR * 2, rowST += sty) { - DrawingCoords p = TransformUnit::ScreenToDrawing(range.x1, curY); + DrawingCoords p = TransformUnit::ScreenToDrawing(minX, curY); int scissorY2 = curY + SCREEN_SCALE_FACTOR > maxY ? -1 : 0; Vec4 scissor_mask = Vec4(0, maxX - minX - SCREEN_SCALE_FACTOR, scissorY2, (maxX - minX - SCREEN_SCALE_FACTOR) | scissorY2);