Byte swapping makes no sense for 3-byte formats: Swapping the order of 2
or 4 bytes at a time would inevitably result in bytes getting mixed up
between neighbouring pixels.
Fixes crash with a debugging build on a big endian machine due hitting
the unreachable() at the end of the function.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2665
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4735>
num_channels = _mesa_array_format_get_num_channels(format);
_mesa_array_format_get_swizzle(format, swizzle);
- if (num_channels == 1)
+ if (num_channels == 1 || num_channels == 3)
return format;
if (num_channels == 2) {