From f989390af6f827d1ea36560381340148811836f3 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 13 May 2009 22:35:06 +0200 Subject: [PATCH] st/gl: Fix mip gen for compressed textures --- src/mesa/state_tracker/st_cb_texture.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index b182106fd56..aaed155925d 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -673,7 +673,7 @@ st_TexImage(GLcontext * ctx, PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) { if (compress_with_blit(ctx, target, level, 0, 0, 0, width, height, depth, format, type, pixels, unpack, texImage)) { - return; + goto done; } } @@ -750,6 +750,7 @@ st_TexImage(GLcontext * ctx, _mesa_unmap_teximage_pbo(ctx, unpack); +done: if (stImage->pt && texImage->Data) { st_texture_image_unmap(ctx->st, stImage); texImage->Data = NULL; @@ -1061,7 +1062,7 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, packing, texImage)) { - return; + goto done; } } @@ -1110,16 +1111,17 @@ st_TexSubimage(GLcontext *ctx, GLint dims, GLenum target, GLint level, } } - if (level == texObj->BaseLevel && texObj->GenerateMipmap) { - ctx->Driver.GenerateMipmap(ctx, target, texObj); - } - _mesa_unmap_teximage_pbo(ctx, packing); +done: if (stImage->pt) { st_texture_image_unmap(ctx->st, stImage); texImage->Data = NULL; } + + if (level == texObj->BaseLevel && texObj->GenerateMipmap) { + ctx->Driver.GenerateMipmap(ctx, target, texObj); + } } -- 2.30.2