[Mesa-stable] [Mesa-dev] [PATCH 1/1] mesa/formats: don't byteswap when building array formats

Jason Ekstrand jason at jlekstrand.net
Wed Aug 12 07:43:36 PDT 2015


On Aug 12, 2015 3:55 AM, "Oded Gabbay" <oded.gabbay at gmail.com> wrote:
>
> Because we build here an array format, we don't need to swap the
> bytes for big endian.
> If it isn't an array format, the bytes will be swapped in
> _mesa_format_convert.
>
> Signed-off-by: Oded Gabbay <oded.gabbay at gmail.com>
> Cc: Jason Ekstrand <jason.ekstrand at intel.com>
> Cc: Iago Toral <itoral at igalia.com>
> Cc: "10.5 10.6" <mesa-stable at lists.freedesktop.org>
> ---
>  src/mesa/main/glformats.c | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
> index c3fd734..07edb50 100644
> --- a/src/mesa/main/glformats.c
> +++ b/src/mesa/main/glformats.c
> @@ -2711,9 +2711,6 @@ _mesa_format_from_format_and_type(GLenum format,
GLenum type)
>                             normalized, num_channels,
>                             swizzle[0], swizzle[1], swizzle[2],
swizzle[3]);
>
> -      if (!_mesa_little_endian())
> -         array_format = _mesa_array_format_flip_channels(array_format);
> -
>        return array_format;

We might as well return the result of the MESA_ARRAY_FORMAT call directly
and get rid of the temporary variable.

Good find!

--Jason

>     }
>
> --
> 2.4.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-stable/attachments/20150812/25d11618/attachment.html>


More information about the mesa-stable mailing list