Mesa (master): util: add util_format_short_name

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


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

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

util: add util_format_short_name

---

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

diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h
index 6514315..8ba0769 100644
--- a/src/gallium/auxiliary/util/u_format.h
+++ b/src/gallium/auxiliary/util/u_format.h
@@ -338,6 +338,19 @@ util_format_name(enum pipe_format format)
    return desc->name;
 }
 
+static INLINE const char *
+util_format_short_name(enum pipe_format format)
+{
+   const struct util_format_description *desc = util_format_description(format);
+
+   assert(desc);
+   if (!desc) {
+      return "???";
+   }
+
+   return desc->short_name;
+}
+
 /**
  * Whether this format is plain, see UTIL_FORMAT_LAYOUT_PLAIN for more info.
  */




More information about the mesa-commit mailing list