From 78314c57cb8c64dac1ce04f17682db4ffc58effc Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Wed, 9 Nov 2016 15:49:22 +0100 Subject: st/mesa: swap bytes in the fallback format translation path of GetTexImage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore. Reviewed-by: Marek Olšák Reviewed-by: Edward O'Callaghan --- src/mesa/state_tracker/st_cb_texture.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/mesa') diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index e358c738c07..7c493fc1143 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -2073,6 +2073,12 @@ st_GetTexSubImage(struct gl_context * ctx, rgba, RGBA32_FLOAT, srcStride, width, height, NULL); + /* Handle byte swapping if required */ + if (ctx->Pack.SwapBytes) { + _mesa_swap_bytes_2d_image(format, type, &ctx->Pack, + width, height, dest, dest); + } + map += tex_xfer->layer_stride; } -- cgit v1.2.3