Bug 79115 - glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0) doesn't unbind stencil buffer
Summary: glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, G...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: 10.1
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-23 11:32 UTC by James Legg
Modified: 2014-05-23 14:10 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
Test case (1.91 KB, text/plain)
2014-05-23 11:32 UTC, James Legg
Details
Patch (981 bytes, text/plain)
2014-05-23 11:35 UTC, James Legg
Details

Description James Legg 2014-05-23 11:32:44 UTC
Created attachment 99627 [details]
Test case

glFramebufferRenderbuffer(GL_DRAW_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, 0) should unbind both the depth and the stencil attachment. However, when using mesa 10.1 with Intel Haswell graphics, the stencil buffer is not unbound.

_mesa_framebuffer_renderbuffer has a special path to bind a stencil buffer when using GL_DEPTH_STENCIL_ATTACHMENT for a non-null renderbuffer, but for a null renderbuffer, it only calls remove_attachment with the depth attachment returned by get_attachment. It also needs to handle the stencil buffer when GL_DEPTH_STENCIL_ATTACHMENT is used for null renderbuffers.

I have attached a test case to demonstrate the problem. An assertion fails on line 61 when the bug occurs.
Comment 1 James Legg 2014-05-23 11:35:15 UTC
Created attachment 99628 [details]
Patch

This patch made against the mesa-10.1.4 tag fixes the bug for me.
Comment 2 Brian Paul 2014-05-23 14:06:34 UTC
The patch looks good, but I think I'll improve the comments.
I'll commit/push this and tag it for the stable branches too.
Thanks, James.
Comment 3 Brian Paul 2014-05-23 14:10:53 UTC
commit 846c715abb17e13a5d39c565d0995404b6178d98.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.