summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2010-11-02 13:40:39 -0700
committerEric Anholt <[email protected]>2010-11-02 14:24:42 -0700
commit1210aa75513391779c87e93f009fcf3e52a79cbf (patch)
tree57d85764178bf974f28f720080c1b0165c6c7f0a /src
parent965c8a3f1d0f5013359340cda72117faa8960f91 (diff)
mesa: Don't compute an unused texture completeness debug string.
This showed up at about 1% on cairo-gl firefox-talos-gfx, where glClear() is called while a texture is incomplete.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/main/texobj.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index e08df0f7fed..f0bc447e33b 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -382,12 +382,19 @@ _mesa_reference_texobj(struct gl_texture_object **ptr,
*/
#if 0
static void
-incomplete(const struct gl_texture_object *t, const char *why)
+incomplete(const struct gl_texture_object *t, const char *fmt, ...)
{
- printf("Texture Obj %d incomplete because: %s\n", t->Name, why);
+ va_list args;
+ char s[100];
+
+ va_start(args, fmt);
+ vsnprintf(s, sizeof(s), fmt, args);
+ va_end(args);
+
+ printf("Texture Obj %d incomplete because: %s\n", t->Name, s);
}
#else
-#define incomplete(t, why)
+#define incomplete(t, why, ...)
#endif
@@ -416,18 +423,14 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
* value.
*/
if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) {
- char s[100];
- _mesa_snprintf(s, sizeof(s), "base level = %d is invalid", baseLevel);
- incomplete(t, s);
+ incomplete(t, "base level = %d is invalid", baseLevel);
t->_Complete = GL_FALSE;
return;
}
/* Always need the base level image */
if (!t->Image[0][baseLevel]) {
- char s[100];
- _mesa_snprintf(s, sizeof(s), "Image[baseLevel=%d] == NULL", baseLevel);
- incomplete(t, s);
+ incomplete(t, "Image[baseLevel=%d] == NULL", baseLevel);
t->_Complete = GL_FALSE;
return;
}