DS GX: Fix degenerate spans
Vicki Pfau vi@endrift.com
Tue, 28 Feb 2017 19:28:05 -0800
1 files changed,
6 insertions(+),
2 deletions(-)
jump to
M
src/ds/gx/software.c
→
src/ds/gx/software.c
@@ -264,11 +264,12 @@ }
unsigned poly = edge->polyId; struct DSGXSoftwareSpan* span = softwareRenderer->bucket[poly]; - if (span) { + if (span && !span->ep[1].w) { _edgeToSpan(span, edge, 1, y); softwareRenderer->bucket[poly] = NULL; - } else { + } else if (!span) { span = DSGXSoftwareSpanListAppend(&softwareRenderer->activeSpans); + memset(span, 0, sizeof(*span)); if (!_edgeToSpan(span, edge, 0, y)) { // Horizontal line DSGXSoftwareSpanListShift(&softwareRenderer->activeSpans, DSGXSoftwareSpanListSize(&softwareRenderer->activeSpans) - 1, 1);@@ -302,6 +303,9 @@ break;
} span = DSGXSoftwareSpanListGetPointer(&softwareRenderer->activeSpans, nextSpanId - 1); nextSpanX = span->ep[0].x >> 12; + } + if (i < nextSpanX) { + span = NULL; } } if (span) {