From 51e7879544728e22bed74ea46437638856c8eb55 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Fri, 6 Oct 2017 21:11:59 -0700 Subject: mesa: Make _mesa_get_format_bytes handle array formats. This is easier than making callers handle a bunch of special cases. Reviewed-by: Kenneth Graunke --- src/mesa/main/formats.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/mesa/main') diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 34450003572..c1d8641116e 100644 --- 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 || -- cgit v1.2.3