move t->Image[i]->Format test (bug 659012)
authorBrian Paul <brian.paul@tungstengraphics.com>
Wed, 8 Jan 2003 16:48:04 +0000 (16:48 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Wed, 8 Jan 2003 16:48:04 +0000 (16:48 +0000)
src/mesa/main/texobj.c

index f24a0b03de7472ebc64a5d4e425c15b19db7dc4f..40711cd13ee81d1e53e1cac20055c45781031d86 100644 (file)
@@ -1,10 +1,10 @@
-/* $Id: texobj.c,v 1.63 2002/12/12 13:03:15 keithw Exp $ */
+/* $Id: texobj.c,v 1.64 2003/01/08 16:48:04 brianp Exp $ */
 
 /*
  * Mesa 3-D graphics library
- * Version:  4.1
+ * Version:  5.1
  *
- * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved.
+ * Copyright (C) 1999-2003  Brian Paul   All Rights Reserved.
  *
  * Permission is hereby granted, free of charge, to any person obtaining a
  * copy of this software and associated documentation files (the "Software"),
@@ -454,12 +454,6 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
                height /= 2;
             }
             if (i >= minLevel && i <= maxLevel) {
-               /* Don't support GL_DEPTH_COMPONENT for cube maps */
-               if (t->Image[i]->Format == GL_DEPTH_COMPONENT) {
-                  t->Complete = GL_FALSE;
-                  incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex");
-                  return;
-               }
                /* check that we have images defined */
                if (!t->Image[i] || !t->NegX[i] ||
                    !t->PosY[i]  || !t->NegY[i] ||
@@ -468,6 +462,12 @@ _mesa_test_texobj_completeness( const GLcontext *ctx,
                   incomplete(t, "CubeMap Image[i] == NULL");
                   return;
                }
+               /* Don't support GL_DEPTH_COMPONENT for cube maps */
+               if (t->Image[i]->Format == GL_DEPTH_COMPONENT) {
+                  t->Complete = GL_FALSE;
+                  incomplete(t, "GL_DEPTH_COMPONENT only works with 1/2D tex");
+                  return;
+               }
                /* check that all six images have same size */
                if (t->NegX[i]->Width2!=width || t->NegX[i]->Height2!=height ||
                    t->PosY[i]->Width2!=width || t->PosY[i]->Height2!=height ||