Mesa (master): util: add util_format_is_plain

Marek Olšák mareko at kemper.freedesktop.org
Mon May 3 18:42:39 UTC 2010


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

Author: Marek Olšák <maraeo at gmail.com>
Date:   Mon May  3 19:19:02 2010 +0200

util: add util_format_is_plain

---

 src/gallium/auxiliary/util/u_format.h |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h
index fb6ade5..6514315 100644
--- a/src/gallium/auxiliary/util/u_format.h
+++ b/src/gallium/auxiliary/util/u_format.h
@@ -338,6 +338,21 @@ util_format_name(enum pipe_format format)
    return desc->name;
 }
 
+/**
+ * Whether this format is plain, see UTIL_FORMAT_LAYOUT_PLAIN for more info.
+ */
+static INLINE boolean
+util_format_is_plain(enum pipe_format format)
+{
+   const struct util_format_description *desc = util_format_description(format);
+
+   if (!format) {
+      return FALSE;
+   }
+
+   return desc->layout == UTIL_FORMAT_LAYOUT_PLAIN ? TRUE : FALSE;
+}
+
 static INLINE boolean 
 util_format_is_s3tc(enum pipe_format format)
 {




More information about the mesa-commit mailing list