Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / angle / src / common / mathutil.h
index 2d36631..02b44c2 100644 (file)
 #define LIBGLESV2_MATHUTIL_H_
 
 #include "common/debug.h"
-
-#if defined(_WIN32)
-#include <intrin.h>
-#endif
+#include "common/platform.h"
 
 #include <limits>
 #include <algorithm>
@@ -112,7 +109,7 @@ inline unsigned int unorm(float x)
 
 inline bool supportsSSE2()
 {
-#if defined(_WIN32)
+#ifdef ANGLE_PLATFORM_WINDOWS
     static bool checked = false;
     static bool supports = false;
 
@@ -521,6 +518,12 @@ T roundUp(const T value, const T alignment)
     return value + alignment - 1 - (value - 1) % alignment;
 }
 
+inline unsigned int UnsignedCeilDivide(unsigned int value, unsigned int divisor)
+{
+    unsigned int divided = value / divisor;
+    return (divided + ((value % divisor == 0) ? 0 : 1));
+}
+
 template <class T>
 inline bool IsUnsignedAdditionSafe(T lhs, T rhs)
 {