diff options
Diffstat (limited to 'src/mesa/main/debug.c')
-rw-r--r-- | src/mesa/main/debug.c | 47 |
1 files changed, 12 insertions, 35 deletions
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c index 79aa53585f..78881668e4 100644 --- a/src/mesa/main/debug.c +++ b/src/mesa/main/debug.c @@ -37,26 +37,6 @@ #include "texobj.h" -/** - * Primitive names - */ -const char *_mesa_prim_name[GL_POLYGON+4] = { - "GL_POINTS", - "GL_LINES", - "GL_LINE_LOOP", - "GL_LINE_STRIP", - "GL_TRIANGLES", - "GL_TRIANGLE_STRIP", - "GL_TRIANGLE_FAN", - "GL_QUADS", - "GL_QUAD_STRIP", - "GL_POLYGON", - "outside begin/end", - "inside unknown primitive", - "unknown state" -}; - - static const char * tex_target_name(GLenum tgt) { @@ -85,13 +65,12 @@ void _mesa_print_state( const char *msg, GLuint state ) { _mesa_debug(NULL, - "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", + "%s: (0x%x) %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n", msg, state, (state & _NEW_MODELVIEW) ? "ctx->ModelView, " : "", (state & _NEW_PROJECTION) ? "ctx->Projection, " : "", (state & _NEW_TEXTURE_MATRIX) ? "ctx->TextureMatrix, " : "", - (state & _NEW_ACCUM) ? "ctx->Accum, " : "", (state & _NEW_COLOR) ? "ctx->Color, " : "", (state & _NEW_DEPTH) ? "ctx->Depth, " : "", (state & _NEW_EVAL) ? "ctx->Eval/EvalMap, " : "", @@ -234,16 +213,6 @@ void _mesa_init_debug( struct gl_context *ctx ) { char *c; - - /* Dither disable */ - ctx->NoDither = _mesa_getenv("MESA_NO_DITHER") ? GL_TRUE : GL_FALSE; - if (ctx->NoDither) { - if (_mesa_getenv("MESA_DEBUG")) { - _mesa_debug(ctx, "MESA_NO_DITHER set - dithering disabled\n"); - } - ctx->Color.DitherFlag = GL_FALSE; - } - c = _mesa_getenv("MESA_DEBUG"); if (c) add_debug_flags(c); @@ -327,8 +296,8 @@ write_texture_image(struct gl_texture_object *texObj, /** * Write renderbuffer image to a ppm file. */ -static void -write_renderbuffer_image(const struct gl_renderbuffer *rb) +void +_mesa_write_renderbuffer_image(const struct gl_renderbuffer *rb) { GET_CURRENT_CONTEXT(ctx); GLubyte *buffer; @@ -345,6 +314,10 @@ write_renderbuffer_image(const struct gl_renderbuffer *rb) type = GL_UNSIGNED_INT_24_8; } else { + _mesa_debug(NULL, + "Unsupported BaseFormat 0x%x in " + "_mesa_write_renderbuffer_image()\n", + rb->_BaseFormat); return; } @@ -355,8 +328,12 @@ write_renderbuffer_image(const struct gl_renderbuffer *rb) /* make filename */ _mesa_snprintf(s, sizeof(s), "/tmp/renderbuffer%u.ppm", rb->Name); + _mesa_snprintf(s, sizeof(s), "C:\\renderbuffer%u.ppm", rb->Name); printf(" Writing renderbuffer image to %s\n", s); + + _mesa_debug(NULL, " Writing renderbuffer image to %s\n", s); + write_ppm(s, buffer, rb->Width, rb->Height, 4, 0, 1, 2, GL_TRUE); free(buffer); @@ -443,7 +420,7 @@ dump_renderbuffer(const struct gl_renderbuffer *rb, GLboolean writeImage) rb->Name, rb->Width, rb->Height, _mesa_lookup_enum_by_nr(rb->InternalFormat)); if (writeImage) { - write_renderbuffer_image(rb); + _mesa_write_renderbuffer_image(rb); } } |