summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/framebuffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/framebuffer.c')
-rw-r--r--src/mesa/main/framebuffer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c
index 66c9bd91096..6e2ce74212e 100644
--- a/src/mesa/main/framebuffer.c
+++ b/src/mesa/main/framebuffer.c
@@ -631,8 +631,14 @@ _mesa_update_depth_buffer(struct gl_context *ctx,
|| fb->_DepthBuffer->Wrapped != depthRb
|| _mesa_get_format_base_format(fb->_DepthBuffer->Format) != GL_DEPTH_COMPONENT) {
/* need to update wrapper */
- struct gl_renderbuffer *wrapper
- = _mesa_new_z24_renderbuffer_wrapper(ctx, depthRb);
+ struct gl_renderbuffer *wrapper;
+
+ if (depthRb->Format == MESA_FORMAT_Z32_FLOAT_X24S8) {
+ wrapper = _mesa_new_z32f_renderbuffer_wrapper(ctx, depthRb);
+ }
+ else {
+ wrapper = _mesa_new_z24_renderbuffer_wrapper(ctx, depthRb);
+ }
_mesa_reference_renderbuffer(&fb->_DepthBuffer, wrapper);
ASSERT(fb->_DepthBuffer->Wrapped == depthRb);
}