mesa: handle SwapBytes in compressed texture get code.
authorDave Airlie <airlied@gmail.com>
Tue, 25 Aug 2015 11:13:13 +0000 (21:13 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 1 Sep 2015 23:17:29 +0000 (09:17 +1000)
This case just wasn't handled, so add support for it.

Cc: "11.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/mesa/main/texgetimage.c

index a1fd33851f20138e23c2c4a5a9642399bcdb11d0..682b72755c7a6a7abf50db5c65d73fae19a16833 100644 (file)
@@ -361,6 +361,13 @@ get_tex_rgba_compressed(struct gl_context *ctx, GLuint dimensions,
                            tempSlice, RGBA32_FLOAT, srcStride,
                            width, height,
                            needsRebase ? rebaseSwizzle : NULL);
+
+      /* Handle byte swapping if required */
+      if (ctx->Pack.SwapBytes) {
+         _mesa_swap_bytes_2d_image(format, type, &ctx->Pack,
+                                   width, height, dest, dest);
+      }
+
       tempSlice += 4 * width * height;
    }