main: Fixed _mesa_GetCompressedTexImage_sw to copy slices correctly.
authorLaura Ekstrand <laura@jlekstrand.net>
Mon, 16 Feb 2015 22:29:57 +0000 (14:29 -0800)
committerLaura Ekstrand <laura@jlekstrand.net>
Tue, 17 Feb 2015 21:45:48 +0000 (13:45 -0800)
Previously array textures were not working with GetCompressedTextureImage,
leading to failures in the test
arb_direct_state_access/getcompressedtextureimage.c.

Tested-by: Laura Ekstrand <laura@jlekstrand.net>
Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: "10.4, 10.5" <mesa-stable@lists.freedesktop.org>
src/mesa/main/texgetimage.c

index 23cc3f06f07e423f45ad0aa2f81f4365d8bc1321..24df5b6f89de4735ac48aa5904df8e7c4e23073c 100644 (file)
@@ -742,7 +742,7 @@ _mesa_GetCompressedTexImage_sw(struct gl_context *ctx,
       GLubyte *src;
 
       /* map src texture buffer */
-      ctx->Driver.MapTextureImage(ctx, texImage, 0,
+      ctx->Driver.MapTextureImage(ctx, texImage, slice,
                                   0, 0, texImage->Width, texImage->Height,
                                   GL_MAP_READ_BIT, &src, &srcRowStride);
 
@@ -754,7 +754,7 @@ _mesa_GetCompressedTexImage_sw(struct gl_context *ctx,
             src += srcRowStride;
          }
 
-         ctx->Driver.UnmapTextureImage(ctx, texImage, 0);
+         ctx->Driver.UnmapTextureImage(ctx, texImage, slice);
 
          /* Advance to next slice */
          dest += store.TotalBytesPerRow * (store.TotalRowsPerSlice - store.CopyRowsPerSlice);