diff options
author | Eric Anholt <[email protected]> | 2007-11-08 14:49:37 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2007-11-09 14:27:33 -0800 |
commit | 38c616260a4c14bf5a1d7831e6349c3e8817d14b (patch) | |
tree | e1dcb754955e07ecd01674197fe8cb0afbdd2bbe | |
parent | 77a5bcaff43df8d54e0e0ef833726e4b41d7eb36 (diff) |
[intel] Initialize a depth buffer if the visual has depth 24 but no stencil.
-rw-r--r-- | src/mesa/drivers/dri/intel/intel_screen.c | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c index 25f5efa7bcf..a34250952ac 100644 --- a/src/mesa/drivers/dri/intel/intel_screen.c +++ b/src/mesa/drivers/dri/intel/intel_screen.c @@ -655,21 +655,34 @@ intelCreateBuffer(__DRIscreenPrivate * driScrnPriv, } } - if (mesaVis->depthBits == 24 && mesaVis->stencilBits == 8) { - /* combined depth/stencil buffer */ - struct intel_renderbuffer *depthStencilRb - = intel_create_renderbuffer(GL_DEPTH24_STENCIL8_EXT, - screen->width, screen->height, - screen->depth.offset, - screen->depth.pitch, - screen->cpp, /* 4! */ - screen->depth.map); - intel_set_span_functions(&depthStencilRb->Base); - /* note: bind RB to two attachment points */ - _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_DEPTH, - &depthStencilRb->Base); - _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_STENCIL, - &depthStencilRb->Base); + if (mesaVis->depthBits == 24) { + if (mesaVis->stencilBits == 8) { + /* combined depth/stencil buffer */ + struct intel_renderbuffer *depthStencilRb + = intel_create_renderbuffer(GL_DEPTH24_STENCIL8_EXT, + screen->width, screen->height, + screen->depth.offset, + screen->depth.pitch, + screen->cpp, /* 4! */ + screen->depth.map); + intel_set_span_functions(&depthStencilRb->Base); + /* note: bind RB to two attachment points */ + _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_DEPTH, + &depthStencilRb->Base); + _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_STENCIL, + &depthStencilRb->Base); + } else { + struct intel_renderbuffer *depthRb + = intel_create_renderbuffer(GL_DEPTH_COMPONENT24, + screen->width, screen->height, + screen->depth.offset, + screen->depth.pitch, + screen->cpp, /* 4! */ + screen->depth.map); + intel_set_span_functions(&depthRb->Base); + _mesa_add_renderbuffer(&intel_fb->Base, BUFFER_DEPTH, + &depthRb->Base); + } } else if (mesaVis->depthBits == 16) { /* just 16-bit depth buffer, no hw stencil */ |