texobj: Remove redundant checks that the texture cube faces match size
authorNeil Roberts <neil@linux.intel.com>
Thu, 21 Jan 2016 17:28:07 +0000 (17:28 +0000)
committerNeil Roberts <neil@linux.intel.com>
Thu, 21 Jan 2016 21:45:53 +0000 (21:45 +0000)
The texture mipmap completeness checking code was checking whether all
of the faces have the same size. However this is pointless because the
code just above it checks whether the face has the expected size
calculated for the mipmap level anyway so the error condition could
never be reached. This patch just removes it.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/main/texobj.c

index 9ce7b4c4754fb7b85f784f966fd9e4733aea475e..e926c7b6cd218047a5ebeb56fef9a4ab844c1005 100644 (file)
@@ -868,16 +868,6 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
                              img->Depth2);
                   return;
                }
-
-               /* Extra checks for cube textures */
-               if (face > 0) {
-                  /* check that cube faces are the same size */
-                  if (img->Width2 != t->Image[0][i]->Width2 ||
-                      img->Height2 != t->Image[0][i]->Height2) {
-                    incomplete(t, MIPMAP, "CubeMap Image[n][i] bad size");
-                    return;
-                 }
-               }
             }
          }