diff options
author | Brian Paul <[email protected]> | 2000-10-24 02:53:18 +0000 |
---|---|---|
committer | Brian Paul <[email protected]> | 2000-10-24 02:53:18 +0000 |
commit | 21d073d55ad668494fa19977fe06369194eb1ec5 (patch) | |
tree | 61575692dcef6004b9016f71168acb54e8240c22 | |
parent | 9a4a958a5c45024abeb5ec97419362c05c8b76ac (diff) |
added incomplete() debug function/macro
-rw-r--r-- | src/mesa/main/texobj.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index 5a9b4a1c86c..36a63f63ac5 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -1,4 +1,4 @@ -/* $Id: texobj.c,v 1.28 2000/10/24 01:13:58 brianp Exp $ */ +/* $Id: texobj.c,v 1.29 2000/10/24 02:53:18 brianp Exp $ */ /* * Mesa 3-D graphics library @@ -156,6 +156,15 @@ void gl_free_texture_object( struct gl_shared_state *shared, FREE( t ); } +#if 0 +static void +incomplete(const struct gl_texture_object *t, const char *why) +{ + printf("Texture Obj %d incomplete because: %s\n", t->Name, why); +} +#else +#define incomplete(a, b) +#endif /* @@ -172,6 +181,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, /* Always need level zero image */ if (!t->Image[baseLevel]) { + incomplete(t, "Image[baseLevel] == NULL"); t->Complete = GL_FALSE; return; } @@ -215,6 +225,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, t->NegZ[baseLevel]->Width2 != w || t->NegZ[baseLevel]->Height2 != h) { t->Complete = GL_FALSE; + incomplete(t, "Non-quare cubemap image"); return; } } @@ -230,6 +241,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, if (minLevel > maxLevel) { t->Complete = GL_FALSE; + incomplete(t, "minLevel > maxLevel"); return; } @@ -238,10 +250,12 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, if (t->Image[i]) { if (t->Image[i]->Format != t->Image[baseLevel]->Format) { t->Complete = GL_FALSE; + incomplete(t, "Format[i] != Format[baseLevel]"); return; } if (t->Image[i]->Border != t->Image[baseLevel]->Border) { t->Complete = GL_FALSE; + incomplete(t, "Border[i] != Border[baseLevel]"); return; } } @@ -258,10 +272,12 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, if (i >= minLevel && i <= maxLevel) { if (!t->Image[i]) { t->Complete = GL_FALSE; + incomplete(t, "1D Image[i] == NULL"); return; } if (t->Image[i]->Width2 != width ) { t->Complete = GL_FALSE; + incomplete(t, "1D Image[i] bad width"); return; } } @@ -284,14 +300,17 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, if (i >= minLevel && i <= maxLevel) { if (!t->Image[i]) { t->Complete = GL_FALSE; + incomplete(t, "2D Image[i] == NULL"); return; } if (t->Image[i]->Width2 != width) { t->Complete = GL_FALSE; + incomplete(t, "2D Image[i] bad width"); return; } if (t->Image[i]->Height2 != height) { t->Complete = GL_FALSE; + incomplete(t, "2D Image[i] bad height"); return; } if (width==1 && height==1) { @@ -317,19 +336,23 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, } if (i >= minLevel && i <= maxLevel) { if (!t->Image[i]) { + incomplete(t, "3D Image[i] == NULL"); t->Complete = GL_FALSE; return; } if (t->Image[i]->Width2 != width) { t->Complete = GL_FALSE; + incomplete(t, "3D Image[i] bad width"); return; } if (t->Image[i]->Height2 != height) { t->Complete = GL_FALSE; + incomplete(t, "3D Image[i] bad height"); return; } if (t->Image[i]->Depth2 != depth) { t->Complete = GL_FALSE; + incomplete(t, "3D Image[i] bad depth"); return; } } @@ -355,6 +378,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, !t->PosY[i] || !t->NegY[i] || !t->PosZ[i] || !t->NegZ[i]) { t->Complete = GL_FALSE; + incomplete(t, "CubeMap Image[i] == NULL"); return; } /* check that all six images have same size */ @@ -364,6 +388,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, t->PosZ[i]->Width2!=width || t->PosZ[i]->Height2!=height || t->NegZ[i]->Width2!=width || t->NegZ[i]->Height2!=height) { t->Complete = GL_FALSE; + incomplete(t, "CubeMap Image[i] bad size"); return; } } |