gallivm: correct channel shift logic on big endian
authorRay Strode <rstrode@redhat.com>
Wed, 23 Aug 2017 20:32:42 +0000 (16:32 -0400)
committerRoland Scheidegger <sroland@vmware.com>
Thu, 31 Aug 2017 23:19:13 +0000 (01:19 +0200)
commit75cb6e36178b9474bbb59b76cbbcce2a67bf88d2
tree45c185970bdbe82c9c4212765ac5e03264e750ca
parentc92fe8a8c50968a6ac37cbecdd54208f0eea246c
gallivm: correct channel shift logic on big endian

lp_build_fetch_rgba_soa fetches a texel from a texture.
Part of that process involves first gathering the element
together from memory into a packed format, and then breaking
out the individual color channels into separate, parallel
arrays.

The code fails to account for endianess when reading the packed
values.

This commit attempts to correct the problem by reversing the order
the packed values are read on big endian systems.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100613
Cc: "17.2" "17.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ray Strode <rstrode@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
src/gallium/auxiliary/gallivm/lp_bld_format_soa.c