diff options
author | Brian Paul <[email protected]> | 2005-10-04 14:49:30 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2005-10-04 14:49:30 +0000 |
commit | 14c38b8f4f1f3ffaf955fb4de4cb36a5f10d2bb2 (patch) | |
tree | 6f5ae0ec4161ebbe2faa165fe381a00c93ba6439 /src/mesa/swrast/s_drawpix.c | |
parent | eb063cfa386ccf64e01be2fc6e6a44f702d19da5 (diff) |
Use Visual.depthBits rather than Renderbuffer::DepthBits for depth buffer
operations.
Diffstat (limited to 'src/mesa/swrast/s_drawpix.c')
-rw-r--r-- | src/mesa/swrast/s_drawpix.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c index 7c799101d12..ce398b2b7f7 100644 --- a/src/mesa/swrast/s_drawpix.c +++ b/src/mesa/swrast/s_drawpix.c @@ -561,8 +561,6 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, const struct gl_pixelstore_attrib *unpack, const GLvoid *pixels ) { - struct gl_renderbuffer *rb - = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer; const GLboolean scaleOrBias = ctx->Pixel.DepthScale != 1.0 || ctx->Pixel.DepthBias != 0.0; const GLboolean zoom = ctx->Pixel.ZoomX != 1.0 || ctx->Pixel.ZoomY != 1.0; @@ -578,7 +576,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, _swrast_span_default_texcoords(ctx, &span); if (type == GL_UNSIGNED_SHORT - && rb->DepthBits == 16 + && ctx->DrawBuffer->Visual.depthBits == 16 && !scaleOrBias && !zoom && ctx->Visual.rgbMode @@ -604,7 +602,7 @@ draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, && ctx->Visual.rgbMode && width <= MAX_WIDTH) { /* Special case: shift 32-bit values down to Visual.depthBits */ - const GLint shift = 32 - rb->DepthBits; + const GLint shift = 32 - ctx->DrawBuffer->Visual.depthBits; GLint row; for (row = 0; row < height; row++) { const GLuint *zSrc = (const GLuint *) @@ -867,7 +865,7 @@ draw_depth_stencil_pixels(GLcontext *ctx, GLint x, GLint y, GL_DEPTH_STENCIL_EXT, type, i, 0); if (ctx->Depth.Mask) { - if (!scaleOrBias && depthRb->DepthBits == 24) { + if (!scaleOrBias && ctx->DrawBuffer->Visual.depthBits == 24) { /* fast path 24-bit zbuffer */ GLuint zValues[MAX_WIDTH]; GLint j; @@ -881,7 +879,7 @@ draw_depth_stencil_pixels(GLcontext *ctx, GLint x, GLint y, else depthRb->PutRow(ctx, depthRb, width, x, y + i, zValues, NULL); } - else if (!scaleOrBias && depthRb->DepthBits == 16) { + else if (!scaleOrBias && ctx->DrawBuffer->Visual.depthBits == 16) { /* fast path 16-bit zbuffer */ GLushort zValues[MAX_WIDTH]; GLint j; |