From 42b6b067ac68ac1309d0570613bea4a88f745559 Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Wed, 5 Aug 2009 16:06:50 -0600 Subject: mesa/main: Add functions to clear and dirty texture objects. This commit adds a function to clear a texture object such that there is no image data associated with it, and a function to dirty it so that it will be re-tested for completeness. Signed-off-by: Chia-I Wu --- src/mesa/main/teximage.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/mesa/main/teximage.c') diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 3549b68829b..83f025f86f8 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -1218,6 +1218,23 @@ _mesa_init_teximage_fields(GLcontext *ctx, GLenum target, } +/** + * Free and clear fields of the gl_texture_image struct. + * + * \param ctx GL context. + * \param texImage texture image structure to be cleared. + * + * After the call, \p texImage will have no data associated with it. Its + * fields are cleared so that its parent object will test incomplete. + */ +void +_mesa_clear_texture_image(GLcontext *ctx, struct gl_texture_image *texImage) +{ + ctx->Driver.FreeTexImageData(ctx, texImage); + clear_teximage_fields(texImage); +} + + /** * This is the fallback for Driver.TestProxyTexImage(). Test the texture * level, width, height and depth against the ctx->Const limits for textures. -- cgit v1.2.3