[Mesa-dev] [PATCH 7/7] mesa: Make _mesa_is_stencil_format() consistent with _mesa_is_depth_format().

Eric Anholt eric at anholt.net
Sun Nov 27 14:52:32 PST 2011


On Wed, 23 Nov 2011 13:53:33 -0700, Brian Paul <brianp at vmware.com> wrote:
> On 11/23/2011 01:37 PM, Eric Anholt wrote:
> > There was only one consumer of this API, meta.c, which was intending
> > to ask "is this format just stencil index (and nothing else)?".
> > Instead, if one tried to glDrawPixels of GL_DEPTH_STENCIL-type
> > formats, it would just try to draw the stencil parts.  Nothing good
> > came of this.
> >
> > This function looks rather silly at this point, but I'm leaving it in
> > place to be the obvious parallel API to _mesa_is_depth_format().  Note
> > that if you want the old behavior, you should use it as
> > (_mesa_is_stencil_format() || _mesa_is_depthstencil_format()) like is
> > commonly done for depth-related tests.
> > ---
> >   src/mesa/main/image.c |    1 -
> >   1 files changed, 0 insertions(+), 1 deletions(-)
> >
> > diff --git a/src/mesa/main/image.c b/src/mesa/main/image.c
> > index 914a999..d91b4ca 100644
> > --- a/src/mesa/main/image.c
> > +++ b/src/mesa/main/image.c
> > @@ -848,7 +848,6 @@ _mesa_is_stencil_format(GLenum format)
> >   {
> >      switch (format) {
> >         case GL_STENCIL_INDEX:
> > -      case GL_DEPTH_STENCIL:
> >            return GL_TRUE;
> >         default:
> >            return GL_FALSE;
> 
> I'd guess/hope this compiles down to:
> 
>     return format == GL_STENCIL_INDEX;
> 
> Either way, Reviewed-by: Brian Paul <brianp at vmware.com>

Confirmed.  For once, gcc does what we would hope!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20111127/82c3a21d/attachment.pgp>


More information about the mesa-dev mailing list