From: Wladimir J. van der Laan Date: Tue, 18 Jul 2017 10:01:13 +0000 (+0200) Subject: gallium/util: Implement util_format_is_etc X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c8fe372a158e419a8ad808e5e026350547fac5a3;p=mesa.git gallium/util: Implement util_format_is_etc This is the equivalent of util_format_is_s3tc, but for ETC. Signed-off-by: Wladimir J. van der Laan Reviewed-by: Ilia Mirkin Reviewed-by: Marek Olšák Signed-off-by: Lucas Stach --- diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index d0557785f93..88bfd72d053 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -495,6 +495,19 @@ util_format_is_s3tc(enum pipe_format format) return desc->layout == UTIL_FORMAT_LAYOUT_S3TC ? TRUE : FALSE; } +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) {