summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary/util
diff options
context:
space:
mode:
authorCorbin Simpson <[email protected]>2009-08-07 20:16:39 -0700
committerCorbin Simpson <[email protected]>2009-08-07 20:50:42 -0700
commit847fcb645c1d0c69617f0cafe8e6410e13f08fa6 (patch)
tree525a20ed0f38dbc22c9179eefcadad826af268b1 /src/gallium/auxiliary/util
parentc58133b81ab7c9ee12cac05c4671a87e34708a66 (diff)
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
Diffstat (limited to 'src/gallium/auxiliary/util')
-rw-r--r--src/gallium/auxiliary/util/u_math.h5
1 files changed, 5 insertions, 0 deletions
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 ) \