[Mesa-dev] [PATCH 3/4] mesa/formats: add more MESA_FORMAT_LAYOUTs

Nanley Chery nanleychery at gmail.com
Tue Aug 11 16:39:43 PDT 2015


On Tue, Aug 11, 2015 at 4:16 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:

> On Tue, Aug 11, 2015 at 7:07 PM, Nanley Chery <nanleychery at gmail.com>
> wrote:
> > From: Nanley Chery <nanley.g.chery at intel.com>
> >
> > Add the classes of compressed formats as layouts. This will make
> determining if
> > a texture is an ASTC format simpler.
> >
> > Cc: Jason Ekstrand <jason.ekstrand at intel.com>
> > Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> > ---
> >  src/mesa/main/format_info.py |  4 +++-
> >  src/mesa/main/formats.c      |  6 ++++++
> >  src/mesa/main/formats.h      |  6 ++++++
> >  src/mesa/main/texcompress.c  | 30 ++++++------------------------
> >  4 files changed, 21 insertions(+), 25 deletions(-)
> >
> > diff --git a/src/mesa/main/format_info.py b/src/mesa/main/format_info.py
> > index 3bae57e..b9f12f3 100644
> > --- a/src/mesa/main/format_info.py
> > +++ b/src/mesa/main/format_info.py
> > @@ -103,8 +103,10 @@ def get_mesa_layout(fmat):
> >        return 'MESA_FORMAT_LAYOUT_ARRAY'
> >     elif fmat.layout == 'packed':
> >        return 'MESA_FORMAT_LAYOUT_PACKED'
> > -   else:
> > +   elif fmat.layout == 'other':
> >        return 'MESA_FORMAT_LAYOUT_OTHER'
> > +   else:
> > +      return 'MESA_FORMAT_LAYOUT_' + fmat.layout.upper()
>
> This should cover basically every format layout, right? i.e. why not
> just make this function be
>
> return 'MESA_FORMAT_LAYOUT_' + fmat.layout.upper() ?
>

Good idea.

Thanks,
Nanley
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150811/2ddbe900/attachment.html>


More information about the mesa-dev mailing list