summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2000-10-24 02:52:36 +0000
committerBrian Paul <brian.paul@tungstengraphics.com>2000-10-24 02:52:36 +0000
commit0bf528485016c7f120d96022df759b8eb9e04beb (patch)
tree5d7bc79ee7940978695c76887ea29dbe1be21127
parente3650179c633ae89b34d5676e245aba332564f70 (diff)
added incomplete() debug function/macro
-rw-r--r--src/mesa/main/texobj.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c
index 0adee5d8899..8e1f22c2352 100644
--- a/src/mesa/main/texobj.c
+++ b/src/mesa/main/texobj.c
@@ -1,4 +1,4 @@
-/* $Id: texobj.c,v 1.23.4.5 2000/10/24 01:14:16 brianp Exp $ */
+/* $Id: texobj.c,v 1.23.4.6 2000/10/24 02:52:36 brianp Exp $ */
/*
* Mesa 3-D graphics library
@@ -159,6 +159,20 @@ void gl_free_texture_object( struct gl_shared_state *shared,
/*
+ * This is helpful to diagnose incomplete texture problems.
+ */
+#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
+
+
+/*
* Examine a texture object to determine if it is complete or not.
* The t->Complete flag will be set to GL_TRUE or GL_FALSE accordingly.
*/
@@ -172,6 +186,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 +230,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 +246,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
if (minLevel > maxLevel) {
t->Complete = GL_FALSE;
+ incomplete(t, "minLevel > maxLevel");
return;
}
@@ -238,10 +255,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 +277,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 +305,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 +341,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 +383,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 +393,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;
}
}