diff options
author | Brian <[email protected]> | 2007-10-20 15:19:14 -0600 |
---|---|---|
committer | Brian <[email protected]> | 2007-10-20 15:19:14 -0600 |
commit | 46e2d2bb0a7423122412e3f119fdd89fedd9aef6 (patch) | |
tree | c57ffbf9138681a74d24b5d98977a9d27d322030 /src/mesa/drivers | |
parent | 7e8396399824108d62dc3e02b2af0422e98aab8e (diff) |
use combined depth/stencil buffer when possible
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/x11/xm_api.c | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/src/mesa/drivers/x11/xm_api.c b/src/mesa/drivers/x11/xm_api.c index ff83dab0752..187663e66ca 100644 --- a/src/mesa/drivers/x11/xm_api.c +++ b/src/mesa/drivers/x11/xm_api.c @@ -430,16 +430,26 @@ create_xmesa_buffer(XMesaDrawable d, BufferType type, b->swAlpha = GL_FALSE; } - if (vis->mesa_visual.depthBits > 0) { + if (vis->mesa_visual.depthBits > 0 && + vis->mesa_visual.stencilBits > 0) { + /* combined depth/stencil */ struct gl_renderbuffer *rb - = st_new_renderbuffer_fb(GL_DEPTH_COMPONENT32); + = st_new_renderbuffer_fb(GL_DEPTH24_STENCIL8_EXT); _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_DEPTH, rb); + _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_STENCIL, rb); } + else { + if (vis->mesa_visual.depthBits > 0) { + struct gl_renderbuffer *rb + = st_new_renderbuffer_fb(GL_DEPTH_COMPONENT32); + _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_DEPTH, rb); + } - if (vis->mesa_visual.stencilBits > 0) { - struct gl_renderbuffer *rb - = st_new_renderbuffer_fb(GL_STENCIL_INDEX8_EXT); - _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_STENCIL, rb); + if (vis->mesa_visual.stencilBits > 0) { + struct gl_renderbuffer *rb + = st_new_renderbuffer_fb(GL_STENCIL_INDEX8_EXT); + _mesa_add_renderbuffer(&b->mesa_buffer, BUFFER_STENCIL, rb); + } } if (vis->mesa_visual.accumRedBits > 0) { |