meta: Use minify() in GenerateMipmaps code.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 6 Mar 2014 03:06:51 +0000 (19:06 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 8 Mar 2014 06:45:13 +0000 (22:45 -0800)
This is what the macro is for.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/common/meta_generate_mipmap.c

index 6a0ccbdb7dd1469eab3c41da9d822d7b824623ef..9bce97d6561861cd50f71e67fceaa6ca0bd456e2 100644 (file)
@@ -282,9 +282,9 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target,
       srcDepth = srcImage->Depth;
 
       /* new dst size */
-      dstWidth = MAX2(1, srcWidth / 2);
-      dstHeight = MAX2(1, srcHeight / 2);
-      dstDepth = MAX2(1, srcDepth / 2);
+      dstWidth = minify(srcWidth, 1);
+      dstHeight = minify(srcHeight, 1);
+      dstDepth = minify(srcDepth, 1);
 
       if (dstWidth == srcImage->Width &&
           dstHeight == srcImage->Height &&