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

Brian Paul brianp at vmware.com
Thu Aug 26 07:17:01 PDT 2010


On 08/25/2010 07:14 AM, Nick Bowler wrote:
> 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;
>
>         ASSERT(att->Renderbuffer);
>         if (!att->Renderbuffer->InternalFormat ||


This looks good.  I'm not sure if there's a piglit test that would 
exercise this.  Did you run the piglit fbo tests just to be sure 
there's no regressions?

-Brian



More information about the mesa-dev mailing list