Nicolai's sw-clipspan-fixes.patch

This commit is contained in:
Keith Whitwell
2004-11-01 20:27:43 +00:00
parent 3d2b4bfa95
commit cc78e40172
2 changed files with 13 additions and 12 deletions

View File

@@ -45,15 +45,15 @@ static void TAG(WriteDepthSpan)( GLcontext *ctx,
GLint i = 0; GLint i = 0;
CLIPSPAN( x, y, n, x1, n1, i ); CLIPSPAN( x, y, n, x1, n1, i );
if ( DBG ) fprintf( stderr, "WriteDepthSpan %d..%d (x1 %d)\n", if ( DBG ) fprintf( stderr, "WriteDepthSpan %d..%d (x1 %d) (mask %p)\n",
(int)i, (int)n1, (int)x1 ); (int)i, (int)n1, (int)x1, mask );
if ( mask ) { if ( mask ) {
for ( ; i < n1 ; i++, x1++ ) { for ( ; n1>0 ; i++, x1++, n1-- ) {
if ( mask[i] ) WRITE_DEPTH( x1, y, depth[i] ); if ( mask[i] ) WRITE_DEPTH( x1, y, depth[i] );
} }
} else { } else {
for ( ; i < n1 ; i++, x1++ ) { for ( ; n1>0 ; i++, x1++, n1-- ) {
WRITE_DEPTH( x1, y, depth[i] ); WRITE_DEPTH( x1, y, depth[i] );
} }
} }
@@ -87,11 +87,11 @@ static void TAG(WriteMonoDepthSpan)( GLcontext *ctx,
__FUNCTION__, (int)i, (int)n1, (int)x1, (GLuint)depth ); __FUNCTION__, (int)i, (int)n1, (int)x1, (GLuint)depth );
if ( mask ) { if ( mask ) {
for ( ; i < n1 ; i++, x1++ ) { for ( ; n1>0 ; i++, x1++, n1-- ) {
if ( mask[i] ) WRITE_DEPTH( x1, y, depth ); if ( mask[i] ) WRITE_DEPTH( x1, y, depth );
} }
} else { } else {
for ( ; i < n1 ; i++, x1++ ) { for ( ; n1>0 ; x1++, n1-- ) {
WRITE_DEPTH( x1, y, depth ); WRITE_DEPTH( x1, y, depth );
} }
} }
@@ -162,8 +162,9 @@ static void TAG(ReadDepthSpan)( GLcontext *ctx,
{ {
GLint i = 0; GLint i = 0;
CLIPSPAN( x, y, n, x1, n1, i ); CLIPSPAN( x, y, n, x1, n1, i );
for ( ; i < n1 ; i++ ) for ( ; n1>0 ; i++, n1-- ) {
READ_DEPTH( depth[i], (x1+i), y ); READ_DEPTH( depth[i], x+i, y );
}
} }
HW_ENDCLIPLOOP(); HW_ENDCLIPLOOP();
#endif #endif

View File

@@ -41,13 +41,13 @@ static void TAG(WriteStencilSpan)( GLcontext *ctx,
if (mask) if (mask)
{ {
for (;i<n1;i++,x1++) for (;n1>0;i++,x1++,n1--)
if (mask[i]) if (mask[i])
WRITE_STENCIL( x1, y, stencil[i] ); WRITE_STENCIL( x1, y, stencil[i] );
} }
else else
{ {
for (;i<n1;i++,x1++) for (;n1>0;i++,x1++,n1--)
WRITE_STENCIL( x1, y, stencil[i] ); WRITE_STENCIL( x1, y, stencil[i] );
} }
} }
@@ -107,8 +107,8 @@ static void TAG(ReadStencilSpan)( GLcontext *ctx,
{ {
GLint i = 0; GLint i = 0;
CLIPSPAN(x,y,n,x1,n1,i); CLIPSPAN(x,y,n,x1,n1,i);
for (;i<n1;i++) for (;n1>0;i++,n1--)
READ_STENCIL( stencil[i], (x1+i), y ); READ_STENCIL( stencil[i], (x+i), y );
} }
HW_ENDCLIPLOOP(); HW_ENDCLIPLOOP();
} }