summaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2011-09-17 14:50:48 -0600
committerBrian Paul <[email protected]>2011-09-17 14:57:40 -0600
commit146f536b3332b7a2022bb4ba5e2d1d2ec4bedd98 (patch)
tree863c2ee5f23d879dddb36ec7191c03bd915ba384 /src/mesa/main
parentbaeefef2c0445bfd717a3086fdd9b5bd5d9cb675 (diff)
mesa: add new DeleteTextureImage() driver hook
Matches the NewTextureImage() hook. With new subclasses of gl_texture_image coming we need a new hook to properly delete objects of those subclasses.
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/dd.h4
-rw-r--r--src/mesa/main/teximage.c3
-rw-r--r--src/mesa/main/texobj.c2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h
index d6cc0196d8d..18b1b01d60c 100644
--- a/src/mesa/main/dd.h
+++ b/src/mesa/main/dd.h
@@ -476,6 +476,10 @@ struct dd_function_table {
*/
struct gl_texture_image * (*NewTextureImage)( struct gl_context *ctx );
+ /** Called to free a texture image object returned by NewTextureImage() */
+ void (*DeleteTextureImage)(struct gl_context *ctx,
+ struct gl_texture_image *);
+
/**
* Called to free tImage->Data.
*/
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c
index e11acc41281..2973b6de3a3 100644
--- a/src/mesa/main/teximage.c
+++ b/src/mesa/main/teximage.c
@@ -601,7 +601,8 @@ _mesa_free_texture_image_data(struct gl_context *ctx,
/**
- * Free texture image.
+ * Free a gl_texture_image and associated data.
+ * This function is a fallback called via ctx->Driver.DeleteTextureImage().
*
* \param texImage texture image.
*
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 1168f1842f3..1b90cca9b94 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -202,7 +202,7 @@ _mesa_delete_texture_object(struct gl_context *ctx,
for (face = 0; face < 6; face++) {
for (i = 0; i < MAX_TEXTURE_LEVELS; i++) {
if (texObj->Image[face][i]) {
- _mesa_delete_texture_image( ctx, texObj->Image[face][i] );
+ ctx->Driver.DeleteTextureImage(ctx, texObj->Image[face][i]);
}
}
}