mirror of
https://github.com/g-truc/glm.git
synced 2024-11-29 11:24:35 +00:00
Fixed GCC build
This commit is contained in:
parent
8a882ffdf1
commit
41c00872a1
@ -54,14 +54,17 @@ namespace glm
|
|||||||
template <typename genType>
|
template <typename genType>
|
||||||
GLM_FUNC_DECL genType abs(genType x);
|
GLM_FUNC_DECL genType abs(genType x);
|
||||||
|
|
||||||
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
|
GLM_FUNC_DECL vecType<T, P> abs(vecType<T, P> const & x);
|
||||||
|
|
||||||
/// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
|
/// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0.
|
||||||
///
|
///
|
||||||
/// @tparam genType Floating-point or signed integer; scalar or vector types.
|
/// @tparam genType Floating-point or signed integer; scalar or vector types.
|
||||||
///
|
///
|
||||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
|
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/sign.xml">GLSL sign man page</a>
|
||||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||||
template <typename genType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_DECL genType sign(genType x);
|
GLM_FUNC_DECL vecType<T, P> sign(vecType<T, P> const & x);
|
||||||
|
|
||||||
/// Returns a value equal to the nearest integer that is less then or equal to x.
|
/// Returns a value equal to the nearest integer that is less then or equal to x.
|
||||||
///
|
///
|
||||||
@ -69,8 +72,8 @@ namespace glm
|
|||||||
///
|
///
|
||||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a>
|
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/floor.xml">GLSL floor man page</a>
|
||||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||||
template <typename genType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_DECL genType floor(genType x);
|
GLM_FUNC_DECL vecType<T, P> floor(vecType<T, P> const & x);
|
||||||
|
|
||||||
/// Returns a value equal to the nearest integer to x
|
/// Returns a value equal to the nearest integer to x
|
||||||
/// whose absolute value is not larger than the absolute value of x.
|
/// whose absolute value is not larger than the absolute value of x.
|
||||||
@ -79,8 +82,8 @@ namespace glm
|
|||||||
///
|
///
|
||||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a>
|
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/trunc.xml">GLSL trunc man page</a>
|
||||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||||
template <typename genType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_DECL genType trunc(genType x);
|
GLM_FUNC_DECL vecType<T, P> trunc(vecType<T, P> const & x);
|
||||||
|
|
||||||
/// Returns a value equal to the nearest integer to x.
|
/// Returns a value equal to the nearest integer to x.
|
||||||
/// The fraction 0.5 will round in a direction chosen by the
|
/// The fraction 0.5 will round in a direction chosen by the
|
||||||
@ -92,8 +95,8 @@ namespace glm
|
|||||||
///
|
///
|
||||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
|
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/round.xml">GLSL round man page</a>
|
||||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||||
template <typename genType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_DECL genType round(genType x);
|
GLM_FUNC_DECL vecType<T, P> round(vecType<T, P> const & x);
|
||||||
|
|
||||||
/// Returns a value equal to the nearest integer to x.
|
/// Returns a value equal to the nearest integer to x.
|
||||||
/// A fractional part of 0.5 will round toward the nearest even
|
/// A fractional part of 0.5 will round toward the nearest even
|
||||||
@ -104,8 +107,8 @@ namespace glm
|
|||||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a>
|
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/roundEven.xml">GLSL roundEven man page</a>
|
||||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||||
/// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a>
|
/// @see <a href="http://developer.amd.com/documentation/articles/pages/New-Round-to-Even-Technique.aspx">New round to even technique</a>
|
||||||
template <typename genType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_DECL genType roundEven(genType x);
|
GLM_FUNC_DECL vecType<T, P> roundEven(vecType<T, P> const & x);
|
||||||
|
|
||||||
/// Returns a value equal to the nearest integer
|
/// Returns a value equal to the nearest integer
|
||||||
/// that is greater than or equal to x.
|
/// that is greater than or equal to x.
|
||||||
@ -114,8 +117,8 @@ namespace glm
|
|||||||
///
|
///
|
||||||
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
|
/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/ceil.xml">GLSL ceil man page</a>
|
||||||
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.3 Common Functions</a>
|
||||||
template <typename genType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_DECL genType ceil(genType x);
|
GLM_FUNC_DECL vecType<T, P> ceil(vecType<T, P> const & x);
|
||||||
|
|
||||||
/// Return x - floor(x).
|
/// Return x - floor(x).
|
||||||
///
|
///
|
||||||
@ -126,6 +129,9 @@ namespace glm
|
|||||||
template <typename genType>
|
template <typename genType>
|
||||||
GLM_FUNC_DECL genType fract(genType x);
|
GLM_FUNC_DECL genType fract(genType x);
|
||||||
|
|
||||||
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
|
GLM_FUNC_DECL vecType<T, P> fract(vecType<T, P> const & x);
|
||||||
|
|
||||||
/// Modulus. Returns x - y * floor(x / y)
|
/// Modulus. Returns x - y * floor(x / y)
|
||||||
/// for each component in x using the floating point value y.
|
/// for each component in x using the floating point value y.
|
||||||
///
|
///
|
||||||
|
@ -177,7 +177,6 @@ namespace detail
|
|||||||
|
|
||||||
// floor
|
// floor
|
||||||
using ::std::floor;
|
using ::std::floor;
|
||||||
|
|
||||||
template <typename T, precision P, template <typename, precision> class vecType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_QUALIFIER vecType<T, P> floor(vecType<T, P> const & x)
|
GLM_FUNC_QUALIFIER vecType<T, P> floor(vecType<T, P> const & x)
|
||||||
{
|
{
|
||||||
@ -273,7 +272,6 @@ namespace detail
|
|||||||
|
|
||||||
// ceil
|
// ceil
|
||||||
using ::std::ceil;
|
using ::std::ceil;
|
||||||
|
|
||||||
template <typename T, precision P, template <typename, precision> class vecType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_QUALIFIER vecType<T, P> ceil(vecType<T, P> const & x)
|
GLM_FUNC_QUALIFIER vecType<T, P> ceil(vecType<T, P> const & x)
|
||||||
{
|
{
|
||||||
|
@ -517,10 +517,9 @@
|
|||||||
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)))
|
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC43)))
|
||||||
|
|
||||||
#define GLM_HAS_TEMPLATE_ALIASES ( \
|
#define GLM_HAS_TEMPLATE_ALIASES ( \
|
||||||
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
|
|
||||||
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12))) || \
|
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && ((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC12))) || \
|
||||||
((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC47)) || \
|
|
||||||
__has_feature(cxx_alias_templates))
|
__has_feature(cxx_alias_templates))
|
||||||
|
//((GLM_LANG & GLM_LANG_CXX0X_FLAG) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC47)) || \
|
||||||
|
|
||||||
#define GLM_HAS_RANGE_FOR ( \
|
#define GLM_HAS_RANGE_FOR ( \
|
||||||
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
|
(GLM_LANG & GLM_LANG_CXX11_FLAG) || \
|
||||||
|
@ -69,7 +69,7 @@ namespace glm
|
|||||||
# endif
|
# endif
|
||||||
{}
|
{}
|
||||||
|
|
||||||
#if (GLM_HAS_UNRESTRICTED_UNIONS || GLM_HAS_ANONYMOUS_UNION) && (GLM_ARCH & GLM_ARCH_SSE2)
|
#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2)
|
||||||
template <>
|
template <>
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4()
|
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4()
|
||||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||||
@ -90,7 +90,7 @@ namespace glm
|
|||||||
: x(v.x), y(v.y), z(v.z), w(v.w)
|
: x(v.x), y(v.y), z(v.z), w(v.w)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
#if (GLM_HAS_UNRESTRICTED_UNIONS || GLM_HAS_ANONYMOUS_UNION) && (GLM_ARCH & GLM_ARCH_SSE2)
|
#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2)
|
||||||
template <>
|
template <>
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(tvec4<float, lowp> const & v)
|
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(tvec4<float, lowp> const & v)
|
||||||
: data(v.data)
|
: data(v.data)
|
||||||
@ -120,7 +120,7 @@ namespace glm
|
|||||||
: x(s), y(s), z(s), w(s)
|
: x(s), y(s), z(s), w(s)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
#if (GLM_HAS_UNRESTRICTED_UNIONS || GLM_HAS_ANONYMOUS_UNION) && (GLM_ARCH & GLM_ARCH_SSE2)
|
#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2)
|
||||||
template <>
|
template <>
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float const & s) :
|
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float const & s) :
|
||||||
data(_mm_set1_ps(s))
|
data(_mm_set1_ps(s))
|
||||||
@ -137,7 +137,7 @@ namespace glm
|
|||||||
: x(a), y(b), z(c), w(d)
|
: x(a), y(b), z(c), w(d)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
#if (GLM_HAS_UNRESTRICTED_UNIONS || GLM_HAS_ANONYMOUS_UNION) && (GLM_ARCH & GLM_ARCH_SSE2)
|
#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2)
|
||||||
template <>
|
template <>
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float const & a, float const & b, float const & c, float const & d) :
|
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(float const & a, float const & b, float const & c, float const & d) :
|
||||||
data(_mm_set_ps(d, c, b, a))
|
data(_mm_set_ps(d, c, b, a))
|
||||||
@ -294,7 +294,7 @@ namespace glm
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (GLM_HAS_UNRESTRICTED_UNIONS || GLM_HAS_ANONYMOUS_UNION) && (GLM_ARCH & GLM_ARCH_SSE2)
|
#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2)
|
||||||
template <>
|
template <>
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator= (tvec4<float, lowp> const & v)
|
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator= (tvec4<float, lowp> const & v)
|
||||||
{
|
{
|
||||||
@ -332,7 +332,7 @@ namespace glm
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (GLM_HAS_UNRESTRICTED_UNIONS || GLM_HAS_ANONYMOUS_UNION) && (GLM_ARCH & GLM_ARCH_SSE2)
|
#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2)
|
||||||
template <>
|
template <>
|
||||||
template <typename U>
|
template <typename U>
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(U s)
|
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(U s)
|
||||||
@ -377,7 +377,7 @@ namespace glm
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if (GLM_HAS_UNRESTRICTED_UNIONS || GLM_HAS_ANONYMOUS_UNION) && (GLM_ARCH & GLM_ARCH_SSE2)
|
#if GLM_HAS_ANONYMOUS_UNION && (GLM_ARCH & GLM_ARCH_SSE2)
|
||||||
template <>
|
template <>
|
||||||
template <typename U>
|
template <typename U>
|
||||||
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(tvec1<U, lowp> const & s)
|
GLM_FUNC_QUALIFIER tvec4<float, lowp> & tvec4<float, lowp>::operator+=(tvec1<U, lowp> const & s)
|
||||||
|
@ -313,7 +313,7 @@ namespace detail
|
|||||||
template <typename T, precision P, template <typename, precision> class vecType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_QUALIFIER vecType<T, P> gaussRand(vecType<T, P> const & Mean, vecType<T, P> const & Deviation)
|
GLM_FUNC_QUALIFIER vecType<T, P> gaussRand(vecType<T, P> const & Mean, vecType<T, P> const & Deviation)
|
||||||
{
|
{
|
||||||
return detail::functor2<T, T, P, vecType>::call(gaussRand, Mean, Deviation);
|
return detail::functor2<T, P, vecType>::call(gaussRand, Mean, Deviation);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -85,7 +85,7 @@ namespace glm
|
|||||||
template <typename T, precision P, template <typename, precision> class vecType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_QUALIFIER vecType<T, P> fastAtan(vecType<T, P> const & y, vecType<T, P> const & x)
|
GLM_FUNC_QUALIFIER vecType<T, P> fastAtan(vecType<T, P> const & y, vecType<T, P> const & x)
|
||||||
{
|
{
|
||||||
return detail::functor2<T, T, P, vecType>::call(fastAtan, y, x);
|
return detail::functor2<T, P, vecType>::call(fastAtan, y, x);
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
|
@ -123,7 +123,7 @@ namespace detail
|
|||||||
template <typename T, precision P, template <typename, precision> class vecType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_QUALIFIER vecType<T, P> higherMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple)
|
GLM_FUNC_QUALIFIER vecType<T, P> higherMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple)
|
||||||
{
|
{
|
||||||
return detail::functor2<T, T, P, vecType>::call(higherMultiple, Source, Multiple);
|
return detail::functor2<T, P, vecType>::call(higherMultiple, Source, Multiple);
|
||||||
}
|
}
|
||||||
|
|
||||||
//////////////////////
|
//////////////////////
|
||||||
@ -138,6 +138,6 @@ namespace detail
|
|||||||
template <typename T, precision P, template <typename, precision> class vecType>
|
template <typename T, precision P, template <typename, precision> class vecType>
|
||||||
GLM_FUNC_QUALIFIER vecType<T, P> lowerMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple)
|
GLM_FUNC_QUALIFIER vecType<T, P> lowerMultiple(vecType<T, P> const & Source, vecType<T, P> const & Multiple)
|
||||||
{
|
{
|
||||||
return detail::functor2<T, T, P, vecType>::call(lowerMultiple, Source, Multiple);
|
return detail::functor2<T, P, vecType>::call(lowerMultiple, Source, Multiple);
|
||||||
}
|
}
|
||||||
}//namespace glm
|
}//namespace glm
|
||||||
|
@ -11,7 +11,7 @@ namespace glm{
|
|||||||
namespace detail{
|
namespace detail{
|
||||||
|
|
||||||
template <int Value>
|
template <int Value>
|
||||||
struct mask
|
struct shuffle_mask
|
||||||
{
|
{
|
||||||
enum{value = Value};
|
enum{value = Value};
|
||||||
};
|
};
|
||||||
@ -166,7 +166,7 @@ GLM_FUNC_QUALIFIER fvec4SIMD fvec4SIMD::swizzle() const
|
|||||||
{
|
{
|
||||||
__m128 Data = _mm_shuffle_ps(
|
__m128 Data = _mm_shuffle_ps(
|
||||||
this->Data, this->Data,
|
this->Data, this->Data,
|
||||||
mask<(W << 6) | (Z << 4) | (Y << 2) | (X << 0)>::value);
|
shuffle_mask<(W << 6) | (Z << 4) | (Y << 2) | (X << 0)>::value);
|
||||||
return fvec4SIMD(Data);
|
return fvec4SIMD(Data);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +175,7 @@ GLM_FUNC_QUALIFIER fvec4SIMD& fvec4SIMD::swizzle()
|
|||||||
{
|
{
|
||||||
this->Data = _mm_shuffle_ps(
|
this->Data = _mm_shuffle_ps(
|
||||||
this->Data, this->Data,
|
this->Data, this->Data,
|
||||||
mask<(W << 6) | (Z << 4) | (Y << 2) | (X << 0)>::value);
|
shuffle_mask<(W << 6) | (Z << 4) | (Y << 2) | (X << 0)>::value);
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,7 +10,9 @@
|
|||||||
#include <glm/gtc/bitfield.hpp>
|
#include <glm/gtc/bitfield.hpp>
|
||||||
#include <glm/gtc/type_precision.hpp>
|
#include <glm/gtc/type_precision.hpp>
|
||||||
#include <glm/vector_relational.hpp>
|
#include <glm/vector_relational.hpp>
|
||||||
//#include <glm/vec2.hpp>
|
#if GLM_ARCH != GLM_ARCH_PURE
|
||||||
|
# include <glm/detail/intrinsic_integer.hpp>
|
||||||
|
#endif
|
||||||
#include <ctime>
|
#include <ctime>
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -10,8 +10,9 @@
|
|||||||
#include <glm/gtc/integer.hpp>
|
#include <glm/gtc/integer.hpp>
|
||||||
#include <glm/gtc/type_precision.hpp>
|
#include <glm/gtc/type_precision.hpp>
|
||||||
#include <glm/gtc/vec1.hpp>
|
#include <glm/gtc/vec1.hpp>
|
||||||
#include <ctime>
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include <ctime>
|
||||||
|
#include <cstdio>
|
||||||
|
|
||||||
namespace isPowerOfTwo
|
namespace isPowerOfTwo
|
||||||
{
|
{
|
||||||
@ -254,8 +255,8 @@ namespace ceilPowerOfTwo
|
|||||||
|
|
||||||
std::clock_t Timestramp2 = std::clock();
|
std::clock_t Timestramp2 = std::clock();
|
||||||
|
|
||||||
printf("ceilPowerOfTwo_loop: %d clocks\n", Timestramp1 - Timestramp0);
|
std::printf("ceilPowerOfTwo_loop: %d clocks\n", static_cast<unsigned int>(Timestramp1 - Timestramp0));
|
||||||
printf("glm::ceilPowerOfTwo: %d clocks\n", Timestramp2 - Timestramp1);
|
std::printf("glm::ceilPowerOfTwo: %d clocks\n", static_cast<unsigned int>(Timestramp2 - Timestramp1));
|
||||||
|
|
||||||
return Error;
|
return Error;
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,42 @@
|
|||||||
|
|
||||||
#include <glm/gtx/multiple.hpp>
|
#include <glm/gtx/multiple.hpp>
|
||||||
|
|
||||||
|
int test_higher_uint()
|
||||||
|
{
|
||||||
|
int Error(0);
|
||||||
|
|
||||||
|
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(0), glm::uvec4(4)), glm::uvec4(0))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(1), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(2), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(3), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(4), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(5), glm::uvec4(4)), glm::uvec4(8))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(6), glm::uvec4(4)), glm::uvec4(8))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(7), glm::uvec4(4)), glm::uvec4(8))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(8), glm::uvec4(4)), glm::uvec4(8))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::higherMultiple(glm::uvec4(9), glm::uvec4(4)), glm::uvec4(12))) ? 0 : 1;
|
||||||
|
|
||||||
|
return Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
int test_Lower_uint()
|
||||||
|
{
|
||||||
|
int Error(0);
|
||||||
|
|
||||||
|
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(0), glm::uvec4(4)), glm::uvec4(0))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(1), glm::uvec4(4)), glm::uvec4(0))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(2), glm::uvec4(4)), glm::uvec4(0))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(3), glm::uvec4(4)), glm::uvec4(0))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(4), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(5), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(6), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(7), glm::uvec4(4)), glm::uvec4(4))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(8), glm::uvec4(4)), glm::uvec4(8))) ? 0 : 1;
|
||||||
|
Error += glm::all(glm::equal(glm::lowerMultiple(glm::uvec4(9), glm::uvec4(4)), glm::uvec4(8))) ? 0 : 1;
|
||||||
|
|
||||||
|
return Error;
|
||||||
|
}
|
||||||
|
|
||||||
int test_higher_int()
|
int test_higher_int()
|
||||||
{
|
{
|
||||||
int Error(0);
|
int Error(0);
|
||||||
@ -108,6 +144,8 @@ int main()
|
|||||||
|
|
||||||
Error += test_higher_int();
|
Error += test_higher_int();
|
||||||
Error += test_Lower_int();
|
Error += test_Lower_int();
|
||||||
|
Error += test_higher_uint();
|
||||||
|
Error += test_Lower_uint();
|
||||||
Error += test_higher_double();
|
Error += test_higher_double();
|
||||||
Error += test_Lower_double();
|
Error += test_Lower_double();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user