[Mesa-dev] [PATCH v2 1/2] mesa: Make _mesa_get_format_bytes handle array formats.

Jason Ekstrand jason at jlekstrand.net
Sat Oct 7 20:58:30 UTC 2017


Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

That said, given that I typed it into IRC last night, maybe we should get 
another review?


On October 7, 2017 1:42:50 PM Kenneth Graunke <kenneth at whitecape.org> wrote:

> This is easier than making callers handle a bunch of special cases.
>
> Suggested-by: Jason Ekstrand <jason at jlekstrand.net>
> ---
>  src/mesa/main/formats.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c
> index ecdfd561035..ac4ac23c03f 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 ||
> --
> 2.14.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev




More information about the mesa-dev mailing list