summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2007-11-08 14:49:37 -0800
committerEric Anholt <eric@anholt.net>2007-11-09 14:27:33 -0800
commit38c616260a4c14bf5a1d7831e6349c3e8817d14b (patch)
treee1dcb754955e07ecd01674197fe8cb0afbdd2bbe
parent77a5bcaff43df8d54e0e0ef833726e4b41d7eb36 (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.c43
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 25f5efa7bc..a34250952a 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 */