GS/SW: Fix bbox computation in SW draw().

The bbox was missing right/bottom pixels if they were exactly on a pixel center (exact integer). Removed the extra check for 0 width/height bbox for lines/points since they are no longer needed (the bbox will always be at least 1 pixel now). Appears to only affect the SW rasterizer when the bbox right/bottom end point is a multiple of 16 (SW rasterizer allocates scanlines to threads in blocks of 16).
This commit is contained in:
TJnotJT
2025-08-20 23:55:49 +02:00
committed by lightningterror
parent 3c70d7f575
commit 6159cd4114
+1 -9
View File
@@ -345,15 +345,7 @@ void GSRendererSW::Draw()
std::memcpy(sd->index, m_index.buff, sizeof(u16) * m_index.tail);
GSVector4i scissor = context->scissor.in;
GSVector4i bbox = GSVector4i(m_vt.m_min.p.floor().upld(m_vt.m_max.p.ceil()));
// points and lines may have zero area bbox (single line: 0, 0 - 256, 0)
if (m_vt.m_primclass == GS_POINT_CLASS || m_vt.m_primclass == GS_LINE_CLASS)
{
if (bbox.x == bbox.z) bbox.z++;
if (bbox.y == bbox.w) bbox.w++;
}
GSVector4i bbox = GSVector4i(m_vt.m_min.p.floor().upld(m_vt.m_max.p.floor())) + GSVector4i(0, 0, 1, 1); // right/bottom should be exclusive so +1
GSVector4i r = bbox.rintersect(scissor);