diff options
Diffstat (limited to 'src/3rdparty/angle/src/libGLESv2/mathutil.h')
-rw-r--r-- | src/3rdparty/angle/src/libGLESv2/mathutil.h | 22 |
1 files changed, 18 insertions, 4 deletions
diff --git a/src/3rdparty/angle/src/libGLESv2/mathutil.h b/src/3rdparty/angle/src/libGLESv2/mathutil.h index 790ecd89fa..672c443c11 100644 --- a/src/3rdparty/angle/src/libGLESv2/mathutil.h +++ b/src/3rdparty/angle/src/libGLESv2/mathutil.h @@ -9,9 +9,8 @@ #ifndef LIBGLESV2_MATHUTIL_H_ #define LIBGLESV2_MATHUTIL_H_ -#include <intrin.h> -#include <math.h> -#include <windows.h> +#include "common/system.h" +#include "common/debug.h" namespace gl { @@ -54,7 +53,8 @@ inline unsigned int ceilPow2(unsigned int x) template<typename T, typename MIN, typename MAX> inline T clamp(T x, MIN min, MAX max) { - return x < min ? min : (x > max ? max : x); + // Since NaNs fail all comparison tests, a NaN value will default to min + return x > min ? (x > max ? max : x) : min; } inline float clamp01(float x) @@ -142,4 +142,18 @@ float float16ToFloat32(unsigned short h); } +namespace rx +{ + +struct Range +{ + Range() {} + Range(int lo, int hi) : start(lo), end(hi) { ASSERT(lo <= hi); } + + int start; + int end; +}; + +} + #endif // LIBGLESV2_MATHUTIL_H_ |