Merge "Add support for custom allocators in vk::Move<> and vk::Unique<>" into vulkan
authorPyry Haulos <phaulos@google.com>
Fri, 11 Dec 2015 23:18:34 +0000 (23:18 +0000)
committerAndroid (Google) Code Review <android-gerrit@google.com>
Fri, 11 Dec 2015 23:18:34 +0000 (23:18 +0000)
framework/delibs/debase/deInt32.h

index 4806fe6..6550267 100644 (file)
@@ -206,6 +206,18 @@ DE_INLINE deBool deIsPowerOfTwo32 (int a)
 }
 
 /*--------------------------------------------------------------------*//*!
+ * \brief Check if a value is a power-of-two.
+ * \param a Input value.
+ * \return True if input is a power-of-two value, false otherwise.
+ *
+ * \note Also returns true for zero.
+ *//*--------------------------------------------------------------------*/
+DE_INLINE deBool deIsPowerOfTwo64 (deUint64 a)
+{
+       return ((a & (a - 1ull)) == 0);
+}
+
+/*--------------------------------------------------------------------*//*!
  * \brief Check if an integer is aligned to given power-of-two size.
  * \param a            Input value.
  * \param align        Alignment to check for.