[Mesa-dev] [PATCH 2/3] mesa: Use the _BaseFormat field to determine attachment completeness.

Nick Bowler nbowler at draconx.ca
Wed Aug 25 06:14:41 PDT 2010

Intel sometimes uses packed depth/stencil buffers even when only a
depth buffer or only a stencil buffer was requested.  GL specifies
that GL_DEPTH_COMPONENT renderbuffers are *not* stencil-attachable,
but the current check happily attaches these buffers to the stencil
attachment point (or vice-versa for GL_STENCIL_INDEX renderbuffers
and the depth attachment).  Performing such an attachment must yield
an incomplete framebuffer.

Since the renderbuffer struct has the actual base format stored in it,
use that value instead of recomputing it incorrectly.

Signed-off-by: Nick Bowler <nbowler at draconx.ca>
 src/mesa/main/fbobject.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index 9a84e5a..80bc518 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -485,8 +485,7 @@ test_attachment_completeness(const GLcontext *ctx, GLenum format,
    else if (att->Type == GL_RENDERBUFFER_EXT) {
-      const GLenum baseFormat =
-         _mesa_get_format_base_format(att->Renderbuffer->Format);
+      const GLenum baseFormat = att->Renderbuffer->_BaseFormat;
       if (!att->Renderbuffer->InternalFormat ||

More information about the mesa-dev mailing list