summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2007-11-06 17:38:47 +0000
committerJosé Fonseca <[email protected]>2007-11-06 20:10:18 +0000
commit26eb608a352ec017b534579e1c81c2d1fedf3d1b (patch)
treeb11513fbdb49c56083137fa2aaa94de0a4c6cd24
parent7b358e8ea9d894470097824b3dda3d60ef232abe (diff)
Handle the corner case of 24bit depth buffer with 0bit stencil buffer.
-rw-r--r--src/mesa/state_tracker/st_framebuffer.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_framebuffer.c b/src/mesa/state_tracker/st_framebuffer.c
index b43b9b7b9b1..4833d10322e 100644
--- a/src/mesa/state_tracker/st_framebuffer.c
+++ b/src/mesa/state_tracker/st_framebuffer.c
@@ -43,6 +43,7 @@ struct st_framebuffer *st_create_framebuffer( const __GLcontextModes *visual,
= CALLOC_STRUCT(st_framebuffer);
if (stfb) {
GLboolean swStencil = (visual->stencilBits > 0 &&
+ visual->stencilBits != 8 &&
visual->depthBits != 24);
GLenum rgbFormat = (visual->redBits == 5 ? GL_RGB5 : GL_RGBA8);
@@ -62,13 +63,14 @@ struct st_framebuffer *st_create_framebuffer( const __GLcontextModes *visual,
_mesa_add_renderbuffer(&stfb->Base, BUFFER_BACK_LEFT, rb);
}
- if (visual->depthBits == 24 && visual->stencilBits == 8) {
+ if (visual->depthBits == 24) {
/* combined depth/stencil buffer */
struct gl_renderbuffer *depthStencilRb
= st_new_renderbuffer_fb(GL_DEPTH24_STENCIL8_EXT);
/* note: bind RB to two attachment points */
_mesa_add_renderbuffer(&stfb->Base, BUFFER_DEPTH, depthStencilRb);
- _mesa_add_renderbuffer(&stfb->Base, BUFFER_STENCIL,depthStencilRb);
+ if(visual->stencilBits == 8)
+ _mesa_add_renderbuffer(&stfb->Base, BUFFER_STENCIL,depthStencilRb);
}
else if (visual->depthBits == 16) {
/* just 16-bit depth buffer, no hw stencil */
@@ -76,7 +78,8 @@ struct st_framebuffer *st_create_framebuffer( const __GLcontextModes *visual,
= st_new_renderbuffer_fb(GL_DEPTH_COMPONENT16);
_mesa_add_renderbuffer(&stfb->Base, BUFFER_DEPTH, depthRb);
}
-
+ else
+ assert(0);
/* now add any/all software-based renderbuffers we may need */
_mesa_add_soft_renderbuffers(&stfb->Base,