summaryrefslogtreecommitdiffstats
path: root/src/mesa/pipe
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-08-17 11:40:06 -0600
committerBrian <[email protected]>2007-08-17 11:40:06 -0600
commitcd3162f57831fd0b8d9af6bfcd08a521ab352386 (patch)
tree3ea588f441fe9d57fa63d2d068384dc697b01300 /src/mesa/pipe
parent2fc54f5bb56a7714c843fc5a6a3bb6895af9babc (diff)
added align16() function
Diffstat (limited to 'src/mesa/pipe')
-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 69b69a3c67d..3eff3328c78 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 )
{