From: Brian Paul Date: Tue, 4 May 2010 23:04:27 +0000 (-0600) Subject: gallium/util: added is_format_compressed() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0f0c0368faf38d73b0bbbb6e0a147bc94564d3a1;p=mesa.git gallium/util: added is_format_compressed() --- diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 8ba076949b6..fd95bea1a7b 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -366,6 +366,26 @@ util_format_is_plain(enum pipe_format format) return desc->layout == UTIL_FORMAT_LAYOUT_PLAIN ? TRUE : FALSE; } +static INLINE boolean +util_format_is_compressed(enum pipe_format format) +{ + const struct util_format_description *desc = util_format_description(format); + + assert(desc); + if (!desc) { + return FALSE; + } + + switch (desc->layout) { + case UTIL_FORMAT_LAYOUT_S3TC: + case UTIL_FORMAT_LAYOUT_RGTC: + /* XXX add other formats in the future */ + return TRUE; + default: + return FALSE; + } +} + static INLINE boolean util_format_is_s3tc(enum pipe_format format) {