aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/drivers/common/meta.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2013-07-25 08:32:37 +0200
committermarha <marha@users.sourceforge.net>2013-07-25 08:32:37 +0200
commitacf3535c75d7c79154b6b89c66567317944d244c (patch)
tree8fcc57fc152d9c594e3119678a6f5d8f0160267b /mesalib/src/mesa/drivers/common/meta.c
parent5c340ceb9356ea029dea53b73440268d4769d5a5 (diff)
downloadvcxsrv-acf3535c75d7c79154b6b89c66567317944d244c.tar.gz
vcxsrv-acf3535c75d7c79154b6b89c66567317944d244c.tar.bz2
vcxsrv-acf3535c75d7c79154b6b89c66567317944d244c.zip
xserver mesa git update 25 Jul 2013
xserver commit 43ac0491e36cdbb716b5c9d39c97d0aba3bebd75 mesa commit 8a9df7a370b66ec50b6255e4d66ac1ed331319fb
Diffstat (limited to 'mesalib/src/mesa/drivers/common/meta.c')
-rw-r--r--mesalib/src/mesa/drivers/common/meta.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/mesalib/src/mesa/drivers/common/meta.c b/mesalib/src/mesa/drivers/common/meta.c
index e8484299b..4a3497c9a 100644
--- a/mesalib/src/mesa/drivers/common/meta.c
+++ b/mesalib/src/mesa/drivers/common/meta.c
@@ -4095,10 +4095,29 @@ _mesa_meta_GetTexImage(struct gl_context *ctx,
_mesa_get_format_datatype(texImage->TexFormat)
== GL_UNSIGNED_NORMALIZED) {
struct gl_texture_object *texObj = texImage->TexObject;
- const GLuint slice = 0; /* only 2D compressed textures for now */
+ GLuint slice;
/* Need to unlock the texture here to prevent deadlock... */
_mesa_unlock_texture(ctx, texObj);
- decompress_texture_image(ctx, texImage, slice, format, type, pixels);
+ for (slice = 0; slice < texImage->Depth; slice++) {
+ void *dst;
+ if (texImage->TexObject->Target == GL_TEXTURE_2D_ARRAY) {
+ /* Setup pixel packing. SkipPixels and SkipRows will be applied
+ * in the decompress_texture_image() function's call to
+ * glReadPixels but we need to compute the dest slice's address
+ * here (according to SkipImages and ImageHeight).
+ */
+ struct gl_pixelstore_attrib packing = ctx->Pack;
+ packing.SkipPixels = 0;
+ packing.SkipRows = 0;
+ dst = _mesa_image_address3d(&packing, pixels, texImage->Width,
+ texImage->Height, format, type,
+ slice, 0, 0);
+ }
+ else {
+ dst = pixels;
+ }
+ decompress_texture_image(ctx, texImage, slice, format, type, dst);
+ }
/* ... and relock it */
_mesa_lock_texture(ctx, texObj);
}