[Mesa-dev] [PATCH] util/u_format: take normalized flag in consideration in util_format_is_rgba8_variant

Jose Fonseca jfonseca at vmware.com
Mon Nov 4 11:10:02 PST 2013



----- Original Message -----
> Am 04.11.2013 18:21, schrieb jfonseca at vmware.com:
> > From: José Fonseca <jfonseca at vmware.com>
> > 
> > Just happened to notice it was missing while looking at it.
> > ---
> >  src/gallium/auxiliary/util/u_format.h | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/src/gallium/auxiliary/util/u_format.h
> > b/src/gallium/auxiliary/util/u_format.h
> > index dc777c3..31283e5 100644
> > --- a/src/gallium/auxiliary/util/u_format.h
> > +++ b/src/gallium/auxiliary/util/u_format.h
> > @@ -696,6 +696,8 @@ util_format_is_rgba8_variant(const struct
> > util_format_description *desc)
> >        if(desc->channel[chan].type != UTIL_FORMAT_TYPE_UNSIGNED &&
> >           desc->channel[chan].type != UTIL_FORMAT_TYPE_VOID)
> >           return FALSE;
> > +      if(!desc->channel[chan].normalized)
> > +         return FALSE;
> >        if(desc->channel[chan].size != 8)
> >           return FALSE;
> >     }
> > 
> 
> This looks like a good idea but it won't work correctly because with
> xrgb formats the 4th channel with void type doesn't have the normalized
> bit set.
> 

Good catch. It should be

  if(desc->channel[chan].type === UTIL_FORMAT_TYPE_UNSIGNED &&
     !desc->channel[chan].normalized)
     return FALSE;

then.

Jose
 


More information about the mesa-dev mailing list