diff options
author | Marek Olšák <maraeo@gmail.com> | 2010-05-03 20:09:14 +0200 |
---|---|---|
committer | Marek Olšák <maraeo@gmail.com> | 2010-05-03 20:39:43 +0200 |
commit | 5a6b9f3855e7ba179626f7b30467e62fc3ae0ffb (patch) | |
tree | 497831283168ce541a4f9e7999410559023b3ead /src | |
parent | bc3d9a8b187eb0756f4666a13dbc2dc1c01b0299 (diff) |
util: add util_format_short_name
Diffstat (limited to 'src')
-rw-r--r-- | 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 6514315ea2..8ba076949b 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. */ |