[Mesa-dev] [PATCH 3/6] mesa/formats: add MESA_LAYOUT_LATC

Anuj Phogat anuj.phogat at gmail.com
Fri Sep 18 10:22:31 PDT 2015


On Fri, Aug 28, 2015 at 7:50 AM, Nanley Chery <nanleychery at gmail.com> wrote:

> From: Nanley Chery <nanley.g.chery at intel.com>
>
> This enables us to predicate statments on a compressed format being
> a type of LATC format. Also, remove the comment that lists the enum
> (which was getting a tad long).
>
> Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> ---
>  src/mesa/main/format_info.py |  2 +-
>  src/mesa/main/formats.c      | 11 -----------
>  src/mesa/main/formats.csv    |  8 ++++----
>  src/mesa/main/formats.h      |  1 +
>  src/mesa/main/texcompress.c  |  1 +
>  5 files changed, 7 insertions(+), 16 deletions(-)
>
> diff --git a/src/mesa/main/format_info.py b/src/mesa/main/format_info.py
> index 22eb5a7..50626a85 100644
> --- a/src/mesa/main/format_info.py
> +++ b/src/mesa/main/format_info.py
> @@ -111,7 +111,7 @@ def get_channel_bits(fmat, chan_name):
>              return 1 if fmat.has_channel('a') else 0
>           else:
>              return 0
> -      elif fmat.layout == 'rgtc':
> +      elif fmat.layout in ('rgtc', 'latc'):
>           return 8 if fmat.has_channel(chan_name) else 0
>        elif fmat.layout in ('etc1', 'etc2'):
>           if fmat.name.endswith('_ALPHA1') and chan_name == 'a':
> diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
> index 587221c..a2a7da6 100644
> --- a/src/mesa/main/formats.c
> +++ b/src/mesa/main/formats.c
> @@ -188,17 +188,6 @@ _mesa_get_format_max_bits(mesa_format format)
>
>  /**
>   * Return the layout type of the given format.
> - * The return value will be one of:
> - *    MESA_FORMAT_LAYOUT_ARRAY
> - *    MESA_FORMAT_LAYOUT_PACKED
> - *    MESA_FORMAT_LAYOUT_S3TC
> - *    MESA_FORMAT_LAYOUT_RGTC
> - *    MESA_FORMAT_LAYOUT_FXT1
> - *    MESA_FORMAT_LAYOUT_ETC1
> - *    MESA_FORMAT_LAYOUT_ETC2
> - *    MESA_FORMAT_LAYOUT_BPTC
> - *    MESA_FORMAT_LAYOUT_ASTC
> - *    MESA_FORMAT_LAYOUT_OTHER
>   */
>  extern enum mesa_format_layout
>  _mesa_get_format_layout(mesa_format format)
> diff --git a/src/mesa/main/formats.csv b/src/mesa/main/formats.csv
> index 80729d9..341b1be 100644
> --- a/src/mesa/main/formats.csv
> +++ b/src/mesa/main/formats.csv
> @@ -278,10 +278,10 @@ MESA_FORMAT_RG_RGTC2_UNORM                , rgtc  ,
> 4, 4, x128,     ,     ,
>  MESA_FORMAT_RG_RGTC2_SNORM                , rgtc  , 4, 4, x128,     ,
>  ,     , xy01, rgb
>
>  # LATC1/2 compressed formats
> -MESA_FORMAT_L_LATC1_UNORM                 , rgtc  , 4, 4, x64 ,     ,
>  ,     , xxx1, rgb
> -MESA_FORMAT_L_LATC1_SNORM                 , rgtc  , 4, 4, x64 ,     ,
>  ,     , xxx1, rgb
> -MESA_FORMAT_LA_LATC2_UNORM                , rgtc  , 4, 4, x128,     ,
>  ,     , xxxy, rgb
> -MESA_FORMAT_LA_LATC2_SNORM                , rgtc  , 4, 4, x128,     ,
>  ,     , xxxy, rgb
> +MESA_FORMAT_L_LATC1_UNORM                 , latc  , 4, 4, x64 ,     ,
>  ,     , xxx1, rgb
> +MESA_FORMAT_L_LATC1_SNORM                 , latc  , 4, 4, x64 ,     ,
>  ,     , xxx1, rgb
> +MESA_FORMAT_LA_LATC2_UNORM                , latc  , 4, 4, x128,     ,
>  ,     , xxxy, rgb
> +MESA_FORMAT_LA_LATC2_SNORM                , latc  , 4, 4, x128,     ,
>  ,     , xxxy, rgb
>
>  # ETC1/2 compressed formats
>  MESA_FORMAT_ETC1_RGB8                     , etc1  , 4, 4, x64 ,     ,
>  ,     , xyz1, rgb
> diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h
> index ccb09b2..5d4d9a6 100644
> --- a/src/mesa/main/formats.h
> +++ b/src/mesa/main/formats.h
> @@ -66,6 +66,7 @@ enum mesa_format_layout {
>     MESA_FORMAT_LAYOUT_PACKED,
>     MESA_FORMAT_LAYOUT_S3TC,
>     MESA_FORMAT_LAYOUT_RGTC,
> +   MESA_FORMAT_LAYOUT_LATC,
>     MESA_FORMAT_LAYOUT_FXT1,
>     MESA_FORMAT_LAYOUT_ETC1,
>     MESA_FORMAT_LAYOUT_ETC2,
> diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
> index 394c8ba..e0294a8 100644
> --- a/src/mesa/main/texcompress.c
> +++ b/src/mesa/main/texcompress.c
> @@ -728,6 +728,7 @@ _mesa_get_compressed_fetch_func(mesa_format format)
>     case MESA_FORMAT_LAYOUT_FXT1:
>        return _mesa_get_fxt_fetch_func(format);
>     case MESA_FORMAT_LAYOUT_RGTC:
> +   case MESA_FORMAT_LAYOUT_LATC:
>        return _mesa_get_compressed_rgtc_func(format);
>     case MESA_FORMAT_LAYOUT_ETC1:
>        return _mesa_get_etc_fetch_func(format);
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



Looks good to me.

Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150918/ebc31a5c/attachment.html>


More information about the mesa-dev mailing list