projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
09a7c25
)
util: simplify util_format_get_nr_components helper
author
Roland Scheidegger
<sroland@vmware.com>
Tue, 9 Mar 2010 16:27:45 +0000
(17:27 +0100)
committer
Roland Scheidegger
<sroland@vmware.com>
Tue, 9 Mar 2010 16:28:27 +0000
(17:28 +0100)
since the number of components is now stored in the pipe format description,
we obviously no longer need to figure this out ourselves.
src/gallium/auxiliary/util/u_format.h
patch
|
blob
|
history
diff --git
a/src/gallium/auxiliary/util/u_format.h
b/src/gallium/auxiliary/util/u_format.h
index 20fdaca007f45af2eee7e6666244c338ce3bff89..c08fdcafcc8deca38f5013e5570924687f15c070 100644
(file)
--- 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;
}
/*