On Tue, Aug 11, 2015 at 7:07 PM, Nanley Chery <nanleych...@gmail.com> wrote:
> From: Nanley Chery <nanley.g.ch...@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.ekstr...@intel.com>
> Signed-off-by: Nanley Chery <nanley.g.ch...@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() ?
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to