summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/p_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/pipe/p_util.h')
-rw-r--r--src/mesa/pipe/p_util.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mesa/pipe/p_util.h b/src/mesa/pipe/p_util.h
index 69b69a3c67..3eff3328c7 100644
--- a/src/mesa/pipe/p_util.h
+++ b/src/mesa/pipe/p_util.h
@@ -38,6 +38,22 @@
#define Elements(x) sizeof(x)/sizeof(*(x))
+/**
+ * Return pointer aligned to next multiple of 16 bytes.
+ */
+static INLINE void *
+align16(void *unaligned)
+{
+ union {
+ void *p;
+ uint64 u;
+ } pu;
+ pu.p = unaligned;
+ pu.u = (pu.u + 15) & ~15;
+ return pu.p;
+}
+
+
#if defined(__MSC__) && defined(__WIN32__)
static INLINE unsigned ffs( unsigned u )
{