diff options
author | marha <marha@users.sourceforge.net> | 2013-07-01 11:58:08 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2013-07-01 11:58:08 +0200 |
commit | 458ea020a211b25c00c1de9e30e4434213b55f47 (patch) | |
tree | 86ce7ba4b2cc9a655d270a877202e129dcca6df3 /mesalib/src/gallium/auxiliary/util/u_format.c | |
parent | 6d46609dfd488f9433d0ed10f49d05e31a6fe51e (diff) | |
parent | 28d1f604563d9c738a4c5630364d0e6b4e9b13ff (diff) | |
download | vcxsrv-458ea020a211b25c00c1de9e30e4434213b55f47.tar.gz vcxsrv-458ea020a211b25c00c1de9e30e4434213b55f47.tar.bz2 vcxsrv-458ea020a211b25c00c1de9e30e4434213b55f47.zip |
Merge remote-tracking branch 'origin/released'
* origin/released:
mesa git update 1 Jul 2013
Diffstat (limited to 'mesalib/src/gallium/auxiliary/util/u_format.c')
-rw-r--r-- | mesalib/src/gallium/auxiliary/util/u_format.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_format.c b/mesalib/src/gallium/auxiliary/util/u_format.c index 9bdc2eabf..686ca8a89 100644 --- a/mesalib/src/gallium/auxiliary/util/u_format.c +++ b/mesalib/src/gallium/auxiliary/util/u_format.c @@ -131,6 +131,26 @@ util_format_is_pure_uint(enum pipe_format format) return (desc->channel[i].type == UTIL_FORMAT_TYPE_UNSIGNED && desc->channel[i].pure_integer) ? TRUE : FALSE; } +/** + * Returns true if all non-void channels are normalized signed. + */ +boolean +util_format_is_snorm(enum pipe_format format) +{ + const struct util_format_description *desc = util_format_description(format); + int i; + + if (desc->is_mixed) + return FALSE; + + i = util_format_get_first_non_void_channel(format); + if (i == -1) + return FALSE; + + return desc->channel[i].type == UTIL_FORMAT_TYPE_SIGNED && + !desc->channel[i].pure_integer && + desc->channel[i].normalized; +} boolean util_format_is_luminance_alpha(enum pipe_format format) |