summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2006-03-29 04:01:05 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2006-03-29 04:01:05 +0000
commit2526152a107e4323161b95188e767620c4998639 (patch)
tree3aae962b1613564695d14644970144e00b252b3a
parent519a2e7cb7b8f026bd5fe711cdf12a20df1c46ae (diff)
fix a GLuint vs GLushort test, new assertions
-rw-r--r--src/mesa/swrast/s_depth.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index 8a2d08b58e..061eb9c595 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -519,12 +519,13 @@ depth_test_span( GLcontext *ctx, struct sw_span *span)
if (rb->GetPointer(ctx, rb, 0, 0)) {
/* Directly access buffer */
- if (ctx->DrawBuffer->Visual.depthBits <= 16) {
+ if (rb->DataType == GL_UNSIGNED_SHORT) {
GLushort *zbuffer = (GLushort *) rb->GetPointer(ctx, rb, x, y);
passed = depth_test_span16(ctx, count, zbuffer, zValues, mask);
}
else {
GLuint *zbuffer = (GLuint *) rb->GetPointer(ctx, rb, x, y);
+ ASSERT(rb->DataType == GL_UNSIGNED_INT);
passed = depth_test_span32(ctx, count, zbuffer, zValues, mask);
}
}
@@ -1070,6 +1071,7 @@ depth_test_pixels( GLcontext *ctx, struct sw_span *span )
else {
GLuint *zStart = (GLuint *) rb->Data;
GLuint stride = rb->Width;
+ ASSERT(rb->DataType == GL_UNSIGNED_INT);
direct_depth_test_pixels32(ctx, zStart, stride, count, x, y, z, mask);
}
}
@@ -1157,6 +1159,7 @@ _swrast_depth_bounds_test( GLcontext *ctx, struct sw_span *span )
else {
/* get 32-bit values */
GLuint zbuffer32[MAX_WIDTH], *zbuffer;
+ ASSERT(rb->DataType == GL_UNSIGNED_INT);
if (span->arrayMask & SPAN_XY) {
_swrast_get_values(ctx, rb, count, span->array->x, span->array->y,
zbuffer32, sizeof(GLuint));