summaryrefslogtreecommitdiff
path: root/src/mesa/main/imports.h
diff options
context:
space:
mode:
authorBrian Paul <brian.paul@tungstengraphics.com>2008-11-11 14:42:41 -0700
committerBrian Paul <brian.paul@tungstengraphics.com>2008-11-11 14:42:41 -0700
commit19e4222f937c9bb95d3a899dd788afb930eecaa4 (patch)
tree5bb25227f53ad93fbdb9dc889ded690dc40ad1d9 /src/mesa/main/imports.h
parent7f3d45758ccbbcff6428d57d26794960e3e9532c (diff)
parent90246d3ea54f54d60593dce1b89f0226058a3c56 (diff)
Merge commit 'origin/master' into gallium-0.2
Conflicts: src/mesa/shader/prog_execute.c src/mesa/shader/slang/library/slang_vertex_builtin_gc.h
Diffstat (limited to 'src/mesa/main/imports.h')
-rw-r--r--src/mesa/main/imports.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 0e6e301fde..bab0042071 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -462,6 +462,16 @@ static INLINE int iceil(float f)
#endif
+/**
+ * Is x a power of two?
+ */
+static INLINE int
+_mesa_is_pow_two(int x)
+{
+ return !(x & (x - 1));
+}
+
+
/***
*** UNCLAMPED_FLOAT_TO_UBYTE: clamp float to [0,1] and map to ubyte in [0,255]
*** CLAMPED_FLOAT_TO_UBYTE: map float known to be in [0,1] to ubyte in [0,255]