From: Brian Paul Date: Tue, 13 Oct 2009 16:37:39 +0000 (-0600) Subject: intel: fix broken sw generate mipmap path X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=83f4e72009e2ee03ec1175bd3e6e309e605c2bd1;p=mesa.git intel: fix broken sw generate mipmap path Need to restore code that fixed up the intel_texture_image state. --- diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c index 3cbc379dbd3..215a534a5c5 100644 --- a/src/mesa/drivers/dri/intel/intel_tex.c +++ b/src/mesa/drivers/dri/intel/intel_tex.c @@ -177,6 +177,28 @@ intelGenerateMipmap(GLcontext *ctx, GLenum target, intel_tex_map_level_images(intel, intelObj, texObj->BaseLevel); _mesa_generate_mipmap(ctx, target, texObj); intel_tex_unmap_level_images(intel, intelObj, texObj->BaseLevel); + + { + GLuint nr_faces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1; + GLuint face, i; + /* Update the level information in our private data in the new images, + * since it didn't get set as part of a normal TexImage path. + */ + for (face = 0; face < nr_faces; face++) { + for (i = texObj->BaseLevel + 1; i < texObj->MaxLevel; i++) { + struct intel_texture_image *intelImage = + intel_texture_image(texObj->Image[face][i]); + if (!intelImage) + break; + intelImage->level = i; + intelImage->face = face; + /* Unreference the miptree to signal that the new Data is a + * bare pointer from mesa. + */ + intel_miptree_release(intel, &intelImage->mt); + } + } + } } else { _mesa_meta_GenerateMipmap(ctx, target, texObj);