Mesa (master): mesa: Fix unbinding GL_DEPTH_STENCIL_ATTACHMENT

Brian Paul brianp at kemper.freedesktop.org
Fri May 23 14:10:38 UTC 2014


Module: Mesa
Branch: master
Commit: 846c715abb17e13a5d39c565d0995404b6178d98
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=846c715abb17e13a5d39c565d0995404b6178d98

Author: James Legg <jlegg at feralinteractive.com>
Date:   Fri May 23 12:25:37 2014 +0100

mesa: Fix unbinding GL_DEPTH_STENCIL_ATTACHMENT

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 at vmware.com>
Cc: "10.1 10.2" <mesa-stable at lists.freedesktop.org>

---

 src/mesa/main/fbobject.c |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 97538bc..ae3a418 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -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);




More information about the mesa-commit mailing list