diff --git a/GPU/Software/DrawPixel.cpp b/GPU/Software/DrawPixel.cpp index f345059f70..54eb519bdc 100644 --- a/GPU/Software/DrawPixel.cpp +++ b/GPU/Software/DrawPixel.cpp @@ -460,7 +460,7 @@ void SOFTRAST_CALL DrawSinglePixel(int x, int y, int z, int fog, Vec4IntArg colo const Vec4 dst = Vec4::FromRGBA(old_color); Vec3 blended = AlphaBlendingResult(pixelID, prim_color, dst); if (pixelID.dithering) { - blended += Vec3::AssignToAll(pixelID.cached.ditherMatrix[y * 4 + x]); + blended += Vec3::AssignToAll(pixelID.cached.ditherMatrix[(y & 3) * 4 + (x & 3)]); } // ToRGB() always automatically clamps. @@ -469,7 +469,7 @@ void SOFTRAST_CALL DrawSinglePixel(int x, int y, int z, int fog, Vec4IntArg colo } else { if (pixelID.dithering) { // We'll discard alpha anyway. - prim_color += Vec4::AssignToAll(pixelID.cached.ditherMatrix[y * 4 + x]); + prim_color += Vec4::AssignToAll(pixelID.cached.ditherMatrix[(y & 3) * 4 + (x & 3)]); } #if defined(_M_SSE)