summaryrefslogtreecommitdiffstats
path: root/src/mesa/main/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/main/debug.c')
-rw-r--r--src/mesa/main/debug.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index a6a909b48ce..78881668e49 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -65,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, " : "",
@@ -214,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);
@@ -307,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;
@@ -325,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;
}
@@ -335,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);
@@ -423,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);
}
}