summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/common/depthtmp.h
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2004-11-01 20:27:43 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2004-11-01 20:27:43 +0000
commitcc78e40172589a2154f9f74c5ff4461b93db14fd (patch)
tree4558b53b8c64ff78e47b078411367086261202fd /src/mesa/drivers/dri/common/depthtmp.h
parent3d2b4bfa95c6a1d8c481f0ee2a18585c4d0627da (diff)
Nicolai's sw-clipspan-fixes.patch
Diffstat (limited to 'src/mesa/drivers/dri/common/depthtmp.h')
-rw-r--r--src/mesa/drivers/dri/common/depthtmp.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/common/depthtmp.h b/src/mesa/drivers/dri/common/depthtmp.h
index d8b8775ae9..ec79aca30f 100644
--- a/src/mesa/drivers/dri/common/depthtmp.h
+++ b/src/mesa/drivers/dri/common/depthtmp.h
@@ -45,15 +45,15 @@ static void TAG(WriteDepthSpan)( GLcontext *ctx,
GLint i = 0;
CLIPSPAN( x, y, n, x1, n1, i );
- if ( DBG ) fprintf( stderr, "WriteDepthSpan %d..%d (x1 %d)\n",
- (int)i, (int)n1, (int)x1 );
+ if ( DBG ) fprintf( stderr, "WriteDepthSpan %d..%d (x1 %d) (mask %p)\n",
+ (int)i, (int)n1, (int)x1, mask );
if ( mask ) {
- for ( ; i < n1 ; i++, x1++ ) {
+ for ( ; n1>0 ; i++, x1++, n1-- ) {
if ( mask[i] ) WRITE_DEPTH( x1, y, depth[i] );
}
} else {
- for ( ; i < n1 ; i++, x1++ ) {
+ for ( ; n1>0 ; i++, x1++, n1-- ) {
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 );
if ( mask ) {
- for ( ; i < n1 ; i++, x1++ ) {
+ for ( ; n1>0 ; i++, x1++, n1-- ) {
if ( mask[i] ) WRITE_DEPTH( x1, y, depth );
}
} else {
- for ( ; i < n1 ; i++, x1++ ) {
+ for ( ; n1>0 ; x1++, n1-- ) {
WRITE_DEPTH( x1, y, depth );
}
}
@@ -162,8 +162,9 @@ static void TAG(ReadDepthSpan)( GLcontext *ctx,
{
GLint i = 0;
CLIPSPAN( x, y, n, x1, n1, i );
- for ( ; i < n1 ; i++ )
- READ_DEPTH( depth[i], (x1+i), y );
+ for ( ; n1>0 ; i++, n1-- ) {
+ READ_DEPTH( depth[i], x+i, y );
+ }
}
HW_ENDCLIPLOOP();
#endif