Mesa (master): st/mesa: swap bytes in the fallback format translation path of GetTexImage

Nicolai Hähnle nh at kemper.freedesktop.org
Wed Nov 16 09:34:11 UTC 2016


Module: Mesa
Branch: master
Commit: 78314c57cb8c64dac1ce04f17682db4ffc58effc
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=78314c57cb8c64dac1ce04f17682db4ffc58effc

Author: Nicolai Hähnle <nicolai.haehnle at amd.com>
Date:   Wed Nov  9 15:49:22 2016 +0100

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 <marek.olsak at amd.com>
Reviewed-by: Edward O'Callaghan <funfunctor at folklore1984.net>

---

 src/mesa/state_tracker/st_cb_texture.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index e358c73..7c493fc 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;
       }
 




More information about the mesa-commit mailing list