added incomplete() debug function/macro
This commit is contained in:
@@ -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
|
* Mesa 3-D graphics library
|
||||||
@@ -156,6 +156,15 @@ void gl_free_texture_object( struct gl_shared_state *shared,
|
|||||||
FREE( t );
|
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 */
|
/* Always need level zero image */
|
||||||
if (!t->Image[baseLevel]) {
|
if (!t->Image[baseLevel]) {
|
||||||
|
incomplete(t, "Image[baseLevel] == NULL");
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -215,6 +225,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
|
|||||||
t->NegZ[baseLevel]->Width2 != w ||
|
t->NegZ[baseLevel]->Width2 != w ||
|
||||||
t->NegZ[baseLevel]->Height2 != h) {
|
t->NegZ[baseLevel]->Height2 != h) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "Non-quare cubemap image");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -230,6 +241,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
|
|||||||
|
|
||||||
if (minLevel > maxLevel) {
|
if (minLevel > maxLevel) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "minLevel > maxLevel");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -238,10 +250,12 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
|
|||||||
if (t->Image[i]) {
|
if (t->Image[i]) {
|
||||||
if (t->Image[i]->Format != t->Image[baseLevel]->Format) {
|
if (t->Image[i]->Format != t->Image[baseLevel]->Format) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "Format[i] != Format[baseLevel]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (t->Image[i]->Border != t->Image[baseLevel]->Border) {
|
if (t->Image[i]->Border != t->Image[baseLevel]->Border) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "Border[i] != Border[baseLevel]");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -258,10 +272,12 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
|
|||||||
if (i >= minLevel && i <= maxLevel) {
|
if (i >= minLevel && i <= maxLevel) {
|
||||||
if (!t->Image[i]) {
|
if (!t->Image[i]) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "1D Image[i] == NULL");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (t->Image[i]->Width2 != width ) {
|
if (t->Image[i]->Width2 != width ) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "1D Image[i] bad width");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -284,14 +300,17 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
|
|||||||
if (i >= minLevel && i <= maxLevel) {
|
if (i >= minLevel && i <= maxLevel) {
|
||||||
if (!t->Image[i]) {
|
if (!t->Image[i]) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "2D Image[i] == NULL");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (t->Image[i]->Width2 != width) {
|
if (t->Image[i]->Width2 != width) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "2D Image[i] bad width");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (t->Image[i]->Height2 != height) {
|
if (t->Image[i]->Height2 != height) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "2D Image[i] bad height");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (width==1 && height==1) {
|
if (width==1 && height==1) {
|
||||||
@@ -317,19 +336,23 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
|
|||||||
}
|
}
|
||||||
if (i >= minLevel && i <= maxLevel) {
|
if (i >= minLevel && i <= maxLevel) {
|
||||||
if (!t->Image[i]) {
|
if (!t->Image[i]) {
|
||||||
|
incomplete(t, "3D Image[i] == NULL");
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (t->Image[i]->Width2 != width) {
|
if (t->Image[i]->Width2 != width) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "3D Image[i] bad width");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (t->Image[i]->Height2 != height) {
|
if (t->Image[i]->Height2 != height) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "3D Image[i] bad height");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (t->Image[i]->Depth2 != depth) {
|
if (t->Image[i]->Depth2 != depth) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "3D Image[i] bad depth");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -355,6 +378,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
|
|||||||
!t->PosY[i] || !t->NegY[i] ||
|
!t->PosY[i] || !t->NegY[i] ||
|
||||||
!t->PosZ[i] || !t->NegZ[i]) {
|
!t->PosZ[i] || !t->NegZ[i]) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "CubeMap Image[i] == NULL");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* check that all six images have same size */
|
/* 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->PosZ[i]->Width2!=width || t->PosZ[i]->Height2!=height ||
|
||||||
t->NegZ[i]->Width2!=width || t->NegZ[i]->Height2!=height) {
|
t->NegZ[i]->Width2!=width || t->NegZ[i]->Height2!=height) {
|
||||||
t->Complete = GL_FALSE;
|
t->Complete = GL_FALSE;
|
||||||
|
incomplete(t, "CubeMap Image[i] bad size");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user