mesa: use MAX3() macro for 3D texture in _mesa_test_texobj_completeness()
authorBrian Paul <brianp@vmware.com>
Sat, 17 Mar 2012 22:30:02 +0000 (16:30 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 20 Mar 2012 14:23:32 +0000 (08:23 -0600)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
src/mesa/main/texobj.c

index 59059482626397c864cdf6e1cb5faafec3c15db3..def09e2d7fae8412277bae964b3e660c79cc1c36 100644 (file)
@@ -465,9 +465,9 @@ _mesa_test_texobj_completeness( const struct gl_context *ctx,
       maxLevels = ctx->Const.MaxTextureLevels;
    }
    else if (t->Target == GL_TEXTURE_3D) {
-      GLint max = MAX2(t->Image[0][baseLevel]->WidthLog2,
-                       t->Image[0][baseLevel]->HeightLog2);
-      maxLog2 = MAX2(max, (GLint)(t->Image[0][baseLevel]->DepthLog2));
+      maxLog2 = MAX3(t->Image[0][baseLevel]->WidthLog2,
+                     t->Image[0][baseLevel]->HeightLog2,
+                     t->Image[0][baseLevel]->DepthLog2);
       maxLevels = ctx->Const.Max3DTextureLevels;
    }
    else if (t->Target == GL_TEXTURE_CUBE_MAP_ARB) {