diff options
author | Brian <[email protected]> | 2007-11-07 14:41:01 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2007-11-07 14:41:01 -0700 |
commit | fc6172bc9abfc24836c6701f3bfcd791907ca9a7 (patch) | |
tree | 4ed14f649ffe17c9374b84f4ca01a8349a1b1bb0 /src/mesa/pipe/xlib | |
parent | 187b631b6b3c504fa334e33f4b1af433b6232bac (diff) |
better depth buffer selection
Diffstat (limited to 'src/mesa/pipe/xlib')
-rw-r--r-- | src/mesa/pipe/xlib/xm_api.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/mesa/pipe/xlib/xm_api.c b/src/mesa/pipe/xlib/xm_api.c index ec889ca34fa..e456ea2fd4d 100644 --- a/src/mesa/pipe/xlib/xm_api.c +++ b/src/mesa/pipe/xlib/xm_api.c @@ -380,11 +380,21 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, _mesa_add_renderbuffer(fb, BUFFER_STENCIL, rb); } else { - if (vis->mesa_visual.depthBits > 0) { + if (vis->mesa_visual.depthBits > 24) { struct gl_renderbuffer *rb = st_new_renderbuffer_fb(GL_DEPTH_COMPONENT32); _mesa_add_renderbuffer(fb, BUFFER_DEPTH, rb); } + else if (vis->mesa_visual.depthBits > 16) { + struct gl_renderbuffer *rb + = st_new_renderbuffer_fb(GL_DEPTH24_STENCIL8_EXT); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, rb); + } + else if (vis->mesa_visual.depthBits > 1) { + struct gl_renderbuffer *rb + = st_new_renderbuffer_fb(GL_DEPTH_COMPONENT16); + _mesa_add_renderbuffer(fb, BUFFER_DEPTH, rb); + } if (vis->mesa_visual.stencilBits > 0) { struct gl_renderbuffer *rb |