summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/intel/intel_tex.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-08-20 22:55:47 -0700
committerEric Anholt <eric@anholt.net>2008-08-20 23:18:02 -0700
commit495c02262eaaa68f2df23c2265362da51851c57a (patch)
tree9e59f8665e2e32209e318c1acf6139548cddfc5f /src/mesa/drivers/dri/intel/intel_tex.c
parent8f1d5ca086e16a82d7d7eb5500df9ad74f0a703f (diff)
intel: Fix SGIS_generate_mipmap after a miptree had been validated.
Previously, the updated images would be ignored because the miptree in the image matched the miptree in the object, even though Mesa core had just attached updated contents in ->Data. Additionally, Mesa core could have tried to free inside our miptree if it had already been validated. Fixes bug #17077.
Diffstat (limited to 'src/mesa/drivers/dri/intel/intel_tex.c')
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/drivers/dri/intel/intel_tex.c b/src/mesa/drivers/dri/intel/intel_tex.c
index f1d6a6dbfc..4fa18e2d54 100644
--- a/src/mesa/drivers/dri/intel/intel_tex.c
+++ b/src/mesa/drivers/dri/intel/intel_tex.c
@@ -174,6 +174,7 @@ void
intel_generate_mipmap(GLcontext *ctx, GLenum target,
struct gl_texture_object *texObj)
{
+ struct intel_context *intel = intel_context(ctx);
struct intel_texture_object *intelObj = intel_texture_object(texObj);
GLuint nr_faces = (intelObj->base.Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
int face, i;
@@ -193,6 +194,10 @@ intel_generate_mipmap(GLcontext *ctx, GLenum target,
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);
}
}
}
@@ -202,9 +207,9 @@ static void intelGenerateMipmap(GLcontext *ctx, GLenum target, struct gl_texture
struct intel_context *intel = intel_context(ctx);
struct intel_texture_object *intelObj = intel_texture_object(texObj);
- intel_tex_map_images(intel, intelObj);
+ intel_tex_map_level_images(intel, intelObj, texObj->BaseLevel);
intel_generate_mipmap(ctx, target, texObj);
- intel_tex_unmap_images(intel, intelObj);
+ intel_tex_unmap_level_images(intel, intelObj, texObj->BaseLevel);
}
void