projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f7fb757
)
vk: Add func anv_is_aligned()
author
Chad Versace
<chad.versace@intel.com>
Thu, 25 Jun 2015 23:26:07 +0000
(16:26 -0700)
committer
Chad Versace
<chad.versace@intel.com>
Thu, 25 Jun 2015 23:52:16 +0000
(16:52 -0700)
src/vulkan/private.h
patch
|
blob
|
history
diff --git
a/src/vulkan/private.h
b/src/vulkan/private.h
index 6693a2888662a6f4c421b41d5b3694b6cde68f9e..0d199c836a38096289feda04b71c52c1dd75adbf 100644
(file)
--- a/
src/vulkan/private.h
+++ b/
src/vulkan/private.h
@@
-72,6
+72,14
@@
ALIGN_I32(int32_t v, int32_t a)
return (v + a - 1) & ~(a - 1);
}
+/** Alignment must be a power of 2. */
+static inline bool
+anv_is_aligned(uintmax_t n, uintmax_t a)
+{
+ assert(a == (a & -a));
+ return (n & (a - 1)) == 0;
+}
+
static inline uint32_t
anv_minify(uint32_t n, uint32_t levels)
{