diff options
author | Brian Paul <[email protected]> | 2004-09-24 14:30:13 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2004-09-24 14:30:13 +0000 |
commit | 328a039413fd2b8649511f1ca130df2a59f2c71c (patch) | |
tree | f0739e2a41ee9ced641f6b2c3a9137d708e0899e /src/mesa/drivers/dri/common/spantmp.h | |
parent | d9873c59ef4d14b5e3137cb2d7c765797f82ac56 (diff) |
patches for clearing hw depth buffers from software fallback (Nicolai Haehnle)
Diffstat (limited to 'src/mesa/drivers/dri/common/spantmp.h')
-rw-r--r-- | src/mesa/drivers/dri/common/spantmp.h | 62 |
1 files changed, 53 insertions, 9 deletions
diff --git a/src/mesa/drivers/dri/common/spantmp.h b/src/mesa/drivers/dri/common/spantmp.h index 888be0465e5..39d0221bbee 100644 --- a/src/mesa/drivers/dri/common/spantmp.h +++ b/src/mesa/drivers/dri/common/spantmp.h @@ -123,15 +123,29 @@ static void TAG(WriteRGBAPixels)( const GLcontext *ctx, HW_WRITE_CLIPLOOP() { - for (i=0;i<n;i++) + if (mask) + { + for (i=0;i<n;i++) + { + if (mask[i]) { + const int fy = Y_FLIP(y[i]); + if (CLIPPIXEL(x[i],fy)) + WRITE_RGBA( x[i], fy, + rgba[i][0], rgba[i][1], + rgba[i][2], rgba[i][3] ); + } + } + } + else { - if (mask[i]) { + for (i=0;i<n;i++) + { const int fy = Y_FLIP(y[i]); if (CLIPPIXEL(x[i],fy)) WRITE_RGBA( x[i], fy, rgba[i][0], rgba[i][1], rgba[i][2], rgba[i][3] ); - } + } } } HW_ENDCLIPLOOP(); @@ -160,9 +174,17 @@ static void TAG(WriteMonoRGBASpan)( const GLcontext *ctx, { GLint i = 0; CLIPSPAN(x,y,n,x1,n1,i); - for (;n1>0;i++,x1++,n1--) - if (mask[i]) + if (mask) + { + for (;n1>0;i++,x1++,n1--) + if (mask[i]) + WRITE_PIXEL( x1, y, p ); + } + else + { + for (;n1>0;i++,x1++,n1--) WRITE_PIXEL( x1, y, p ); + } } HW_ENDCLIPLOOP(); } @@ -186,12 +208,23 @@ static void TAG(WriteMonoRGBAPixels)( const GLcontext *ctx, HW_WRITE_CLIPLOOP() { - for (i=0;i<n;i++) - if (mask[i]) { + if (mask) + { + for (i=0;i<n;i++) + if (mask[i]) { + int fy = Y_FLIP(y[i]); + if (CLIPPIXEL( x[i], fy )) + WRITE_PIXEL( x[i], fy, p ); + } + } + else + { + for (i=0;i<n;i++) { int fy = Y_FLIP(y[i]); if (CLIPPIXEL( x[i], fy )) WRITE_PIXEL( x[i], fy, p ); } + } } HW_ENDCLIPLOOP(); } @@ -238,12 +271,23 @@ static void TAG(ReadRGBAPixels)( const GLcontext *ctx, HW_READ_CLIPLOOP() { - for (i=0;i<n;i++) - if (mask[i]) { + if (mask) + { + for (i=0;i<n;i++) + if (mask[i]) { + int fy = Y_FLIP( y[i] ); + if (CLIPPIXEL( x[i], fy )) + READ_RGBA( rgba[i], x[i], fy ); + } + } + else + { + for (i=0;i<n;i++) { int fy = Y_FLIP( y[i] ); if (CLIPPIXEL( x[i], fy )) READ_RGBA( rgba[i], x[i], fy ); } + } } HW_ENDCLIPLOOP(); } |