summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/teximage.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2009-08-05 16:06:50 -0600
committerBrian Paul <[email protected]>2009-08-05 16:06:50 -0600
commit42b6b067ac68ac1309d0570613bea4a88f745559 (patch)
treea2729ca3297265348155cf0ec89e7661c933449c /src/mesa/main/teximage.c
parent1f713059934c2365a42aadfdca49213b36a7de90 (diff)
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 <[email protected]>
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r--src/mesa/main/teximage.c17
1 files changed, 17 insertions, 0 deletions
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
@@ -1219,6 +1219,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.
*