[Mesa-dev] [PATCH 32/37] state_tracker: Drop custom glGetTexImage() code.

Eric Anholt eric at anholt.net
Mon Aug 15 11:54:02 PDT 2011


Fixes regressions in compressed texture mipmap generation, which
relies on GetTexImage internally.
---
 src/mesa/state_tracker/st_cb_texture.c |   33 +------------------------------
 1 files changed, 2 insertions(+), 31 deletions(-)

diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c
index 7134fb6..b5cfb14 100644
--- a/src/mesa/state_tracker/st_cb_texture.c
+++ b/src/mesa/state_tracker/st_cb_texture.c
@@ -924,13 +924,7 @@ st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level,
                struct gl_texture_object *texObj,
                struct gl_texture_image *texImage)
 {
-   struct st_context *st = st_context(ctx);
    struct st_texture_image *stImage = st_texture_image(texImage);
-   const GLuint dstImageStride =
-      _mesa_image_image_stride(&ctx->Pack, texImage->Width, texImage->Height,
-                               format, type);
-   GLuint depth, i;
-   GLubyte *dest;
 
    if (stImage->pt && util_format_is_s3tc(stImage->pt->format)) {
       /* Need to decompress the texture.
@@ -939,33 +933,10 @@ st_GetTexImage(struct gl_context * ctx, GLenum target, GLint level,
        */
       decompress_with_blit(ctx, target, level, format, type, pixels,
                            texObj, texImage);
-      return;
-   }
-
-   depth = texImage->Depth;
-   texImage->Depth = 1;
-
-   dest = (GLubyte *) pixels;
-
-   _mesa_set_fetch_functions(texImage, get_texture_dims(target));
-
-   for (i = 0; i < depth; i++) {
-      _mesa_get_teximage(ctx, target, level, format, type, dest,
+   } else {
+      _mesa_get_teximage(ctx, target, level, format, type, pixels,
 			 texObj, texImage);
-
-      if (stImage->pt && i + 1 < depth) {
-         /* unmap this slice */
-	 st_texture_image_unmap(st, stImage);
-         /* map next slice of 3D texture */
-	 texImage->Data = st_texture_image_map(st, stImage, i + 1,
-                                               PIPE_TRANSFER_READ, 0, 0,
-                                               stImage->base.Width,
-                                               stImage->base.Height);
-	 dest += dstImageStride;
-      }
    }
-
-   texImage->Depth = depth;
 }
 
 
-- 
1.7.5.4



More information about the mesa-dev mailing list