projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
96f80c8
)
mesa: Make _mesa_get_format_bytes handle array formats.
author
Jason Ekstrand
<jason.ekstrand@intel.com>
Sat, 7 Oct 2017 04:11:59 +0000
(21:11 -0700)
committer
Kenneth Graunke
<kenneth@whitecape.org>
Tue, 10 Oct 2017 22:06:17 +0000
(15:06 -0700)
This is easier than making callers handle a bunch of special cases.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/formats.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/formats.c
b/src/mesa/main/formats.c
index 34450003572cbc3ca7e29f5dddcdfcd38609811e..c1d8641116ec65117ae08a09054b3c3386cc1375 100644
(file)
--- a/
src/mesa/main/formats.c
+++ b/
src/mesa/main/formats.c
@@
-109,6
+109,11
@@
_mesa_get_format_name(mesa_format format)
GLint
_mesa_get_format_bytes(mesa_format format)
{
+ if (_mesa_format_is_mesa_array_format(format)) {
+ return _mesa_array_format_get_type_size(format) *
+ _mesa_array_format_get_num_channels(format);
+ }
+
const struct gl_format_info *info = _mesa_get_format_info(format);
assert(info->BytesPerBlock);
assert(info->BytesPerBlock <= MAX_PIXEL_BYTES ||