From c55b355fd460453a459e073ac4119c69e06e7531 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 21 Oct 2009 19:58:00 -0600 Subject: [PATCH] mesa: use MESA_FORMAT_X8_Z24 --- src/mesa/main/renderbuffer.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c index 409fd8634ae..0e216563852 100644 --- a/src/mesa/main/renderbuffer.c +++ b/src/mesa/main/renderbuffer.c @@ -1052,6 +1052,18 @@ _mesa_soft_renderbuffer_storage(GLcontext *ctx, struct gl_renderbuffer *rb, pixelSize = sizeof(GLushort); break; case GL_DEPTH_COMPONENT24: + rb->DataType = GL_UNSIGNED_INT; + rb->GetPointer = get_pointer_uint; + rb->GetRow = get_row_uint; + rb->GetValues = get_values_uint; + rb->PutRow = put_row_uint; + rb->PutRowRGB = NULL; + rb->PutMonoRow = put_mono_row_uint; + rb->PutValues = put_values_uint; + rb->PutMonoValues = put_mono_values_uint; + rb->Format = MESA_FORMAT_X8_Z24; + pixelSize = sizeof(GLuint); + break; case GL_DEPTH_COMPONENT32: rb->DataType = GL_UNSIGNED_INT; rb->GetPointer = get_pointer_uint; @@ -1735,6 +1747,10 @@ _mesa_add_depth_renderbuffer(GLcontext *ctx, struct gl_framebuffer *fb, rb->Format = MESA_FORMAT_Z16; rb->InternalFormat = GL_DEPTH_COMPONENT16; } + else if (depthBits <= 24) { + rb->Format = MESA_FORMAT_X8_Z24; + rb->InternalFormat = GL_DEPTH_COMPONENT24; + } else { rb->Format = MESA_FORMAT_Z32; rb->InternalFormat = GL_DEPTH_COMPONENT32; -- 2.30.2