projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2fc54f5
)
added align16() function
author
Brian
<brian.paul@tungstengraphics.com>
Fri, 17 Aug 2007 17:40:06 +0000
(11:40 -0600)
committer
Brian
<brian.paul@tungstengraphics.com>
Fri, 17 Aug 2007 17:40:06 +0000
(11:40 -0600)
src/mesa/pipe/p_util.h
patch
|
blob
|
history
diff --git
a/src/mesa/pipe/p_util.h
b/src/mesa/pipe/p_util.h
index 69b69a3c67d6c290d325664f907d67d7d5e4e7c2..3eff3328c787fe09908409a78664dfa5a6239bbe 100644
(file)
--- 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 )
{