aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/main
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2012-05-09 12:09:21 -0600
committerBrian Paul <[email protected]>2012-05-11 16:13:14 -0600
commit93bcf7825d023d3d7108bc47a7a0929338bba6b9 (patch)
tree3d9aee9b44907adcdf48dad0b8913032d1a06e35 /src/mesa/main
parent014306578be1f7aeb883e7b22eb255eda82fa011 (diff)
mesa: add DEBUG_INCOMPLETE_TEXTURE, DEBUG_INCOMPLETE_FBO flags
Instead of having to hack the code to enable these debugging options, set them through the MESA_DEBUG env var. Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/main')
-rw-r--r--src/mesa/main/debug.c4
-rw-r--r--src/mesa/main/fbobject.c20
-rw-r--r--src/mesa/main/mtypes.h4
-rw-r--r--src/mesa/main/texobj.c17
4 files changed, 21 insertions, 24 deletions
diff --git a/src/mesa/main/debug.c b/src/mesa/main/debug.c
index 0e73fcbfb65..62b8e00c197 100644
--- a/src/mesa/main/debug.c
+++ b/src/mesa/main/debug.c
@@ -204,7 +204,9 @@ set_debug_flags(const char *str)
};
static const struct option opts[] = {
{ "silent", DEBUG_SILENT }, /* turn off debug messages */
- { "flush", DEBUG_ALWAYS_FLUSH } /* flush after each drawing command */
+ { "flush", DEBUG_ALWAYS_FLUSH }, /* flush after each drawing command */
+ { "incomplete_tex", DEBUG_INCOMPLETE_TEXTURE },
+ { "incomplete_fbo", DEBUG_INCOMPLETE_FBO }
};
GLuint i;
diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c
index f5636948397..777783eb7ee 100644
--- a/src/mesa/main/fbobject.c
+++ b/src/mesa/main/fbobject.c
@@ -49,9 +49,6 @@
#include "texobj.h"
-/** Set this to 1 to help debug FBO incompleteness problems */
-#define DEBUG_FBO 0
-
/** Set this to 1 to debug/log glBlitFramebuffer() calls */
#define DEBUG_BLIT 0
@@ -462,11 +459,9 @@ _mesa_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
static void
att_incomplete(const char *msg)
{
-#if DEBUG_FBO
- _mesa_debug(NULL, "attachment incomplete: %s\n", msg);
-#else
- (void) msg;
-#endif
+ if (MESA_DEBUG_FLAGS & DEBUG_INCOMPLETE_FBO) {
+ _mesa_debug(NULL, "attachment incomplete: %s\n", msg);
+ }
}
@@ -476,12 +471,9 @@ att_incomplete(const char *msg)
static void
fbo_incomplete(const char *msg, int index)
{
-#if DEBUG_FBO
- _mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index);
-#else
- (void) msg;
- (void) index;
-#endif
+ if (MESA_DEBUG_FLAGS & DEBUG_INCOMPLETE_FBO) {
+ _mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index);
+ }
}
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 8b26d2a728d..c306ac6b9e9 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -3523,7 +3523,9 @@ enum _verbose
enum _debug
{
DEBUG_SILENT = (1 << 0),
- DEBUG_ALWAYS_FLUSH = (1 << 1)
+ DEBUG_ALWAYS_FLUSH = (1 << 1),
+ DEBUG_INCOMPLETE_TEXTURE = (1 << 2),
+ DEBUG_INCOMPLETE_FBO = (1 << 3)
};
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 155b255a721..365169dddc6 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -410,16 +410,17 @@ static void
incomplete(struct gl_texture_object *t, enum base_mipmap bm,
const char *fmt, ...)
{
-#if 0
- va_list args;
- char s[100];
+ if (MESA_DEBUG_FLAGS & DEBUG_INCOMPLETE_TEXTURE) {
+ va_list args;
+ char s[100];
- va_start(args, fmt);
- vsnprintf(s, sizeof(s), fmt, args);
- va_end(args);
+ va_start(args, fmt);
+ vsnprintf(s, sizeof(s), fmt, args);
+ va_end(args);
+
+ _mesa_debug(NULL, "Texture Obj %d incomplete because: %s\n", t->Name, s);
+ }
- printf("Texture Obj %d incomplete because: %s\n", t->Name, s);
-#endif
if (bm == BASE)
t->_BaseComplete = GL_FALSE;
t->_MipmapComplete = GL_FALSE;