[Mesa-dev] [PATCH v3 1/2] gallium/util: Implement util_format_is_etc

Marek Olšák maraeo at gmail.com
Tue Jul 18 20:28:35 UTC 2017


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Tue, Jul 18, 2017 at 6:01 AM,  <laanwj at gmail.com> wrote:
> From: "Wladimir J. van der Laan" <laanwj at gmail.com>
>
> This is the equivalent of util_format_is_s3tc, but for
> ETC.
>
> Signed-off-by: Wladimir J. van der Laan <laanwj at gmail.com>
> ---
>  src/gallium/auxiliary/util/u_format.h | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
>
> diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h
> index d055778..2318e97 100644
> --- a/src/gallium/auxiliary/util/u_format.h
> +++ b/src/gallium/auxiliary/util/u_format.h
> @@ -496,6 +496,19 @@ util_format_is_s3tc(enum pipe_format format)
>  }
>
>  static inline boolean
> +util_format_is_etc(enum pipe_format format)
> +{
> +   const struct util_format_description *desc = util_format_description(format);
> +
> +   assert(desc);
> +   if (!desc) {
> +      return FALSE;
> +   }
> +
> +   return desc->layout == UTIL_FORMAT_LAYOUT_ETC ? TRUE : FALSE;
> +}
> +
> +static inline boolean
>  util_format_is_srgb(enum pipe_format format)
>  {
>     const struct util_format_description *desc = util_format_description(format);
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list