[Mesa-dev] [PATCH 1/2] mesa/texcompress: add function to determine compressed format type

Anuj Phogat anuj.phogat at gmail.com
Fri Sep 11 13:38:26 PDT 2015


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

> From: Nanley Chery <nanley.g.chery at intel.com>
>
> Determines if a compressed format is non-palettized and specific.
>
> Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> ---
>  src/mesa/main/texcompress.c | 10 ++++++++++
>  src/mesa/main/texcompress.h |  3 +++
>  2 files changed, 13 insertions(+)
>
> diff --git a/src/mesa/main/texcompress.c b/src/mesa/main/texcompress.c
> index 84973d3..c8598bd 100644
> --- a/src/mesa/main/texcompress.c
> +++ b/src/mesa/main/texcompress.c
> @@ -547,6 +547,16 @@ _mesa_glenum_to_compressed_format(GLenum format)
>     }
>  }
>
> +/**
> + * Return whether or not the format is a specific, non-palettized
> compressed
> + * format. This works because all MESA_FORMATs for compressed GL formats
> + * correspond to non-generic compressed formats.
> + */
> +bool
> +_mesa_is_specific_np_compressed_format(GLenum format)
> +{
> +   return _mesa_glenum_to_compressed_format(format) != MESA_FORMAT_NONE;
> +}
>
>  /**
>   * Given a compressed MESA_FORMAT_x value, return the corresponding
> diff --git a/src/mesa/main/texcompress.h b/src/mesa/main/texcompress.h
> index b00924d..b088dd2 100644
> --- a/src/mesa/main/texcompress.h
> +++ b/src/mesa/main/texcompress.h
> @@ -39,6 +39,9 @@ _mesa_get_compressed_formats(struct gl_context *ctx,
> GLint *formats);
>  extern mesa_format
>  _mesa_glenum_to_compressed_format(GLenum format);
>
> +extern bool
> +_mesa_is_specific_np_compressed_format(GLenum format);
> +
>  extern GLenum
>  _mesa_compressed_format_to_glenum(struct gl_context *ctx, mesa_format
> mesaFormat);
>
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>

LGTM. Both patches are:
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/20150911/39cabcc1/attachment.html>


More information about the mesa-dev mailing list