projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7cec6c5
)
vk: Add anv_minify()
author
Chad Versace
<chad.versace@intel.com>
Thu, 28 May 2015 16:50:26 +0000
(09:50 -0700)
committer
Chad Versace
<chad.versace@intel.com>
Thu, 25 Jun 2015 23:52:05 +0000
(16:52 -0700)
src/vulkan/private.h
patch
|
blob
|
history
diff --git
a/src/vulkan/private.h
b/src/vulkan/private.h
index db7f5f30af30a7c2035f02f22d993749ec0a6de0..6693a2888662a6f4c421b41d5b3694b6cde68f9e 100644
(file)
--- a/
src/vulkan/private.h
+++ b/
src/vulkan/private.h
@@
-72,6
+72,15
@@
ALIGN_I32(int32_t v, int32_t a)
return (v + a - 1) & ~(a - 1);
}
+static inline uint32_t
+anv_minify(uint32_t n, uint32_t levels)
+{
+ if (unlikely(n == 0))
+ return 0;
+ else
+ return MAX(n >> levels, 1);
+}
+
#define for_each_bit(b, dword) \
for (uint32_t __dword = (dword); \
(b) = __builtin_ffs(__dword) - 1, __dword; \