diff options
author | Brian Paul <brianp@vmware.com> | 2010-05-04 17:04:27 -0600 |
---|---|---|
committer | Brian Paul <brianp@vmware.com> | 2010-05-04 17:17:04 -0600 |
commit | 0f0c0368faf38d73b0bbbb6e0a147bc94564d3a1 (patch) | |
tree | 0d012d0db005dec043a0d7e0edfae9bccb740016 /src/gallium/auxiliary/util/u_format.h | |
parent | 477b0d838b7ac3f9d0534df28f6af9e17c403a71 (diff) | |
download | external_mesa3d-0f0c0368faf38d73b0bbbb6e0a147bc94564d3a1.zip external_mesa3d-0f0c0368faf38d73b0bbbb6e0a147bc94564d3a1.tar.gz external_mesa3d-0f0c0368faf38d73b0bbbb6e0a147bc94564d3a1.tar.bz2 |
gallium/util: added is_format_compressed()
Diffstat (limited to 'src/gallium/auxiliary/util/u_format.h')
-rw-r--r-- | src/gallium/auxiliary/util/u_format.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 8ba0769..fd95bea 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -367,6 +367,26 @@ util_format_is_plain(enum pipe_format format) } 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) { const struct util_format_description *desc = util_format_description(format); |