mesa: Fix glFramebufferTexture*() for depth and stencil attachments
authorChad Versace <chad.versace@linux.intel.com>
Thu, 10 Nov 2011 18:19:20 +0000 (10:19 -0800)
committerChad Versace <chad.versace@linux.intel.com>
Fri, 11 Nov 2011 20:28:22 +0000 (12:28 -0800)
commitbf8ad170c5af58fe9f49b3ce0f92c4eda9e5d845
treefa302a4714b846fd817c3a2e8d35885b3cb3aa4d
parent8727807f7e218bd161d92e34f6896f4451d14de0
mesa: Fix glFramebufferTexture*() for depth and stencil attachments

This patch solves three bugs.

1. When a texture was attached to the GL_DEPTH_STENCIL_ATTACHMENT point,
Mesa attached the texture only to the depth attachment point
    gl_framebuffer::Attachment[BUFFER_DEPTH]
and failed to attach it to the stencil attachment point
    gl_framebuffer::Attachment[BUFFER_STENCIL]

2. When a texture was attached to the GL_DEPTH_ATTACHMENT point and then
later attached to the GL_STENCIL_ATTACHMENT point, Mesa created two
separate renderbuffer wrappers. This caused a GL error in
glGetFramebufferAttachmentParameteriv().

3. Same as 2, but with depth and stencil juxtaposed.

Fixes Piglit test ARB_framebuffer_object/same-attachment-glFramebufferTexture2D-GL_DEPTH_STENCIL

Note: This is a candidate for the stable branches.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
src/mesa/main/fbobject.c