summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h6
-rw-r--r--src/mesa/main/macros.h11
2 files changed, 11 insertions, 6 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index dbe504aab10..487142cd300 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1430,12 +1430,6 @@ struct brw_context
struct intel_screen *intelScreen;
};
-static inline bool
-is_power_of_two(uint32_t value)
-{
- return (value & (value - 1)) == 0;
-}
-
/*======================================================================
* brw_vtbl.c
*/
diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
index dafeaa372f1..5228c3a8f28 100644
--- a/src/mesa/main/macros.h
+++ b/src/mesa/main/macros.h
@@ -685,6 +685,17 @@ minify(unsigned value, unsigned levels)
}
/**
+ * Return true if the given value is a power of two.
+ *
+ * Note that this considers 0 a power of two.
+ */
+static inline bool
+is_power_of_two(unsigned value)
+{
+ return (value & (value - 1)) == 0;
+}
+
+/**
* Align a value up to an alignment value
*
* If \c value is not already aligned to the requested alignment value, it