driver->NewTextureObject = _mesa_new_texture_object;
driver->DeleteTexture = _mesa_delete_texture_object;
driver->NewTextureImage = _mesa_new_texture_image;
+ driver->DeleteTextureImage = _mesa_delete_texture_image;
driver->FreeTextureImageBuffer = _mesa_free_texture_image_data;
driver->MapTextureImage = _swrast_map_teximage;
driver->UnmapTextureImage = _swrast_unmap_teximage;
return (struct gl_texture_image *) CALLOC_STRUCT(intel_texture_image);
}
+static void
+intelDeleteTextureImage(struct gl_context * ctx, struct gl_texture_image *img)
+{
+ /* nothing special (yet) for intel_texture_image */
+ _mesa_delete_texture_image(ctx, img);
+}
+
static struct gl_texture_object *
intelNewTextureObject(struct gl_context * ctx, GLuint name, GLenum target)
functions->NewTextureObject = intelNewTextureObject;
functions->NewTextureImage = intelNewTextureImage;
+ functions->DeleteTextureImage = intelDeleteTextureImage;
functions->DeleteTexture = intelDeleteTextureObject;
functions->FreeTextureImageBuffer = intel_free_texture_image_buffer;
functions->MapTextureImage = intel_map_texture_image;
return CALLOC(sizeof(radeon_texture_image));
}
+static void
+radeonDeleteTextureImage(struct gl_context * ctx, struct gl_texture_image *img)
+{
+ /* nothing special (yet) for radeon_texture_image */
+ _mesa_delete_texture_image(ctx, img);
+}
+
/**
* Free memory associated with this texture image.
*/
struct dd_function_table *functions)
{
functions->NewTextureImage = radeonNewTextureImage;
+ functions->DeleteTextureImage = radeonDeleteTextureImage;
functions->FreeTextureImageBuffer = radeonFreeTextureImageBuffer;
functions->MapTexture = radeonMapTexture;
functions->UnmapTexture = radeonUnmapTexture;
*/
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.
*/
/**
- * 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.
*
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]);
}
}
}
}
+/** called via ctx->Driver.DeleteTextureImage() */
+static void
+st_DeleteTextureImage(struct gl_context * ctx, struct gl_texture_image *img)
+{
+ /* nothing special (yet) for st_texture_image */
+ _mesa_delete_texture_image(ctx, img);
+}
+
+
/** called via ctx->Driver.NewTextureObject() */
static struct gl_texture_object *
st_NewTextureObject(struct gl_context * ctx, GLuint name, GLenum target)
functions->NewTextureObject = st_NewTextureObject;
functions->NewTextureImage = st_NewTextureImage;
+ functions->DeleteTextureImage = st_DeleteTextureImage;
functions->DeleteTexture = st_DeleteTextureObject;
functions->FreeTextureImageBuffer = st_FreeTextureImageBuffer;
functions->MapTextureImage = st_MapTextureImage;