[Mesa-dev] [PATCH 28/37] mesa: Implement glGetTexImage() of compressed textures using the new metaops.

Eric Anholt eric at anholt.net
Mon Aug 15 11:53:58 PDT 2011


From: Brian Paul <brianp at vmware.com>

---
 src/mesa/main/texgetimage.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c
index 9f64b26..f5278e8 100644
--- a/src/mesa/main/texgetimage.c
+++ b/src/mesa/main/texgetimage.c
@@ -42,7 +42,7 @@
 #include "texgetimage.h"
 #include "texfetch.h"
 #include "teximage.h"
-
+#include "drivers/common/meta.h"
 
 
 /**
@@ -297,6 +297,15 @@ get_tex_rgba(struct gl_context *ctx, GLuint dimensions,
    }
 
    for (img = 0; img < depth; img++) {
+      if (_mesa_is_format_compressed(texImage->TexFormat)) {
+         _mesa_unlock_texture(ctx, texImage->TexObject);
+         _mesa_meta_decompress_texture_image(ctx, texImage, img,
+                                             format, type, pixels,
+                                             ctx->Pack.RowLength);
+         _mesa_lock_texture(ctx, texImage->TexObject);
+	 continue;
+      }
+
       for (row = 0; row < height; row++) {
          void *dest = _mesa_image_address(dimensions, &ctx->Pack, pixels,
                                           width, height, format, type,
-- 
1.7.5.4



More information about the mesa-dev mailing list