additional comments about GL_DEPTH_STENCIL buffers
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 16 Nov 2005 04:17:20 +0000 (04:17 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 16 Nov 2005 04:17:20 +0000 (04:17 +0000)
src/mesa/main/framebuffer.c

index 4fef9066c837465a6bd312a005b80b375f24a6bd..17241cfcef5fe0dacf89c347a25f9fa7900ac9be 100644 (file)
@@ -444,9 +444,12 @@ set_stencil_renderbuffer(struct gl_framebuffer *fb,
  *    _ColorDrawBuffers
  *    _NumColorDrawBuffers
  *    _ColorReadBuffer
+ *    _DepthBuffer
+ *    _StencilBuffer
  * If the current framebuffer is user-created, make sure it's complete.
  * The following functions can effect this state:  glReadBuffer,
- * glDrawBuffer, glDrawBuffersARB, glFramebufferRenderbufferEXT.
+ * glDrawBuffer, glDrawBuffersARB, glFramebufferRenderbufferEXT,
+ * glRenderbufferStorageEXT.
  */
 void
 _mesa_update_framebuffer(GLcontext *ctx)
@@ -504,7 +507,9 @@ _mesa_update_framebuffer(GLcontext *ctx)
 
    /*
     * Deal with GL_DEPTH_STENCIL renderbuffer(s) attached to the depth
-    * and/or stencil attachment points.
+    * and/or stencil attachment points.  If either of the DEPTH or STENCIL
+    * renderbuffer attachments are GL_DEPTH_STENCIL buffers, we need to set
+    * up depth/stencil renderbuffer wrappers.
     */
    {
       struct gl_renderbuffer *depthRb
@@ -513,6 +518,7 @@ _mesa_update_framebuffer(GLcontext *ctx)
          = fb->Attachment[BUFFER_STENCIL].Renderbuffer;
 
       if (depthRb && depthRb->_BaseFormat == GL_DEPTH_STENCIL_EXT) {
+         /* The attached depth buffer is a GL_DEPTH_STENCIL renderbuffer */
          if (!fb->_DepthBuffer || fb->_DepthBuffer->Wrapped != depthRb) {
             /* need to update wrapper */
             struct gl_renderbuffer *wrapper
@@ -527,6 +533,7 @@ _mesa_update_framebuffer(GLcontext *ctx)
       }
 
       if (stencilRb && stencilRb->_BaseFormat == GL_DEPTH_STENCIL_EXT) {
+         /* The attached stencil buffer is a GL_DEPTH_STENCIL renderbuffer */
          if (!fb->_StencilBuffer || fb->_StencilBuffer->Wrapped != stencilRb) {
             /* need to update wrapper */
             struct gl_renderbuffer *wrapper