projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
788a835
)
vk: Add func anv_clear_mask()
author
Chad Versace
<chad.versace@intel.com>
Tue, 7 Jul 2015 22:42:04 +0000
(15:42 -0700)
committer
Chad Versace
<chad.versace@intel.com>
Tue, 7 Jul 2015 22:43:41 +0000
(15:43 -0700)
A little helper func for inspecting and clearing bitmasks.
src/vulkan/private.h
patch
|
blob
|
history
diff --git
a/src/vulkan/private.h
b/src/vulkan/private.h
index e0b18eaeddf03cd156cb2a09291a23ff7245422f..cee152bada01c1a0ec643374987eaa0ab6578dc0 100644
(file)
--- a/
src/vulkan/private.h
+++ b/
src/vulkan/private.h
@@
-90,6
+90,17
@@
anv_minify(uint32_t n, uint32_t levels)
return MAX(n >> levels, 1);
}
+static inline bool
+anv_clear_mask(uint32_t *inout_mask, uint32_t clear_mask)
+{
+ if (*inout_mask & clear_mask) {
+ *inout_mask &= ~clear_mask;
+ return true;
+ } else {
+ return false;
+ }
+}
+
#define for_each_bit(b, dword) \
for (uint32_t __dword = (dword); \
(b) = __builtin_ffs(__dword) - 1, __dword; \