From: Chad Versace Date: Tue, 7 Jul 2015 22:42:04 +0000 (-0700) Subject: vk: Add func anv_clear_mask() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4af79ab076942092ce66c746e67513c46857b85a;p=mesa.git vk: Add func anv_clear_mask() A little helper func for inspecting and clearing bitmasks. --- 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; \