summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2009-10-22 09:37:22 -0600
committerBrian Paul <[email protected]>2009-10-22 18:35:12 -0600
commit488e67bab267dd687dbe83e52974ad4519906fcc (patch)
tree5d26016a59b0fa405965686419785934279b2270 /src/mesa
parentfb22e801699ef69e40d8e9dfda758be824d86b96 (diff)
mesa: added _mesa_dump_texture()
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/main/debug.c28
-rw-r--r--src/mesa/main/debug.h3
2 files changed, 28 insertions, 3 deletions
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index 8b1707bab35..0e35617575e 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -346,12 +346,10 @@ static GLboolean DumpImages;
static void
-dump_texture_cb(GLuint id, void *data, void *userData)
+dump_texture(struct gl_texture_object *texObj)
{
- struct gl_texture_object *texObj = (struct gl_texture_object *) data;
int i;
GLboolean written = GL_FALSE;
- (void) userData;
_mesa_printf("Texture %u\n", texObj->Name);
_mesa_printf(" Target 0x%x\n", texObj->Target);
@@ -372,6 +370,30 @@ dump_texture_cb(GLuint id, void *data, void *userData)
/**
+ * Dump a single texture.
+ */
+void
+_mesa_dump_texture(GLuint texture, GLboolean dumpImages)
+{
+ GET_CURRENT_CONTEXT(ctx);
+ struct gl_texture_object *texObj = _mesa_lookup_texture(ctx, texture);
+ if (texObj) {
+ DumpImages = dumpImages;
+ dump_texture(texObj);
+ }
+}
+
+
+static void
+dump_texture_cb(GLuint id, void *data, void *userData)
+{
+ struct gl_texture_object *texObj = (struct gl_texture_object *) data;
+ (void) userData;
+ dump_texture(texObj);
+}
+
+
+/**
* Print basic info about all texture objext to stdout.
* If dumpImages is true, write PPM of level[0] image to a file.
*/
diff --git a/src/mesa/main/debug.h b/src/mesa/main/debug.h
index 2a7de9c6b6a..f66f774a45d 100644
--- a/src/mesa/main/debug.h
+++ b/src/mesa/main/debug.h
@@ -58,6 +58,9 @@ extern void _mesa_init_debug( GLcontext *ctx );
#endif
extern void
+_mesa_dump_texture(GLuint texture, GLboolean dumpImages);
+
+extern void
_mesa_dump_textures(GLboolean dumpImages);
extern void