summaryrefslogtreecommitdiff
path: root/src/mesa/main/renderbuffer.c
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2005-10-04 14:48:24 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2005-10-04 14:48:24 +0000
commiteb063cfa386ccf64e01be2fc6e6a44f702d19da5 (patch)
treead5950efa70a1a8fdce0a4409666fb4ff7a94069 /src/mesa/main/renderbuffer.c
parent199ef86b5e6354098bc800ffb56a6cab3e9a99a1 (diff)
change initialization of renderbuffer DepthBits
Diffstat (limited to 'src/mesa/main/renderbuffer.c')
-rw-r--r--src/mesa/main/renderbuffer.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c
index cc1b4fe376..7abfc7034a 100644
--- a/src/mesa/main/renderbuffer.c
+++ b/src/mesa/main/renderbuffer.c
@@ -1045,7 +1045,7 @@ soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutMonoRow = put_mono_row_ushort;
rb->PutValues = put_values_ushort;
rb->PutMonoValues = put_mono_values_ushort;
- /*rb->DepthBits not set here */
+ rb->DepthBits = 8 * sizeof(GLushort);
pixelSize = sizeof(GLushort);
break;
case GL_DEPTH_COMPONENT24:
@@ -1060,7 +1060,10 @@ soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb,
rb->PutMonoRow = put_mono_row_uint;
rb->PutValues = put_values_uint;
rb->PutMonoValues = put_mono_values_uint;
- /* rb->DepthBits not set here */
+ if (internalFormat == GL_DEPTH_COMPONENT24)
+ rb->DepthBits = 24;
+ else
+ rb->DepthBits = 32;
pixelSize = sizeof(GLuint);
break;
case GL_COLOR_INDEX8_EXT:
@@ -1711,10 +1714,12 @@ _mesa_add_depth_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb,
if (depthBits <= 16) {
rb->InternalFormat = GL_DEPTH_COMPONENT16;
}
+ else if (depthBits <= 24) {
+ rb->InternalFormat = GL_DEPTH_COMPONENT24;
+ }
else {
rb->InternalFormat = GL_DEPTH_COMPONENT32;
}
- rb->DepthBits = depthBits;
rb->AllocStorage = soft_renderbuffer_storage;
_mesa_add_renderbuffer(fb, BUFFER_DEPTH, rb);