From: Nicolai Hähnle Date: Wed, 9 Nov 2016 14:49:22 +0000 (+0100) Subject: st/mesa: swap bytes in the fallback format translation path of GetTexImage X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=78314c57cb8c64dac1ce04f17682db4ffc58effc;p=mesa.git st/mesa: swap bytes in the fallback format translation path of GetTexImage Fixes parts of GL45-CTS.gtf32.GL3Tests.packed_pixels.packed_pixels_pixelstore. Reviewed-by: Marek Olšák Reviewed-by: Edward O'Callaghan --- 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; }