From 3c3158f580f23ad629e591e17820e4c6237e1d8d Mon Sep 17 00:00:00 2001 From: James Legg Date: Fri, 23 May 2014 12:25:37 +0100 Subject: [PATCH] mesa: Fix unbinding stencil attachment with glFramebufferRenderbuffer and GL_DEPTH_STENCIL_ATTACHMENT --- 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 8090a63..b4424b1 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) { + /* do stencil attachment here (depth already done above) */ + att = get_attachment(ctx, fb, GL_STENCIL_ATTACHMENT_EXT); + assert(att); + remove_attachment(ctx, att); + } } invalidate_framebuffer(fb); -- 1.9.1