diff options
author | Roland Scheidegger <[email protected]> | 2010-03-09 17:27:45 +0100 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2010-03-09 17:28:27 +0100 |
commit | e0f10a6fca34619f61c3533b68d89dcb1ff2627c (patch) | |
tree | 0e7aa17a8e40045a1fd7a3eececa81bf16264e13 /src/gallium/auxiliary | |
parent | 09a7c25e7661887be31f3cd340010b99b407ef16 (diff) |
util: simplify util_format_get_nr_components helper
since the number of components is now stored in the pipe format description,
we obviously no longer need to figure this out ourselves.
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r-- | src/gallium/auxiliary/util/u_format.h | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 20fdaca007f..c08fdcafcc8 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -423,14 +423,7 @@ static INLINE unsigned util_format_get_nr_components(enum pipe_format format) { const struct util_format_description *desc = util_format_description(format); - unsigned chan; - unsigned nr_comp = 0; - for (chan = 0; chan < 4; chan++) { - if (desc->channel[chan].size != 0) { - nr_comp++; - } - } - return nr_comp; + return desc->nr_channels; } /* |