From 847fcb645c1d0c69617f0cafe8e6410e13f08fa6 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Fri, 7 Aug 2009 20:16:39 -0700 Subject: gallium: Move minify() to u_math. minify() is usually used in mipmap size calculation. Strangely enough, we all defined it as MAX2(1, d >> 1); imagine that. :3 --- src/gallium/auxiliary/util/u_math.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/gallium/auxiliary') diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h index 167fc83dc1d..57410e78b02 100644 --- a/src/gallium/auxiliary/util/u_math.h +++ b/src/gallium/auxiliary/util/u_math.h @@ -450,6 +450,11 @@ align(int value, int alignment) return (value + alignment - 1) & ~(alignment - 1); } +static INLINE unsigned +minify(unsigned value) +{ + return MAX2(1, value >> 1); +} #ifndef COPY_4V #define COPY_4V( DST, SRC ) \ -- cgit v1.2.3