diff options
author | Wladimir J. van der Laan <[email protected]> | 2017-07-18 12:01:13 +0200 |
---|---|---|
committer | Lucas Stach <[email protected]> | 2017-07-21 12:17:45 +0200 |
commit | c8fe372a158e419a8ad808e5e026350547fac5a3 (patch) | |
tree | 58414bc3cecc34cbf52fd23a593b28743ba24bd2 /src/gallium | |
parent | c1a29e104cc585ad3219b12d09f532a129d68dad (diff) |
gallium/util: Implement util_format_is_etc
This is the equivalent of util_format_is_s3tc, but for ETC.
Signed-off-by: Wladimir J. van der Laan <[email protected]>
Reviewed-by: Ilia Mirkin <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Signed-off-by: Lucas Stach <[email protected]>
Diffstat (limited to 'src/gallium')
-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 d0557785f93..88bfd72d053 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -495,6 +495,19 @@ util_format_is_s3tc(enum pipe_format format) return desc->layout == UTIL_FORMAT_LAYOUT_S3TC ? TRUE : FALSE; } +static inline boolean +util_format_is_etc(enum pipe_format format) +{ + const struct util_format_description *desc = util_format_description(format); + + assert(desc); + if (!desc) { + return FALSE; + } + + return desc->layout == UTIL_FORMAT_LAYOUT_ETC ? TRUE : FALSE; +} + static inline boolean util_format_is_srgb(enum pipe_format format) { |