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 <eric@anholt.net>
This commit is contained in:
@@ -204,7 +204,9 @@ set_debug_flags(const char *str)
|
|||||||
};
|
};
|
||||||
static const struct option opts[] = {
|
static const struct option opts[] = {
|
||||||
{ "silent", DEBUG_SILENT }, /* turn off debug messages */
|
{ "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;
|
GLuint i;
|
||||||
|
|
||||||
|
@@ -49,9 +49,6 @@
|
|||||||
#include "texobj.h"
|
#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 */
|
/** Set this to 1 to debug/log glBlitFramebuffer() calls */
|
||||||
#define DEBUG_BLIT 0
|
#define DEBUG_BLIT 0
|
||||||
|
|
||||||
@@ -462,11 +459,9 @@ _mesa_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
|
|||||||
static void
|
static void
|
||||||
att_incomplete(const char *msg)
|
att_incomplete(const char *msg)
|
||||||
{
|
{
|
||||||
#if DEBUG_FBO
|
if (MESA_DEBUG_FLAGS & DEBUG_INCOMPLETE_FBO) {
|
||||||
_mesa_debug(NULL, "attachment incomplete: %s\n", msg);
|
_mesa_debug(NULL, "attachment incomplete: %s\n", msg);
|
||||||
#else
|
}
|
||||||
(void) msg;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -476,12 +471,9 @@ att_incomplete(const char *msg)
|
|||||||
static void
|
static void
|
||||||
fbo_incomplete(const char *msg, int index)
|
fbo_incomplete(const char *msg, int index)
|
||||||
{
|
{
|
||||||
#if DEBUG_FBO
|
if (MESA_DEBUG_FLAGS & DEBUG_INCOMPLETE_FBO) {
|
||||||
_mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index);
|
_mesa_debug(NULL, "FBO Incomplete: %s [%d]\n", msg, index);
|
||||||
#else
|
}
|
||||||
(void) msg;
|
|
||||||
(void) index;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -3523,7 +3523,9 @@ enum _verbose
|
|||||||
enum _debug
|
enum _debug
|
||||||
{
|
{
|
||||||
DEBUG_SILENT = (1 << 0),
|
DEBUG_SILENT = (1 << 0),
|
||||||
DEBUG_ALWAYS_FLUSH = (1 << 1)
|
DEBUG_ALWAYS_FLUSH = (1 << 1),
|
||||||
|
DEBUG_INCOMPLETE_TEXTURE = (1 << 2),
|
||||||
|
DEBUG_INCOMPLETE_FBO = (1 << 3)
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@@ -410,16 +410,17 @@ static void
|
|||||||
incomplete(struct gl_texture_object *t, enum base_mipmap bm,
|
incomplete(struct gl_texture_object *t, enum base_mipmap bm,
|
||||||
const char *fmt, ...)
|
const char *fmt, ...)
|
||||||
{
|
{
|
||||||
#if 0
|
if (MESA_DEBUG_FLAGS & DEBUG_INCOMPLETE_TEXTURE) {
|
||||||
va_list args;
|
va_list args;
|
||||||
char s[100];
|
char s[100];
|
||||||
|
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
vsnprintf(s, sizeof(s), fmt, args);
|
vsnprintf(s, sizeof(s), fmt, args);
|
||||||
va_end(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)
|
if (bm == BASE)
|
||||||
t->_BaseComplete = GL_FALSE;
|
t->_BaseComplete = GL_FALSE;
|
||||||
t->_MipmapComplete = GL_FALSE;
|
t->_MipmapComplete = GL_FALSE;
|
||||||
|
Reference in New Issue
Block a user