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

laanwj at gmail.com laanwj at gmail.com
Tue Jul 18 10:01:13 UTC 2017


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



More information about the mesa-dev mailing list