From: Marek Olšák Date: Mon, 3 May 2010 18:09:14 +0000 (+0200) Subject: util: add util_format_short_name X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5a6b9f3855e7ba179626f7b30467e62fc3ae0ffb;p=mesa.git util: add util_format_short_name --- diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 6514315ea28..8ba076949b6 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. */