radeonsi: Do colorformat endian swap for PIPE_USAGE_STAGING
authorOded Gabbay <oded.gabbay@gmail.com>
Wed, 2 Mar 2016 19:11:57 +0000 (21:11 +0200)
committerOded Gabbay <oded.gabbay@gmail.com>
Thu, 3 Mar 2016 07:20:08 +0000 (09:20 +0200)
commit914d4967d723c58ec073eef677237798c2dc9751
tree228085b7d93d11cfe1352ee47201b4939a7d0903
parentef5183faea98dfdaa1ca0c7368c4678a031dd804
radeonsi: Do colorformat endian swap for PIPE_USAGE_STAGING

There is an old if statement (dated to 2011) that prevented doing
endian swap for colorformat, in case the buffer is marked as
PIPE_USAGE_STAGING.

This is now wrong because st_ReadPixels() reads into a destination
texture that is marked with PIPE_USAGE_STAGING. Therefore, even if
the texture is rendered correctly to the monitor, when reading it
back we get unswapped/wrong values.

This patch makes the check_rgba() function in gl-1.0-readpixsanity
piglit test pass in big-endian.

Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Cc: "11.1 11.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/radeonsi/si_state.c