gallium: change the conditional which tests for combined Z+stencil buffers
authorBrian Paul <brian.paul@tungstengraphics.com>
Thu, 28 Aug 2008 20:18:20 +0000 (14:18 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Thu, 28 Aug 2008 20:18:46 +0000 (14:18 -0600)
The caller might be requesting 16-bit Z + 8-bit stencil be placed in a
PIPE_FORMAT_S8Z24 or PIPE_FORMAT_Z24S8 buffer.

src/mesa/state_tracker/st_framebuffer.c

index 4012cf73e57b0b61a0e2779e8c6553084abbc938..0f4a03fa4846bd349bcfcec67fbc83c243938197 100644 (file)
@@ -74,7 +74,7 @@ st_create_framebuffer( const __GLcontextModes *visual,
          _mesa_add_renderbuffer(&stfb->Base, BUFFER_BACK_LEFT, rb);
       }
 
-      if (visual->depthBits == 24 && visual->stencilBits == 8) {
+      if (depthFormat == stencilFormat && depthFormat != PIPE_FORMAT_NONE) {
          /* combined depth/stencil buffer */
          struct gl_renderbuffer *depthStencilRb
             = st_new_renderbuffer_fb(depthFormat, samples);