From 4af79ab076942092ce66c746e67513c46857b85a Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Tue, 7 Jul 2015 15:42:04 -0700 Subject: [PATCH] vk: Add func anv_clear_mask() A little helper func for inspecting and clearing bitmasks. --- src/vulkan/private.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/vulkan/private.h b/src/vulkan/private.h index e0b18eaeddf..cee152bada0 100644 --- 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; \ -- 2.30.2