Mesa (master): meta: Use minify() in GenerateMipmaps code.
Kenneth Graunke
kwg at kemper.freedesktop.org
Sat Mar 8 06:45:34 UTC 2014
Module: Mesa
Branch: master
Commit: 45ee1b30d76cae79b5040bda72ecd87d7d39f1e3
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=45ee1b30d76cae79b5040bda72ecd87d7d39f1e3
Author: Kenneth Graunke <kenneth at whitecape.org>
Date: Wed Mar 5 19:06:51 2014 -0800
meta: Use minify() in GenerateMipmaps code.
This is what the macro is for.
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Matt Turner <mattst88 at gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>
---
src/mesa/drivers/common/meta_generate_mipmap.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/common/meta_generate_mipmap.c b/src/mesa/drivers/common/meta_generate_mipmap.c
index 6a0ccbd..9bce97d 100644
--- a/src/mesa/drivers/common/meta_generate_mipmap.c
+++ b/src/mesa/drivers/common/meta_generate_mipmap.c
@@ -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 &&
More information about the mesa-commit
mailing list