summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-11-09 15:49:22 +0100
committerNicolai Hähnle <[email protected]>2016-11-16 10:31:36 +0100
commit78314c57cb8c64dac1ce04f17682db4ffc58effc (patch)
tree29ab36d0a3688e6d89c3ffdcadd519fc4fd872b6 /src/mesa/state_tracker
parent22360406f78b29eb0548b2f71bfb8ed447b3c1dd (diff)
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 <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_cb_texture.c6
1 files changed, 6 insertions, 0 deletions
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;
}