mesa: Fix unbinding GL_DEPTH_STENCIL_ATTACHMENT
authorJames Legg <jlegg@feralinteractive.com>
Fri, 23 May 2014 11:25:37 +0000 (12:25 +0100)
committerBrian Paul <brianp@vmware.com>
Fri, 23 May 2014 14:06:02 +0000 (08:06 -0600)
glFramebufferRender(..., GL_DEPTH_STENCIL_ATTACHMENT, ..., 0) only
detached the depth buffer and not the stencil buffer.

Bugzilla: http://bugs.freedesktop.org/show_bug.cgi?id=79115
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.1 10.2" <mesa-stable@lists.freedesktop.org>
src/mesa/main/fbobject.c

index 97538bc7b293106ba38561a01b21d85fe2045029..ae3a418cd1c44f0f8dbccca99d9626558ecf2ef8 100644 (file)
@@ -500,6 +500,12 @@ _mesa_framebuffer_renderbuffer(struct gl_context *ctx,
    }
    else {
       remove_attachment(ctx, att);
+      if (attachment == GL_DEPTH_STENCIL_ATTACHMENT) {
+         /* detach stencil (depth was detached above) */
+         att = get_attachment(ctx, fb, GL_STENCIL_ATTACHMENT_EXT);
+         assert(att);
+         remove_attachment(ctx, att);
+      }
    }
 
    invalidate_framebuffer(fb);