Mesa (master): gallium/util: Implement util_format_is_etc

Lucas Stach lynxeye at kemper.freedesktop.org
Fri Jul 21 10:18:57 UTC 2017


Module: Mesa
Branch: master
Commit: c8fe372a158e419a8ad808e5e026350547fac5a3
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c8fe372a158e419a8ad808e5e026350547fac5a3

Author: Wladimir J. van der Laan <laanwj at gmail.com>
Date:   Tue Jul 18 12:01:13 2017 +0200

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 <laanwj at gmail.com>
Reviewed-by: Ilia Mirkin <imirkin at alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak at amd.com>
Signed-off-by: Lucas Stach <l.stach at pengutronix.de>

---

 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 d0557785f9..88bfd72d05 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)
 {




More information about the mesa-commit mailing list