mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 17:51:28 +00:00
Oops! (don't attempt a commit when you have to go to the restroom...)
This commit is contained in:
parent
8febc906a5
commit
05e97f4c64
231
common/glm/glm/detail/func_common_simd.inl
Normal file
231
common/glm/glm/detail/func_common_simd.inl
Normal file
@ -0,0 +1,231 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_common_simd.inl
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
#include "../simd/common.h"
|
||||
|
||||
#include <immintrin.h>
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <precision P>
|
||||
struct compute_abs_vector<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_abs(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_abs_vector<int, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<int, P> call(tvec4<int, P> const & v)
|
||||
{
|
||||
tvec4<int, P> result(uninitialize);
|
||||
result.data = glm_ivec4_abs(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_floor<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_floor(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_ceil<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_ceil(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_fract<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_fract(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_round<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_round(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_mod<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & y)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_mod(x.data, y.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_min_vector<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = _mm_min_ps(v1.data, v2.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_min_vector<int32, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
|
||||
{
|
||||
tvec4<int32, P> result(uninitialize);
|
||||
result.data = _mm_min_epi32(v1.data, v2.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_min_vector<uint32, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<uint32, P> const & v1, tvec4<uint32, P> const & v2)
|
||||
{
|
||||
tvec4<uint32, P> result(uninitialize);
|
||||
result.data = _mm_min_epu32(v1.data, v2.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_max_vector<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = _mm_max_ps(v1.data, v2.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_max_vector<int32, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
|
||||
{
|
||||
tvec4<int32, P> result(uninitialize);
|
||||
result.data = _mm_max_epi32(v1.data, v2.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_max_vector<uint32, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & v1, tvec4<uint32, P> const & v2)
|
||||
{
|
||||
tvec4<uint32, P> result(uninitialize);
|
||||
result.data = _mm_max_epu32(v1.data, v2.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_clamp_vector<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & minVal, tvec4<float, P> const & maxVal)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = _mm_min_ps(_mm_max_ps(x.data, minVal.data), maxVal.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_clamp_vector<int32, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<int32, P> call(tvec4<int32, P> const & x, tvec4<int32, P> const & minVal, tvec4<int32, P> const & maxVal)
|
||||
{
|
||||
tvec4<int32, P> result(uninitialize);
|
||||
result.data = _mm_min_epi32(_mm_max_epi32(x.data, minVal.data), maxVal.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_clamp_vector<uint32, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & x, tvec4<uint32, P> const & minVal, tvec4<uint32, P> const & maxVal)
|
||||
{
|
||||
tvec4<uint32, P> result(uninitialize);
|
||||
result.data = _mm_min_epu32(_mm_max_epu32(x.data, minVal.data), maxVal.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_mix_vector<float, bool, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & x, tvec4<float, P> const & y, tvec4<bool, P> const & a)
|
||||
{
|
||||
__m128i const Load = _mm_set_epi32(-(int)a.w, -(int)a.z, -(int)a.y, -(int)a.x);
|
||||
__m128 const Mask = _mm_castsi128_ps(Load);
|
||||
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
# if 0 && GLM_ARCH & GLM_ARCH_AVX
|
||||
Result.data = _mm_blendv_ps(x.data, y.data, Mask);
|
||||
# else
|
||||
Result.data = _mm_or_ps(_mm_and_ps(Mask, y.data), _mm_andnot_ps(Mask, x.data));
|
||||
# endif
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
/* FIXME
|
||||
template <precision P>
|
||||
struct compute_step_vector<float, P, tvec4>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& edge, tvec4<float, P> const& x)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_step(edge.data, x.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
*/
|
||||
template <precision P>
|
||||
struct compute_smoothstep_vector<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& edge0, tvec4<float, P> const& edge1, tvec4<float, P> const& x)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_smoothstep(edge0.data, edge1.data, x.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
35
common/glm/glm/detail/func_exponential_simd.inl
Normal file
35
common/glm/glm/detail/func_exponential_simd.inl
Normal file
@ -0,0 +1,35 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_exponential_simd.inl
|
||||
|
||||
#include "../simd/exponential.h"
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <precision P>
|
||||
struct compute_sqrt<tvec4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = _mm_sqrt_ps(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct compute_sqrt<tvec4, float, aligned_lowp, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, aligned_lowp> call(tvec4<float, aligned_lowp> const & v)
|
||||
{
|
||||
tvec4<float, aligned_lowp> result(uninitialize);
|
||||
result.data = glm_vec4_sqrt_lowp(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
99
common/glm/glm/detail/func_geometric_simd.inl
Normal file
99
common/glm/glm/detail/func_geometric_simd.inl
Normal file
@ -0,0 +1,99 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_geometric_simd.inl
|
||||
|
||||
#include "../simd/geometric.h"
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <precision P>
|
||||
struct compute_length<tvec4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const & v)
|
||||
{
|
||||
return _mm_cvtss_f32(glm_vec4_length(v.data));
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_distance<tvec4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const & p0, tvec4<float, P> const & p1)
|
||||
{
|
||||
return _mm_cvtss_f32(glm_vec4_distance(p0.data, p1.data));
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_dot<tvec4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const& x, tvec4<float, P> const& y)
|
||||
{
|
||||
return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data));
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_cross<float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec3<float, P> call(tvec3<float, P> const & a, tvec3<float, P> const & b)
|
||||
{
|
||||
__m128 const set0 = _mm_set_ps(0.0f, a.z, a.y, a.x);
|
||||
__m128 const set1 = _mm_set_ps(0.0f, b.z, b.y, b.x);
|
||||
__m128 const xpd0 = glm_vec4_cross(set0, set1);
|
||||
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = xpd0;
|
||||
return tvec3<float, P>(result);
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_normalize<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const & v)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_normalize(v.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_faceforward<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& N, tvec4<float, P> const& I, tvec4<float, P> const& Nref)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_faceforward(N.data, I.data, Nref.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_reflect<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& I, tvec4<float, P> const& N)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_reflect(I.data, N.data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_refract<float, P, tvec4, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<float, P> call(tvec4<float, P> const& I, tvec4<float, P> const& N, float eta)
|
||||
{
|
||||
tvec4<float, P> result(uninitialize);
|
||||
result.data = glm_vec4_refract(I.data, N.data, _mm_set1_ps(eta));
|
||||
return result;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
68
common/glm/glm/detail/func_integer_simd.inl
Normal file
68
common/glm/glm/detail/func_integer_simd.inl
Normal file
@ -0,0 +1,68 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_integer_simd.inl
|
||||
|
||||
#include "../simd/integer.h"
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <glm::precision P>
|
||||
struct compute_bitfieldReverseStep<uint32, P, tvec4, true, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & v, uint32 Mask, uint32 Shift)
|
||||
{
|
||||
__m128i const set0 = v.data;
|
||||
|
||||
__m128i const set1 = _mm_set1_epi32(Mask);
|
||||
__m128i const and1 = _mm_and_si128(set0, set1);
|
||||
__m128i const sft1 = _mm_slli_epi32(and1, Shift);
|
||||
|
||||
__m128i const set2 = _mm_andnot_si128(set0, _mm_set1_epi32(-1));
|
||||
__m128i const and2 = _mm_and_si128(set0, set2);
|
||||
__m128i const sft2 = _mm_srai_epi32(and2, Shift);
|
||||
|
||||
__m128i const or0 = _mm_or_si128(sft1, sft2);
|
||||
|
||||
return or0;
|
||||
}
|
||||
};
|
||||
|
||||
template <glm::precision P>
|
||||
struct compute_bitfieldBitCountStep<uint32, P, tvec4, true, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<uint32, P> call(tvec4<uint32, P> const & v, uint32 Mask, uint32 Shift)
|
||||
{
|
||||
__m128i const set0 = v.data;
|
||||
|
||||
__m128i const set1 = _mm_set1_epi32(Mask);
|
||||
__m128i const and0 = _mm_and_si128(set0, set1);
|
||||
__m128i const sft0 = _mm_slli_epi32(set0, Shift);
|
||||
__m128i const and1 = _mm_and_si128(sft0, set1);
|
||||
__m128i const add0 = _mm_add_epi32(and0, and1);
|
||||
|
||||
return add0;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER int bitCount(uint32 x)
|
||||
{
|
||||
return _mm_popcnt_u32(x);
|
||||
}
|
||||
|
||||
# if(GLM_MODEL == GLM_MODEL_64)
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER int bitCount(uint64 x)
|
||||
{
|
||||
return static_cast<int>(_mm_popcnt_u64(x));
|
||||
}
|
||||
# endif//GLM_MODEL
|
||||
# endif//GLM_ARCH
|
||||
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
88
common/glm/glm/detail/func_matrix_simd.inl
Normal file
88
common/glm/glm/detail/func_matrix_simd.inl
Normal file
@ -0,0 +1,88 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_matrix_simd.inl
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
#include "type_mat4x4.hpp"
|
||||
#include "func_geometric.hpp"
|
||||
#include "../simd/matrix.h"
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <precision P>
|
||||
struct compute_matrixCompMult<tmat4x4, float, P, true>
|
||||
{
|
||||
GLM_STATIC_ASSERT(detail::is_aligned<P>::value, "Specialization requires aligned");
|
||||
|
||||
GLM_FUNC_QUALIFIER static tmat4x4<float, P> call(tmat4x4<float, P> const & x, tmat4x4<float, P> const & y)
|
||||
{
|
||||
tmat4x4<float, P> result(uninitialize);
|
||||
glm_mat4_matrixCompMult(
|
||||
*(glm_vec4 const (*)[4])&x[0].data,
|
||||
*(glm_vec4 const (*)[4])&y[0].data,
|
||||
*(glm_vec4(*)[4])&result[0].data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_transpose<tmat4x4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat4x4<float, P> call(tmat4x4<float, P> const & m)
|
||||
{
|
||||
tmat4x4<float, P> result(uninitialize);
|
||||
glm_mat4_transpose(
|
||||
*(glm_vec4 const (*)[4])&m[0].data,
|
||||
*(glm_vec4(*)[4])&result[0].data);
|
||||
return result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_determinant<tmat4x4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static float call(tmat4x4<float, P> const& m)
|
||||
{
|
||||
return _mm_cvtss_f32(glm_mat4_determinant(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data)));
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_inverse<tmat4x4, float, P, true>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tmat4x4<float, P> call(tmat4x4<float, P> const& m)
|
||||
{
|
||||
tmat4x4<float, P> Result(uninitialize);
|
||||
glm_mat4_inverse(*reinterpret_cast<__m128 const(*)[4]>(&m[0].data), *reinterpret_cast<__m128(*)[4]>(&Result[0].data));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_lowp> outerProduct<float, aligned_lowp, tvec4, tvec4>(tvec4<float, aligned_lowp> const & c, tvec4<float, aligned_lowp> const & r)
|
||||
{
|
||||
tmat4x4<float, aligned_lowp> m(uninitialize);
|
||||
glm_mat4_outerProduct(c.data, r.data, *reinterpret_cast<__m128(*)[4]>(&m[0].data));
|
||||
return m;
|
||||
}
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_mediump> outerProduct<float, aligned_mediump, tvec4, tvec4>(tvec4<float, aligned_mediump> const & c, tvec4<float, aligned_mediump> const & r)
|
||||
{
|
||||
tmat4x4<float, aligned_mediump> m(uninitialize);
|
||||
glm_mat4_outerProduct(c.data, r.data, *reinterpret_cast<__m128(*)[4]>(&m[0].data));
|
||||
return m;
|
||||
}
|
||||
|
||||
template<>
|
||||
GLM_FUNC_QUALIFIER tmat4x4<float, aligned_highp> outerProduct<float, aligned_highp, tvec4, tvec4>(tvec4<float, aligned_highp> const & c, tvec4<float, aligned_highp> const & r)
|
||||
{
|
||||
tmat4x4<float, aligned_highp> m(uninitialize);
|
||||
glm_mat4_outerProduct(c.data, r.data, *reinterpret_cast<__m128(*)[4]>(&m[0].data));
|
||||
return m;
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
#endif
|
||||
9
common/glm/glm/detail/func_packing_simd.inl
Normal file
9
common/glm/glm/detail/func_packing_simd.inl
Normal file
@ -0,0 +1,9 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_packing_simd.inl
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
0
common/glm/glm/detail/func_trigonometric_simd.inl
Normal file
0
common/glm/glm/detail/func_trigonometric_simd.inl
Normal file
9
common/glm/glm/detail/func_vector_relational_simd.inl
Normal file
9
common/glm/glm/detail/func_vector_relational_simd.inl
Normal file
@ -0,0 +1,9 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/func_vector_relational_simd.inl
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
7
common/glm/glm/detail/type_mat4x4_simd.inl
Normal file
7
common/glm/glm/detail/type_mat4x4_simd.inl
Normal file
@ -0,0 +1,7 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/type_mat4x4_sse2.inl
|
||||
|
||||
namespace glm
|
||||
{
|
||||
|
||||
}//namespace glm
|
||||
481
common/glm/glm/detail/type_vec4_simd.inl
Normal file
481
common/glm/glm/detail/type_vec4_simd.inl
Normal file
@ -0,0 +1,481 @@
|
||||
/// @ref core
|
||||
/// @file glm/detail/type_tvec4_simd.inl
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
# if GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
template <precision P, int E0, int E1, int E2, int E3>
|
||||
struct _swizzle_base1<4, float, P, glm::tvec4, E0,E1,E2,E3, true> : public _swizzle_base0<float, 4>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER tvec4<float, P> operator ()() const
|
||||
{
|
||||
__m128 data = *reinterpret_cast<__m128 const*>(&this->_buffer);
|
||||
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
Result.data = _mm_permute_ps(data, _MM_SHUFFLE(E3, E2, E1, E0));
|
||||
# else
|
||||
Result.data = _mm_shuffle_ps(data, data, _MM_SHUFFLE(E3, E2, E1, E0));
|
||||
# endif
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P, int E0, int E1, int E2, int E3>
|
||||
struct _swizzle_base1<4, int32, P, glm::tvec4, E0,E1,E2,E3, true> : public _swizzle_base0<int32, 4>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER tvec4<int32, P> operator ()() const
|
||||
{
|
||||
__m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer);
|
||||
|
||||
tvec4<int32, P> Result(uninitialize);
|
||||
Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P, int E0, int E1, int E2, int E3>
|
||||
struct _swizzle_base1<4, uint32, P, glm::tvec4, E0,E1,E2,E3, true> : public _swizzle_base0<uint32, 4>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER tvec4<uint32, P> operator ()() const
|
||||
{
|
||||
__m128i data = *reinterpret_cast<__m128i const*>(&this->_buffer);
|
||||
|
||||
tvec4<uint32, P> Result(uninitialize);
|
||||
Result.data = _mm_shuffle_epi32(data, _MM_SHUFFLE(E3, E2, E1, E0));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif// GLM_SWIZZLE == GLM_SWIZZLE_ENABLED
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_add<float, P, true>
|
||||
{
|
||||
static tvec4<float, P> call(tvec4<float, P> const & a, tvec4<float, P> const & b)
|
||||
{
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
Result.data = _mm_add_ps(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <precision P>
|
||||
struct compute_vec4_add<double, P, true>
|
||||
{
|
||||
static tvec4<double, P> call(tvec4<double, P> const & a, tvec4<double, P> const & b)
|
||||
{
|
||||
tvec4<double, P> Result(uninitialize);
|
||||
Result.data = _mm256_add_pd(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_sub<float, P, true>
|
||||
{
|
||||
static tvec4<float, P> call(tvec4<float, P> const & a, tvec4<float, P> const & b)
|
||||
{
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
Result.data = _mm_sub_ps(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <precision P>
|
||||
struct compute_vec4_sub<double, P, true>
|
||||
{
|
||||
static tvec4<double, P> call(tvec4<double, P> const & a, tvec4<double, P> const & b)
|
||||
{
|
||||
tvec4<double, P> Result(uninitialize);
|
||||
Result.data = _mm256_sub_pd(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_mul<float, P, true>
|
||||
{
|
||||
static tvec4<float, P> call(tvec4<float, P> const & a, tvec4<float, P> const & b)
|
||||
{
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
Result.data = _mm_mul_ps(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <precision P>
|
||||
struct compute_vec4_mul<double, P, true>
|
||||
{
|
||||
static tvec4<double, P> call(tvec4<double, P> const & a, tvec4<double, P> const & b)
|
||||
{
|
||||
tvec4<double, P> Result(uninitialize);
|
||||
Result.data = _mm256_mul_pd(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_div<float, P, true>
|
||||
{
|
||||
static tvec4<float, P> call(tvec4<float, P> const & a, tvec4<float, P> const & b)
|
||||
{
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
Result.data = _mm_div_ps(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <precision P>
|
||||
struct compute_vec4_div<double, P, true>
|
||||
{
|
||||
static tvec4<double, P> call(tvec4<double, P> const & a, tvec4<double, P> const & b)
|
||||
{
|
||||
tvec4<double, P> Result(uninitialize);
|
||||
Result.data = _mm256_div_pd(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <>
|
||||
struct compute_vec4_div<float, aligned_lowp, true>
|
||||
{
|
||||
static tvec4<float, aligned_lowp> call(tvec4<float, aligned_lowp> const & a, tvec4<float, aligned_lowp> const & b)
|
||||
{
|
||||
tvec4<float, aligned_lowp> Result(uninitialize);
|
||||
Result.data = _mm_mul_ps(a.data, _mm_rcp_ps(b.data));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_and<T, P, true, 32, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm_and_si128(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_and<T, P, true, 64, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm256_and_si256(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_or<T, P, true, 32, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm_or_si128(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_or<T, P, true, 64, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm256_or_si256(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_xor<T, P, true, 32, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm_xor_si128(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_xor<T, P, true, 64, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm256_xor_si256(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_shift_left<T, P, true, 32, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm_sll_epi32(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_shift_left<T, P, true, 64, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm256_sll_epi64(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_shift_right<T, P, true, 32, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm_srl_epi32(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_shift_right<T, P, true, 64, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const& a, tvec4<T, P> const& b)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm256_srl_epi64(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_bitwise_not<T, P, true, 32, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const & v)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm_xor_si128(v.data, _mm_set1_epi32(-1));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <typename T, precision P>
|
||||
struct compute_vec4_bitwise_not<T, P, true, 64, true>
|
||||
{
|
||||
static tvec4<T, P> call(tvec4<T, P> const & v)
|
||||
{
|
||||
tvec4<T, P> Result(uninitialize);
|
||||
Result.data = _mm256_xor_si256(v.data, _mm_set1_epi32(-1));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_equal<float, P, false, 32, true>
|
||||
{
|
||||
static bool call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
|
||||
{
|
||||
return _mm_movemask_ps(_mm_cmpeq_ps(v1.data, v2.data)) != 0;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_equal<int32, P, true, 32, true>
|
||||
{
|
||||
static bool call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
|
||||
{
|
||||
return _mm_movemask_epi8(_mm_cmpeq_epi32(v1.data, v2.data)) != 0;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_nequal<float, P, false, 32, true>
|
||||
{
|
||||
static bool call(tvec4<float, P> const & v1, tvec4<float, P> const & v2)
|
||||
{
|
||||
return _mm_movemask_ps(_mm_cmpneq_ps(v1.data, v2.data)) != 0;
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_nequal<int32, P, true, 32, true>
|
||||
{
|
||||
static bool call(tvec4<int32, P> const & v1, tvec4<int32, P> const & v2)
|
||||
{
|
||||
return _mm_movemask_epi8(_mm_cmpneq_epi32(v1.data, v2.data)) != 0;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
# if !GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec4()
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
: data(_mm_setzero_ps())
|
||||
# endif
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec4()
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
: data(_mm_setzero_ps())
|
||||
# endif
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec4()
|
||||
# ifndef GLM_FORCE_NO_CTOR_INIT
|
||||
: data(_mm_setzero_ps())
|
||||
# endif
|
||||
{}
|
||||
# endif//!GLM_HAS_DEFAULTED_FUNCTIONS
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec4(float s) :
|
||||
data(_mm_set1_ps(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec4(float s) :
|
||||
data(_mm_set1_ps(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec4(float s) :
|
||||
data(_mm_set1_ps(s))
|
||||
{}
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_lowp>::tvec4(double s) :
|
||||
data(_mm256_set1_pd(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_mediump>::tvec4(double s) :
|
||||
data(_mm256_set1_pd(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<double, aligned_highp>::tvec4(double s) :
|
||||
data(_mm256_set1_pd(s))
|
||||
{}
|
||||
# endif
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_lowp>::tvec4(int32 s) :
|
||||
data(_mm_set1_epi32(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_mediump>::tvec4(int32 s) :
|
||||
data(_mm_set1_epi32(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_highp>::tvec4(int32 s) :
|
||||
data(_mm_set1_epi32(s))
|
||||
{}
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_lowp>::tvec4(int64 s) :
|
||||
data(_mm256_set1_epi64x(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_mediump>::tvec4(int64 s) :
|
||||
data(_mm256_set1_epi64x(s))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int64, aligned_highp>::tvec4(int64 s) :
|
||||
data(_mm256_set1_epi64x(s))
|
||||
{}
|
||||
# endif
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec4(float a, float b, float c, float d) :
|
||||
data(_mm_set_ps(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec4(float a, float b, float c, float d) :
|
||||
data(_mm_set_ps(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec4(float a, float b, float c, float d) :
|
||||
data(_mm_set_ps(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_lowp>::tvec4(int32 a, int32 b, int32 c, int32 d) :
|
||||
data(_mm_set_epi32(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_mediump>::tvec4(int32 a, int32 b, int32 c, int32 d) :
|
||||
data(_mm_set_epi32(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<int32, aligned_highp>::tvec4(int32 a, int32 b, int32 c, int32 d) :
|
||||
data(_mm_set_epi32(d, c, b, a))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_lowp>::tvec4(int32 a, int32 b, int32 c, int32 d) :
|
||||
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_mediump>::tvec4(int32 a, int32 b, int32 c, int32 d) :
|
||||
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <>
|
||||
GLM_FUNC_QUALIFIER GLM_CONSTEXPR_SIMD tvec4<float, aligned_highp>::tvec4(int32 a, int32 b, int32 c, int32 d) :
|
||||
data(_mm_castsi128_ps(_mm_set_epi32(d, c, b, a)))
|
||||
{}
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
65
common/glm/glm/gtc/color_encoding.inl
Normal file
65
common/glm/glm/gtc/color_encoding.inl
Normal file
@ -0,0 +1,65 @@
|
||||
/// @ref gtc_color_encoding
|
||||
/// @file glm/gtc/color_encoding.inl
|
||||
|
||||
namespace glm
|
||||
{
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> convertLinearSRGBToD65XYZ(tvec3<T, P> const& ColorLinearSRGB)
|
||||
{
|
||||
tvec3<T, P> const M(0.490f, 0.17697f, 0.2f);
|
||||
tvec3<T, P> const N(0.31f, 0.8124f, 0.01063f);
|
||||
tvec3<T, P> const O(0.490f, 0.01f, 0.99f);
|
||||
|
||||
return (M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB) * static_cast<T>(5.650675255693055f);
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> convertD65XYZToLinearSRGB(tvec3<T, P> const& ColorD65XYZ)
|
||||
{
|
||||
tvec3<T, P> const M(0.41847f, -0.091169f, 0.0009209f);
|
||||
tvec3<T, P> const N(-0.15866f, 0.25243f, 0.015708f);
|
||||
tvec3<T, P> const O(0.0009209f, -0.0025498f, 0.1786f);
|
||||
|
||||
return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> convertLinearSRGBToD50XYZ(tvec3<T, P> const& ColorLinearSRGB)
|
||||
{
|
||||
tvec3<T, P> const M(0.436030342570117f, 0.222438466210245f, 0.013897440074263f);
|
||||
tvec3<T, P> const N(0.385101860087134f, 0.716942745571917f, 0.097076381494207f);
|
||||
tvec3<T, P> const O(0.143067806654203f, 0.060618777416563f, 0.713926257896652f);
|
||||
|
||||
return M * ColorLinearSRGB + N * ColorLinearSRGB + O * ColorLinearSRGB;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> convertD50XYZToLinearSRGB(tvec3<T, P> const& ColorD50XYZ)
|
||||
{
|
||||
tvec3<T, P> const M();
|
||||
tvec3<T, P> const N();
|
||||
tvec3<T, P> const O();
|
||||
|
||||
return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> convertD65XYZToD50XYZ(tvec3<T, P> const& ColorD65XYZ)
|
||||
{
|
||||
tvec3<T, P> const M(+1.047844353856414f, +0.029549007606644f, -0.009250984365223f);
|
||||
tvec3<T, P> const N(+0.022898981050086f, +0.990508028941971f, +0.015072338237051f);
|
||||
tvec3<T, P> const O(-0.050206647741605f, -0.017074711360960f, +0.751717835079977f);
|
||||
|
||||
return M * ColorD65XYZ + N * ColorD65XYZ + O * ColorD65XYZ;
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER tvec3<T, P> convertD50XYZToD65XYZ(tvec3<T, P> const& ColorD50XYZ)
|
||||
{
|
||||
tvec3<T, P> const M();
|
||||
tvec3<T, P> const N();
|
||||
tvec3<T, P> const O();
|
||||
|
||||
return M * ColorD50XYZ + N * ColorD50XYZ + O * ColorD50XYZ;
|
||||
}
|
||||
}//namespace glm
|
||||
56
common/glm/glm/gtc/color_space.hpp
Normal file
56
common/glm/glm/gtc/color_space.hpp
Normal file
@ -0,0 +1,56 @@
|
||||
/// @ref gtc_color_space
|
||||
/// @file glm/gtc/color_space.hpp
|
||||
///
|
||||
/// @see core (dependence)
|
||||
/// @see gtc_color_space (dependence)
|
||||
///
|
||||
/// @defgroup gtc_color_space GLM_GTC_color_space
|
||||
/// @ingroup gtc
|
||||
///
|
||||
/// @brief Allow to perform bit operations on integer values
|
||||
///
|
||||
/// <glm/gtc/color.hpp> need to be included to use these functionalities.
|
||||
|
||||
#pragma once
|
||||
|
||||
// Dependencies
|
||||
#include "../detail/setup.hpp"
|
||||
#include "../detail/precision.hpp"
|
||||
#include "../exponential.hpp"
|
||||
#include "../vec3.hpp"
|
||||
#include "../vec4.hpp"
|
||||
#include <limits>
|
||||
|
||||
#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
|
||||
# pragma message("GLM: GLM_GTC_color_space extension included")
|
||||
#endif
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup gtc_color_space
|
||||
/// @{
|
||||
|
||||
/// Convert a linear color to sRGB color using a standard gamma correction.
|
||||
/// IEC 61966-2-1:1999 specification https://www.w3.org/Graphics/Color/srgb
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<T, P> convertLinearToSRGB(vecType<T, P> const & ColorLinear);
|
||||
|
||||
/// Convert a linear color to sRGB color using a custom gamma correction.
|
||||
/// IEC 61966-2-1:1999 specification https://www.w3.org/Graphics/Color/srgb
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<T, P> convertLinearToSRGB(vecType<T, P> const & ColorLinear, T Gamma);
|
||||
|
||||
/// Convert a sRGB color to linear color using a standard gamma correction.
|
||||
/// IEC 61966-2-1:1999 specification https://www.w3.org/Graphics/Color/srgb
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<T, P> convertSRGBToLinear(vecType<T, P> const & ColorSRGB);
|
||||
|
||||
/// Convert a sRGB color to linear color using a custom gamma correction.
|
||||
// IEC 61966-2-1:1999 specification https://www.w3.org/Graphics/Color/srgb
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_DECL vecType<T, P> convertSRGBToLinear(vecType<T, P> const & ColorSRGB, T Gamma);
|
||||
|
||||
/// @}
|
||||
} //namespace glm
|
||||
|
||||
#include "color_space.inl"
|
||||
75
common/glm/glm/gtc/color_space.inl
Normal file
75
common/glm/glm/gtc/color_space.inl
Normal file
@ -0,0 +1,75 @@
|
||||
/// @ref gtc_color_space
|
||||
/// @file glm/gtc/color_space.inl
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
struct compute_rgbToSrgb
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const& ColorRGB, T GammaCorrection)
|
||||
{
|
||||
vecType<T, P> const ClampedColor(clamp(ColorRGB, static_cast<T>(0), static_cast<T>(1)));
|
||||
|
||||
return mix(
|
||||
pow(ClampedColor, vecType<T, P>(GammaCorrection)) * static_cast<T>(1.055) - static_cast<T>(0.055),
|
||||
ClampedColor * static_cast<T>(12.92),
|
||||
lessThan(ClampedColor, vecType<T, P>(static_cast<T>(0.0031308))));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_rgbToSrgb<T, P, tvec4>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<T, P> call(tvec4<T, P> const& ColorRGB, T GammaCorrection)
|
||||
{
|
||||
return tvec4<T, P>(compute_rgbToSrgb<T, P, tvec3>::call(tvec3<T, P>(ColorRGB), GammaCorrection), ColorRGB.w);
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
struct compute_srgbToRgb
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static vecType<T, P> call(vecType<T, P> const& ColorSRGB, T Gamma)
|
||||
{
|
||||
return mix(
|
||||
pow((ColorSRGB + static_cast<T>(0.055)) * static_cast<T>(0.94786729857819905213270142180095), vecType<T, P>(Gamma)),
|
||||
ColorSRGB * static_cast<T>(0.07739938080495356037151702786378),
|
||||
lessThanEqual(ColorSRGB, vecType<T, P>(static_cast<T>(0.04045))));
|
||||
}
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct compute_srgbToRgb<T, P, tvec4>
|
||||
{
|
||||
GLM_FUNC_QUALIFIER static tvec4<T, P> call(tvec4<T, P> const& ColorSRGB, T Gamma)
|
||||
{
|
||||
return tvec4<T, P>(compute_srgbToRgb<T, P, tvec3>::call(tvec3<T, P>(ColorSRGB), Gamma), ColorSRGB.w);
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> convertLinearToSRGB(vecType<T, P> const& ColorLinear)
|
||||
{
|
||||
return detail::compute_rgbToSrgb<T, P, vecType>::call(ColorLinear, static_cast<T>(0.41666));
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> convertLinearToSRGB(vecType<T, P> const& ColorLinear, T Gamma)
|
||||
{
|
||||
return detail::compute_rgbToSrgb<T, P, vecType>::call(ColorLinear, static_cast<T>(1) / Gamma);
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> convertSRGBToLinear(vecType<T, P> const& ColorSRGB)
|
||||
{
|
||||
return detail::compute_srgbToRgb<T, P, vecType>::call(ColorSRGB, static_cast<T>(2.4));
|
||||
}
|
||||
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<T, P> convertSRGBToLinear(vecType<T, P> const& ColorSRGB, T Gamma)
|
||||
{
|
||||
return detail::compute_srgbToRgb<T, P, vecType>::call(ColorSRGB, Gamma);
|
||||
}
|
||||
}//namespace glm
|
||||
53
common/glm/glm/gtc/functions.hpp
Normal file
53
common/glm/glm/gtc/functions.hpp
Normal file
@ -0,0 +1,53 @@
|
||||
/// @ref gtc_functions
|
||||
/// @file glm/gtc/functions.hpp
|
||||
///
|
||||
/// @see core (dependence)
|
||||
/// @see gtc_half_float (dependence)
|
||||
/// @see gtc_quaternion (dependence)
|
||||
///
|
||||
/// @defgroup gtc_functions GLM_GTC_functions
|
||||
/// @ingroup gtc
|
||||
///
|
||||
/// @brief List of useful common functions.
|
||||
///
|
||||
/// <glm/gtc/functions.hpp> need to be included to use these functionalities.
|
||||
|
||||
#pragma once
|
||||
|
||||
// Dependencies
|
||||
#include "../detail/setup.hpp"
|
||||
#include "../detail/precision.hpp"
|
||||
#include "../detail/type_vec2.hpp"
|
||||
|
||||
#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
|
||||
# pragma message("GLM: GLM_GTC_functions extension included")
|
||||
#endif
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup gtc_functions
|
||||
/// @{
|
||||
|
||||
/// 1D gauss function
|
||||
///
|
||||
/// @see gtc_epsilon
|
||||
template <typename T>
|
||||
GLM_FUNC_DECL T gauss(
|
||||
T x,
|
||||
T ExpectedValue,
|
||||
T StandardDeviation);
|
||||
|
||||
/// 2D gauss function
|
||||
///
|
||||
/// @see gtc_epsilon
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_DECL T gauss(
|
||||
tvec2<T, P> const& Coord,
|
||||
tvec2<T, P> const& ExpectedValue,
|
||||
tvec2<T, P> const& StandardDeviation);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "functions.inl"
|
||||
|
||||
31
common/glm/glm/gtc/functions.inl
Normal file
31
common/glm/glm/gtc/functions.inl
Normal file
@ -0,0 +1,31 @@
|
||||
/// @ref gtc_functions
|
||||
/// @file glm/gtc/functions.inl
|
||||
|
||||
#include "../detail/func_exponential.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER T gauss
|
||||
(
|
||||
T x,
|
||||
T ExpectedValue,
|
||||
T StandardDeviation
|
||||
)
|
||||
{
|
||||
return exp(-((x - ExpectedValue) * (x - ExpectedValue)) / (static_cast<T>(2) * StandardDeviation * StandardDeviation)) / (StandardDeviation * sqrt(static_cast<T>(6.28318530717958647692528676655900576)));
|
||||
}
|
||||
|
||||
template <typename T, precision P>
|
||||
GLM_FUNC_QUALIFIER T gauss
|
||||
(
|
||||
tvec2<T, P> const& Coord,
|
||||
tvec2<T, P> const& ExpectedValue,
|
||||
tvec2<T, P> const& StandardDeviation
|
||||
)
|
||||
{
|
||||
tvec2<T, P> const Squared = ((Coord - ExpectedValue) * (Coord - ExpectedValue)) / (static_cast<T>(2) * StandardDeviation * StandardDeviation);
|
||||
return exp(-(Squared.x + Squared.y));
|
||||
}
|
||||
}//namespace glm
|
||||
|
||||
198
common/glm/glm/gtc/quaternion_simd.inl
Normal file
198
common/glm/glm/gtc/quaternion_simd.inl
Normal file
@ -0,0 +1,198 @@
|
||||
/// @ref core
|
||||
/// @file glm/gtc/quaternion_simd.inl
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
namespace glm{
|
||||
namespace detail
|
||||
{
|
||||
/*
|
||||
template <precision P>
|
||||
struct compute_quat_mul<float, P, true>
|
||||
{
|
||||
static tquat<float, P> call(tquat<float, P> const& q1, tquat<float, P> const& q2)
|
||||
{
|
||||
// SSE2 STATS: 11 shuffle, 8 mul, 8 add
|
||||
// SSE4 STATS: 3 shuffle, 4 mul, 4 dpps
|
||||
|
||||
__m128 const mul0 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(0, 1, 2, 3)));
|
||||
__m128 const mul1 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(1, 0, 3, 2)));
|
||||
__m128 const mul2 = _mm_mul_ps(q1.Data, _mm_shuffle_ps(q2.Data, q2.Data, _MM_SHUFFLE(2, 3, 0, 1)));
|
||||
__m128 const mul3 = _mm_mul_ps(q1.Data, q2.Data);
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_SSE41_BIT
|
||||
__m128 const add0 = _mm_dp_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f), 0xff);
|
||||
__m128 const add1 = _mm_dp_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f), 0xff);
|
||||
__m128 const add2 = _mm_dp_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f), 0xff);
|
||||
__m128 const add3 = _mm_dp_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f), 0xff);
|
||||
# else
|
||||
__m128 const mul4 = _mm_mul_ps(mul0, _mm_set_ps(1.0f, -1.0f, 1.0f, 1.0f));
|
||||
__m128 const add0 = _mm_add_ps(mul0, _mm_movehl_ps(mul4, mul4));
|
||||
__m128 const add4 = _mm_add_ss(add0, _mm_shuffle_ps(add0, add0, 1));
|
||||
|
||||
__m128 const mul5 = _mm_mul_ps(mul1, _mm_set_ps(1.0f, 1.0f, 1.0f, -1.0f));
|
||||
__m128 const add1 = _mm_add_ps(mul1, _mm_movehl_ps(mul5, mul5));
|
||||
__m128 const add5 = _mm_add_ss(add1, _mm_shuffle_ps(add1, add1, 1));
|
||||
|
||||
__m128 const mul6 = _mm_mul_ps(mul2, _mm_set_ps(1.0f, 1.0f, -1.0f, 1.0f));
|
||||
__m128 const add2 = _mm_add_ps(mul6, _mm_movehl_ps(mul6, mul6));
|
||||
__m128 const add6 = _mm_add_ss(add2, _mm_shuffle_ps(add2, add2, 1));
|
||||
|
||||
__m128 const mul7 = _mm_mul_ps(mul3, _mm_set_ps(1.0f, -1.0f, -1.0f, -1.0f));
|
||||
__m128 const add3 = _mm_add_ps(mul3, _mm_movehl_ps(mul7, mul7));
|
||||
__m128 const add7 = _mm_add_ss(add3, _mm_shuffle_ps(add3, add3, 1));
|
||||
#endif
|
||||
|
||||
// This SIMD code is a politically correct way of doing this, but in every test I've tried it has been slower than
|
||||
// the final code below. I'll keep this here for reference - maybe somebody else can do something better...
|
||||
//
|
||||
//__m128 xxyy = _mm_shuffle_ps(add4, add5, _MM_SHUFFLE(0, 0, 0, 0));
|
||||
//__m128 zzww = _mm_shuffle_ps(add6, add7, _MM_SHUFFLE(0, 0, 0, 0));
|
||||
//
|
||||
//return _mm_shuffle_ps(xxyy, zzww, _MM_SHUFFLE(2, 0, 2, 0));
|
||||
|
||||
tquat<float, P> Result(uninitialize);
|
||||
_mm_store_ss(&Result.x, add4);
|
||||
_mm_store_ss(&Result.y, add5);
|
||||
_mm_store_ss(&Result.z, add6);
|
||||
_mm_store_ss(&Result.w, add7);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
*/
|
||||
|
||||
template <precision P>
|
||||
struct compute_dot<tquat, float, P, true>
|
||||
{
|
||||
static GLM_FUNC_QUALIFIER float call(tquat<float, P> const& x, tquat<float, P> const& y)
|
||||
{
|
||||
return _mm_cvtss_f32(glm_vec1_dot(x.data, y.data));
|
||||
}
|
||||
};
|
||||
|
||||
template <precision P>
|
||||
struct compute_quat_add<float, P, true>
|
||||
{
|
||||
static tquat<float, P> call(tquat<float, P> const& q, tquat<float, P> const& p)
|
||||
{
|
||||
tquat<float, P> Result(uninitialize);
|
||||
Result.data = _mm_add_ps(q.data, p.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <precision P>
|
||||
struct compute_quat_add<double, P, true>
|
||||
{
|
||||
static tquat<double, P> call(tquat<double, P> const & a, tquat<double, P> const & b)
|
||||
{
|
||||
tquat<double, P> Result(uninitialize);
|
||||
Result.data = _mm256_add_pd(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <precision P>
|
||||
struct compute_quat_sub<float, P, true>
|
||||
{
|
||||
static tquat<float, P> call(tquat<float, P> const& q, tquat<float, P> const& p)
|
||||
{
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
Result.data = _mm_sub_ps(q.data, p.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <precision P>
|
||||
struct compute_quat_sub<double, P, true>
|
||||
{
|
||||
static tquat<double, P> call(tquat<double, P> const & a, tquat<double, P> const & b)
|
||||
{
|
||||
tquat<double, P> Result(uninitialize);
|
||||
Result.data = _mm256_sub_pd(a.data, b.data);
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <precision P>
|
||||
struct compute_quat_mul_scalar<float, P, true>
|
||||
{
|
||||
static tquat<float, P> call(tquat<float, P> const& q, float s)
|
||||
{
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
Result.data = _mm_mul_ps(q.data, _mm_set_ps1(s));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <precision P>
|
||||
struct compute_quat_mul_scalar<double, P, true>
|
||||
{
|
||||
static tquat<double, P> call(tquat<double, P> const& q, double s)
|
||||
{
|
||||
tquat<double, P> Result(uninitialize);
|
||||
Result.data = _mm256_mul_pd(q.data, _mm_set_ps1(s));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <precision P>
|
||||
struct compute_quat_div_scalar<float, P, true>
|
||||
{
|
||||
static tquat<float, P> call(tquat<float, P> const& q, float s)
|
||||
{
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
Result.data = _mm_div_ps(q.data, _mm_set_ps1(s));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
template <precision P>
|
||||
struct compute_quat_div_scalar<double, P, true>
|
||||
{
|
||||
static tquat<double, P> call(tquat<double, P> const& q, double s)
|
||||
{
|
||||
tquat<double, P> Result(uninitialize);
|
||||
Result.data = _mm256_div_pd(q.data, _mm_set_ps1(s));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
|
||||
template <precision P>
|
||||
struct compute_quat_mul_vec4<float, P, true>
|
||||
{
|
||||
static tvec4<float, P> call(tquat<float, P> const& q, tvec4<float, P> const& v)
|
||||
{
|
||||
__m128 const q_wwww = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 3, 3, 3));
|
||||
__m128 const q_swp0 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 0, 2, 1));
|
||||
__m128 const q_swp1 = _mm_shuffle_ps(q.data, q.data, _MM_SHUFFLE(3, 1, 0, 2));
|
||||
__m128 const v_swp0 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 0, 2, 1));
|
||||
__m128 const v_swp1 = _mm_shuffle_ps(v.data, v.data, _MM_SHUFFLE(3, 1, 0, 2));
|
||||
|
||||
__m128 uv = _mm_sub_ps(_mm_mul_ps(q_swp0, v_swp1), _mm_mul_ps(q_swp1, v_swp0));
|
||||
__m128 uv_swp0 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 0, 2, 1));
|
||||
__m128 uv_swp1 = _mm_shuffle_ps(uv, uv, _MM_SHUFFLE(3, 1, 0, 2));
|
||||
__m128 uuv = _mm_sub_ps(_mm_mul_ps(q_swp0, uv_swp1), _mm_mul_ps(q_swp1, uv_swp0));
|
||||
|
||||
__m128 const two = _mm_set1_ps(2.0f);
|
||||
uv = _mm_mul_ps(uv, _mm_mul_ps(q_wwww, two));
|
||||
uuv = _mm_mul_ps(uuv, two);
|
||||
|
||||
tvec4<float, P> Result(uninitialize);
|
||||
Result.data = _mm_add_ps(v.Data, _mm_add_ps(uv, uuv));
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
}//namespace detail
|
||||
}//namespace glm
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
362
common/glm/glm/gtc/type_aligned.hpp
Normal file
362
common/glm/glm/gtc/type_aligned.hpp
Normal file
@ -0,0 +1,362 @@
|
||||
/// @ref gtc_type_aligned
|
||||
/// @file glm/gtc/type_aligned.hpp
|
||||
///
|
||||
/// @see core (dependence)
|
||||
///
|
||||
/// @defgroup gtc_type_aligned GLM_GTC_type_aligned
|
||||
/// @ingroup gtc
|
||||
///
|
||||
/// @brief Aligned types.
|
||||
/// <glm/gtc/type_aligned.hpp> need to be included to use these features.
|
||||
|
||||
#pragma once
|
||||
|
||||
#if !GLM_HAS_ALIGNED_TYPE
|
||||
# error "GLM: Aligned types are not supported on this platform"
|
||||
#endif
|
||||
#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
|
||||
# pragma message("GLM: GLM_GTC_type_aligned extension included")
|
||||
#endif
|
||||
|
||||
#include "../vec2.hpp"
|
||||
#include "../vec3.hpp"
|
||||
#include "../vec4.hpp"
|
||||
#include "../gtc/vec1.hpp"
|
||||
|
||||
namespace glm
|
||||
{
|
||||
template <typename T, precision P> struct tvec1;
|
||||
template <typename T, precision P> struct tvec2;
|
||||
template <typename T, precision P> struct tvec3;
|
||||
template <typename T, precision P> struct tvec4;
|
||||
/// @addtogroup gtc_type_aligned
|
||||
/// @{
|
||||
|
||||
// -- *vec1 --
|
||||
|
||||
typedef tvec1<float, aligned_highp> aligned_highp_vec1;
|
||||
typedef tvec1<float, aligned_mediump> aligned_mediump_vec1;
|
||||
typedef tvec1<float, aligned_lowp> aligned_lowp_vec1;
|
||||
typedef tvec1<double, aligned_highp> aligned_highp_dvec1;
|
||||
typedef tvec1<double, aligned_mediump> aligned_mediump_dvec1;
|
||||
typedef tvec1<double, aligned_lowp> aligned_lowp_dvec1;
|
||||
typedef tvec1<int, aligned_highp> aligned_highp_ivec1;
|
||||
typedef tvec1<int, aligned_mediump> aligned_mediump_ivec1;
|
||||
typedef tvec1<int, aligned_lowp> aligned_lowp_ivec1;
|
||||
typedef tvec1<uint, aligned_highp> aligned_highp_uvec1;
|
||||
typedef tvec1<uint, aligned_mediump> aligned_mediump_uvec1;
|
||||
typedef tvec1<uint, aligned_lowp> aligned_lowp_uvec1;
|
||||
typedef tvec1<bool, aligned_highp> aligned_highp_bvec1;
|
||||
typedef tvec1<bool, aligned_mediump> aligned_mediump_bvec1;
|
||||
typedef tvec1<bool, aligned_lowp> aligned_lowp_bvec1;
|
||||
|
||||
typedef tvec1<float, packed_highp> packed_highp_vec1;
|
||||
typedef tvec1<float, packed_mediump> packed_mediump_vec1;
|
||||
typedef tvec1<float, packed_lowp> packed_lowp_vec1;
|
||||
typedef tvec1<double, packed_highp> packed_highp_dvec1;
|
||||
typedef tvec1<double, packed_mediump> packed_mediump_dvec1;
|
||||
typedef tvec1<double, packed_lowp> packed_lowp_dvec1;
|
||||
typedef tvec1<int, packed_highp> packed_highp_ivec1;
|
||||
typedef tvec1<int, packed_mediump> packed_mediump_ivec1;
|
||||
typedef tvec1<int, packed_lowp> packed_lowp_ivec1;
|
||||
typedef tvec1<uint, packed_highp> packed_highp_uvec1;
|
||||
typedef tvec1<uint, packed_mediump> packed_mediump_uvec1;
|
||||
typedef tvec1<uint, packed_lowp> packed_lowp_uvec1;
|
||||
typedef tvec1<bool, packed_highp> packed_highp_bvec1;
|
||||
typedef tvec1<bool, packed_mediump> packed_mediump_bvec1;
|
||||
typedef tvec1<bool, packed_lowp> packed_lowp_bvec1;
|
||||
|
||||
// -- *vec2 --
|
||||
|
||||
/// 2 components vector of high single-precision floating-point numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<float, aligned_highp> aligned_highp_vec2;
|
||||
|
||||
/// 2 components vector of medium single-precision floating-point numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<float, aligned_mediump> aligned_mediump_vec2;
|
||||
|
||||
/// 2 components vector of low single-precision floating-point numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<float, aligned_lowp> aligned_lowp_vec2;
|
||||
|
||||
/// 2 components vector of high double-precision floating-point numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<double, aligned_highp> aligned_highp_dvec2;
|
||||
|
||||
/// 2 components vector of medium double-precision floating-point numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<double, aligned_mediump> aligned_mediump_dvec2;
|
||||
|
||||
/// 2 components vector of low double-precision floating-point numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<double, aligned_lowp> aligned_lowp_dvec2;
|
||||
|
||||
/// 2 components vector of high precision signed integer numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<int, aligned_highp> aligned_highp_ivec2;
|
||||
|
||||
/// 2 components vector of medium precision signed integer numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<int, aligned_mediump> aligned_mediump_ivec2;
|
||||
|
||||
/// 2 components vector of low precision signed integer numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<int, aligned_lowp> aligned_lowp_ivec2;
|
||||
|
||||
/// 2 components vector of high precision unsigned integer numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<uint, aligned_highp> aligned_highp_uvec2;
|
||||
|
||||
/// 2 components vector of medium precision unsigned integer numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<uint, aligned_mediump> aligned_mediump_uvec2;
|
||||
|
||||
/// 2 components vector of low precision unsigned integer numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<uint, aligned_lowp> aligned_lowp_uvec2;
|
||||
|
||||
/// 2 components vector of high precision bool numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<bool, aligned_highp> aligned_highp_bvec2;
|
||||
|
||||
/// 2 components vector of medium precision bool numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<bool, aligned_mediump> aligned_mediump_bvec2;
|
||||
|
||||
/// 2 components vector of low precision bool numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec2<bool, aligned_lowp> aligned_lowp_bvec2;
|
||||
|
||||
// -- *vec3 --
|
||||
|
||||
/// 3 components vector of high single-precision floating-point numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec3<float, aligned_highp> aligned_highp_vec3;
|
||||
|
||||
/// 3 components vector of medium single-precision floating-point numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec3<float, aligned_mediump> aligned_mediump_vec3;
|
||||
|
||||
/// 3 components vector of low single-precision floating-point numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec3<float, aligned_lowp> aligned_lowp_vec3;
|
||||
|
||||
/// 3 components vector of high double-precision floating-point numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec3<double, aligned_highp> aligned_highp_dvec3;
|
||||
|
||||
/// 3 components vector of medium double-precision floating-point numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec3<double, aligned_mediump> aligned_mediump_dvec3;
|
||||
|
||||
/// 3 components vector of low double-precision floating-point numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec3<double, aligned_lowp> aligned_lowp_dvec3;
|
||||
|
||||
/// 3 components vector of high precision signed integer numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec3<int, aligned_highp> aligned_highp_ivec3;
|
||||
|
||||
/// 3 components vector of medium precision signed integer numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec3<int, aligned_mediump> aligned_mediump_ivec3;
|
||||
|
||||
/// 3 components vector of low precision signed integer numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec3<int, aligned_lowp> aligned_lowp_ivec3;
|
||||
|
||||
/// 3 components vector of high precision unsigned integer numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec3<uint, aligned_highp> aligned_highp_uvec3;
|
||||
|
||||
/// 3 components vector of medium precision unsigned integer numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec3<uint, aligned_mediump> aligned_mediump_uvec3;
|
||||
|
||||
/// 3 components vector of low precision unsigned integer numbers.
|
||||
/// There is no guarantee on the actual precision.
|
||||
typedef tvec3<uint, aligned_lowp> aligned_lowp_uvec3;
|
||||
|
||||
/// 3 components vector of high precision bool numbers.
|
||||
typedef tvec3<bool, aligned_highp> aligned_highp_bvec3;
|
||||
|
||||
/// 3 components vector of medium precision bool numbers.
|
||||
typedef tvec3<bool, aligned_mediump> aligned_mediump_bvec3;
|
||||
|
||||
/// 3 components vector of low precision bool numbers.
|
||||
typedef tvec3<bool, aligned_lowp> aligned_lowp_bvec3;
|
||||
|
||||
// -- *vec4 --
|
||||
|
||||
/// 4 components vector of high single-precision floating-point numbers.
|
||||
typedef tvec4<float, aligned_highp> aligned_highp_vec4;
|
||||
|
||||
/// 4 components vector of medium single-precision floating-point numbers.
|
||||
typedef tvec4<float, aligned_mediump> aligned_mediump_vec4;
|
||||
|
||||
/// 4 components vector of low single-precision floating-point numbers.
|
||||
typedef tvec4<float, aligned_lowp> aligned_lowp_vec4;
|
||||
|
||||
/// 4 components vector of high double-precision floating-point numbers.
|
||||
typedef tvec4<double, aligned_highp> aligned_highp_dvec4;
|
||||
|
||||
/// 4 components vector of medium double-precision floating-point numbers.
|
||||
typedef tvec4<double, aligned_mediump> aligned_mediump_dvec4;
|
||||
|
||||
/// 4 components vector of low double-precision floating-point numbers.
|
||||
typedef tvec4<double, aligned_lowp> aligned_lowp_dvec4;
|
||||
|
||||
/// 4 components vector of high precision signed integer numbers.
|
||||
typedef tvec4<int, aligned_highp> aligned_highp_ivec4;
|
||||
|
||||
/// 4 components vector of medium precision signed integer numbers.
|
||||
typedef tvec4<int, aligned_mediump> aligned_mediump_ivec4;
|
||||
|
||||
/// 4 components vector of low precision signed integer numbers.
|
||||
typedef tvec4<int, aligned_lowp> aligned_lowp_ivec4;
|
||||
|
||||
/// 4 components vector of high precision unsigned integer numbers.
|
||||
typedef tvec4<uint, aligned_highp> aligned_highp_uvec4;
|
||||
|
||||
/// 4 components vector of medium precision unsigned integer numbers.
|
||||
typedef tvec4<uint, aligned_mediump> aligned_mediump_uvec4;
|
||||
|
||||
/// 4 components vector of low precision unsigned integer numbers.
|
||||
typedef tvec4<uint, aligned_lowp> aligned_lowp_uvec4;
|
||||
|
||||
/// 4 components vector of high precision bool numbers.
|
||||
typedef tvec4<bool, aligned_highp> aligned_highp_bvec4;
|
||||
|
||||
/// 4 components vector of medium precision bool numbers.
|
||||
typedef tvec4<bool, aligned_mediump> aligned_mediump_bvec4;
|
||||
|
||||
/// 4 components vector of low precision bool numbers.
|
||||
typedef tvec4<bool, aligned_lowp> aligned_lowp_bvec4;
|
||||
|
||||
// -- default --
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_FLOAT))
|
||||
typedef aligned_lowp_vec1 aligned_vec1;
|
||||
typedef aligned_lowp_vec2 aligned_vec2;
|
||||
typedef aligned_lowp_vec3 aligned_vec3;
|
||||
typedef aligned_lowp_vec4 aligned_vec4;
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_FLOAT))
|
||||
typedef aligned_mediump_vec1 aligned_vec1;
|
||||
typedef aligned_mediump_vec2 aligned_vec2;
|
||||
typedef aligned_mediump_vec3 aligned_vec3;
|
||||
typedef aligned_mediump_vec4 aligned_vec4;
|
||||
#else //defined(GLM_PRECISION_HIGHP_FLOAT)
|
||||
/// 1 component vector of floating-point numbers.
|
||||
typedef aligned_highp_vec1 aligned_vec1;
|
||||
|
||||
/// 2 components vector of floating-point numbers.
|
||||
typedef aligned_highp_vec2 aligned_vec2;
|
||||
|
||||
/// 3 components vector of floating-point numbers.
|
||||
typedef aligned_highp_vec3 aligned_vec3;
|
||||
|
||||
/// 4 components vector of floating-point numbers.
|
||||
typedef aligned_highp_vec4 aligned_vec4;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_DOUBLE))
|
||||
typedef aligned_lowp_dvec1 aligned_dvec1;
|
||||
typedef aligned_lowp_dvec2 aligned_dvec2;
|
||||
typedef aligned_lowp_dvec3 aligned_dvec3;
|
||||
typedef aligned_lowp_dvec4 aligned_dvec4;
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_DOUBLE))
|
||||
typedef aligned_mediump_dvec1 aligned_dvec1;
|
||||
typedef aligned_mediump_dvec2 aligned_dvec2;
|
||||
typedef aligned_mediump_dvec3 aligned_dvec3;
|
||||
typedef aligned_mediump_dvec4 aligned_dvec4;
|
||||
#else //defined(GLM_PRECISION_HIGHP_DOUBLE)
|
||||
/// 1 component vector of double-precision floating-point numbers.
|
||||
typedef aligned_highp_dvec1 aligned_dvec1;
|
||||
|
||||
/// 2 components vector of double-precision floating-point numbers.
|
||||
typedef aligned_highp_dvec2 aligned_dvec2;
|
||||
|
||||
/// 3 components vector of double-precision floating-point numbers.
|
||||
typedef aligned_highp_dvec3 aligned_dvec3;
|
||||
|
||||
/// 4 components vector of double-precision floating-point numbers.
|
||||
typedef aligned_highp_dvec4 aligned_dvec4;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_INT))
|
||||
typedef aligned_lowp_ivec1 aligned_ivec1;
|
||||
typedef aligned_lowp_ivec2 aligned_ivec2;
|
||||
typedef aligned_lowp_ivec3 aligned_ivec3;
|
||||
typedef aligned_lowp_ivec4 aligned_ivec4;
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_INT))
|
||||
typedef aligned_mediump_ivec1 aligned_ivec1;
|
||||
typedef aligned_mediump_ivec2 aligned_ivec2;
|
||||
typedef aligned_mediump_ivec3 aligned_ivec3;
|
||||
typedef aligned_mediump_ivec4 aligned_ivec4;
|
||||
#else //defined(GLM_PRECISION_HIGHP_INT)
|
||||
/// 1 component vector of signed integer numbers.
|
||||
typedef aligned_highp_ivec1 aligned_ivec1;
|
||||
|
||||
/// 2 components vector of signed integer numbers.
|
||||
typedef aligned_highp_ivec2 aligned_ivec2;
|
||||
|
||||
/// 3 components vector of signed integer numbers.
|
||||
typedef aligned_highp_ivec3 aligned_ivec3;
|
||||
|
||||
/// 4 components vector of signed integer numbers.
|
||||
typedef aligned_highp_ivec4 aligned_ivec4;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
// -- Unsigned integer definition --
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_UINT))
|
||||
typedef aligned_lowp_uvec1 aligned_uvec1;
|
||||
typedef aligned_lowp_uvec2 aligned_uvec2;
|
||||
typedef aligned_lowp_uvec3 aligned_uvec3;
|
||||
typedef aligned_lowp_uvec4 aligned_uvec4;
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_UINT))
|
||||
typedef aligned_mediump_uvec1 aligned_uvec1;
|
||||
typedef aligned_mediump_uvec2 aligned_uvec2;
|
||||
typedef aligned_mediump_uvec3 aligned_uvec3;
|
||||
typedef aligned_mediump_uvec4 aligned_uvec4;
|
||||
#else //defined(GLM_PRECISION_HIGHP_UINT)
|
||||
/// 1 component vector of unsigned integer numbers.
|
||||
typedef aligned_highp_uvec1 aligned_uvec1;
|
||||
|
||||
/// 2 components vector of unsigned integer numbers.
|
||||
typedef aligned_highp_uvec2 aligned_uvec2;
|
||||
|
||||
/// 3 components vector of unsigned integer numbers.
|
||||
typedef aligned_highp_uvec3 aligned_uvec3;
|
||||
|
||||
/// 4 components vector of unsigned integer numbers.
|
||||
typedef aligned_highp_uvec4 aligned_uvec4;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
#if(defined(GLM_PRECISION_LOWP_BOOL))
|
||||
typedef aligned_lowp_bvec1 aligned_bvec1;
|
||||
typedef aligned_lowp_bvec2 aligned_bvec2;
|
||||
typedef aligned_lowp_bvec3 aligned_bvec3;
|
||||
typedef aligned_lowp_bvec4 aligned_bvec4;
|
||||
#elif(defined(GLM_PRECISION_MEDIUMP_BOOL))
|
||||
typedef aligned_mediump_bvec1 aligned_bvec1;
|
||||
typedef aligned_mediump_bvec2 aligned_bvec2;
|
||||
typedef aligned_mediump_bvec3 aligned_bvec3;
|
||||
typedef aligned_mediump_bvec4 aligned_bvec4;
|
||||
#else //defined(GLM_PRECISION_HIGHP_BOOL)
|
||||
/// 1 component vector of boolean.
|
||||
typedef aligned_highp_bvec1 aligned_bvec1;
|
||||
|
||||
/// 2 components vector of boolean.
|
||||
typedef aligned_highp_bvec2 aligned_bvec2;
|
||||
|
||||
/// 3 components vector of boolean.
|
||||
typedef aligned_highp_bvec3 aligned_bvec3;
|
||||
|
||||
/// 4 components vector of boolean.
|
||||
typedef aligned_highp_bvec4 aligned_bvec4;
|
||||
#endif//GLM_PRECISION
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
133
common/glm/glm/gtx/extended_min_max.hpp
Normal file
133
common/glm/glm/gtx/extended_min_max.hpp
Normal file
@ -0,0 +1,133 @@
|
||||
/// @ref gtx_extended_min_max
|
||||
/// @file glm/gtx/extended_min_max.hpp
|
||||
///
|
||||
/// @see core (dependence)
|
||||
/// @see gtx_half_float (dependence)
|
||||
///
|
||||
/// @defgroup gtx_extented_min_max GLM_GTX_extented_min_max
|
||||
/// @ingroup gtx
|
||||
///
|
||||
/// Min and max functions for 3 to 4 parameters.
|
||||
///
|
||||
/// <glm/gtx/extented_min_max.hpp> need to be included to use these functionalities.
|
||||
|
||||
#pragma once
|
||||
|
||||
// Dependency:
|
||||
#include "../glm.hpp"
|
||||
|
||||
#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
|
||||
# pragma message("GLM: GLM_GTX_extented_min_max extension included")
|
||||
#endif
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup gtx_extented_min_max
|
||||
/// @{
|
||||
|
||||
/// Return the minimum component-wise values of 3 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template <typename T>
|
||||
GLM_FUNC_DECL T min(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z);
|
||||
|
||||
/// Return the minimum component-wise values of 3 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_DECL C<T> min(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z);
|
||||
|
||||
/// Return the minimum component-wise values of 3 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_DECL C<T> min(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z);
|
||||
|
||||
/// Return the minimum component-wise values of 4 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template <typename T>
|
||||
GLM_FUNC_DECL T min(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z,
|
||||
T const & w);
|
||||
|
||||
/// Return the minimum component-wise values of 4 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_DECL C<T> min(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z,
|
||||
typename C<T>::T const & w);
|
||||
|
||||
/// Return the minimum component-wise values of 4 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_DECL C<T> min(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z,
|
||||
C<T> const & w);
|
||||
|
||||
/// Return the maximum component-wise values of 3 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template <typename T>
|
||||
GLM_FUNC_DECL T max(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z);
|
||||
|
||||
/// Return the maximum component-wise values of 3 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_DECL C<T> max(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z);
|
||||
|
||||
/// Return the maximum component-wise values of 3 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_DECL C<T> max(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z);
|
||||
|
||||
/// Return the maximum component-wise values of 4 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template <typename T>
|
||||
GLM_FUNC_DECL T max(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z,
|
||||
T const & w);
|
||||
|
||||
/// Return the maximum component-wise values of 4 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_DECL C<T> max(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z,
|
||||
typename C<T>::T const & w);
|
||||
|
||||
/// Return the maximum component-wise values of 4 inputs
|
||||
/// @see gtx_extented_min_max
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_DECL C<T> max(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z,
|
||||
C<T> const & w);
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "extended_min_max.inl"
|
||||
140
common/glm/glm/gtx/extended_min_max.inl
Normal file
140
common/glm/glm/gtx/extended_min_max.inl
Normal file
@ -0,0 +1,140 @@
|
||||
/// @ref gtx_extended_min_max
|
||||
/// @file glm/gtx/extended_min_max.inl
|
||||
|
||||
namespace glm
|
||||
{
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER T min(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z)
|
||||
{
|
||||
return glm::min(glm::min(x, y), z);
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> min
|
||||
(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z
|
||||
)
|
||||
{
|
||||
return glm::min(glm::min(x, y), z);
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> min
|
||||
(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z
|
||||
)
|
||||
{
|
||||
return glm::min(glm::min(x, y), z);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER T min
|
||||
(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z,
|
||||
T const & w
|
||||
)
|
||||
{
|
||||
return glm::min(glm::min(x, y), glm::min(z, w));
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> min
|
||||
(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z,
|
||||
typename C<T>::T const & w
|
||||
)
|
||||
{
|
||||
return glm::min(glm::min(x, y), glm::min(z, w));
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> min
|
||||
(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z,
|
||||
C<T> const & w
|
||||
)
|
||||
{
|
||||
return glm::min(glm::min(x, y), glm::min(z, w));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER T max(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z)
|
||||
{
|
||||
return glm::max(glm::max(x, y), z);
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> max
|
||||
(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z
|
||||
)
|
||||
{
|
||||
return glm::max(glm::max(x, y), z);
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> max
|
||||
(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z
|
||||
)
|
||||
{
|
||||
return glm::max(glm::max(x, y), z);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
GLM_FUNC_QUALIFIER T max
|
||||
(
|
||||
T const & x,
|
||||
T const & y,
|
||||
T const & z,
|
||||
T const & w
|
||||
)
|
||||
{
|
||||
return glm::max(glm::max(x, y), glm::max(z, w));
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> max
|
||||
(
|
||||
C<T> const & x,
|
||||
typename C<T>::T const & y,
|
||||
typename C<T>::T const & z,
|
||||
typename C<T>::T const & w
|
||||
)
|
||||
{
|
||||
return glm::max(glm::max(x, y), glm::max(z, w));
|
||||
}
|
||||
|
||||
template <typename T, template <typename> class C>
|
||||
GLM_FUNC_QUALIFIER C<T> max
|
||||
(
|
||||
C<T> const & x,
|
||||
C<T> const & y,
|
||||
C<T> const & z,
|
||||
C<T> const & w
|
||||
)
|
||||
{
|
||||
return glm::max(glm::max(x, y), glm::max(z, w));
|
||||
}
|
||||
|
||||
}//namespace glm
|
||||
14
common/glm/glm/gtx/float_notmalize.inl
Normal file
14
common/glm/glm/gtx/float_notmalize.inl
Normal file
@ -0,0 +1,14 @@
|
||||
/// @ref gtx_float_normalize
|
||||
/// @file glm/gtx/float_normalize.inl
|
||||
|
||||
#include <limits>
|
||||
|
||||
namespace glm
|
||||
{
|
||||
template <typename T, precision P, template <typename, precision> class vecType>
|
||||
GLM_FUNC_QUALIFIER vecType<float, P> floatNormalize(vecType<T, P> const & v)
|
||||
{
|
||||
return vecType<float, P>(v) / static_cast<float>(std::numeric_limits<T>::max());
|
||||
}
|
||||
|
||||
}//namespace glm
|
||||
134
common/glm/glm/gtx/hash.hpp
Normal file
134
common/glm/glm/gtx/hash.hpp
Normal file
@ -0,0 +1,134 @@
|
||||
/// @ref gtx_hash
|
||||
/// @file glm/gtx/hash.hpp
|
||||
///
|
||||
/// @see core (dependence)
|
||||
///
|
||||
/// @defgroup gtx_hash GLM_GTX_hash
|
||||
/// @ingroup gtx
|
||||
///
|
||||
/// @brief Add std::hash support for glm types
|
||||
///
|
||||
/// <glm/gtx/hash.hpp> need to be included to use these functionalities.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
|
||||
#include "../vec2.hpp"
|
||||
#include "../vec3.hpp"
|
||||
#include "../vec4.hpp"
|
||||
#include "../gtc/vec1.hpp"
|
||||
|
||||
#include "../gtc/quaternion.hpp"
|
||||
#include "../gtx/dual_quaternion.hpp"
|
||||
|
||||
#include "../mat2x2.hpp"
|
||||
#include "../mat2x3.hpp"
|
||||
#include "../mat2x4.hpp"
|
||||
|
||||
#include "../mat3x2.hpp"
|
||||
#include "../mat3x3.hpp"
|
||||
#include "../mat3x4.hpp"
|
||||
|
||||
#include "../mat4x2.hpp"
|
||||
#include "../mat4x3.hpp"
|
||||
#include "../mat4x4.hpp"
|
||||
|
||||
#if !GLM_HAS_CXX11_STL
|
||||
# error "GLM_GTX_hash requires C++11 standard library support"
|
||||
#endif
|
||||
|
||||
namespace std
|
||||
{
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tvec1<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tvec1<T, P> const & v) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tvec2<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tvec2<T, P> const & v) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tvec3<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tvec3<T, P> const & v) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tvec4<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tvec4<T, P> const & v) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tquat<T,P>>
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tquat<T, P> const & q) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tdualquat<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tdualquat<T,P> const & q) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tmat2x2<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tmat2x2<T,P> const & m) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tmat2x3<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tmat2x3<T,P> const & m) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tmat2x4<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tmat2x4<T,P> const & m) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tmat3x2<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tmat3x2<T,P> const & m) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tmat3x3<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tmat3x3<T,P> const & m) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tmat3x4<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tmat3x4<T,P> const & m) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tmat4x2<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tmat4x2<T,P> const & m) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tmat4x3<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tmat4x3<T,P> const & m) const;
|
||||
};
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
struct hash<glm::tmat4x4<T,P> >
|
||||
{
|
||||
GLM_FUNC_DECL size_t operator()(glm::tmat4x4<T,P> const & m) const;
|
||||
};
|
||||
} // namespace std
|
||||
|
||||
#include "hash.inl"
|
||||
185
common/glm/glm/gtx/hash.inl
Normal file
185
common/glm/glm/gtx/hash.inl
Normal file
@ -0,0 +1,185 @@
|
||||
/// @ref gtx_hash
|
||||
/// @file glm/gtx/hash.inl
|
||||
///
|
||||
/// @see core (dependence)
|
||||
///
|
||||
/// @defgroup gtx_hash GLM_GTX_hash
|
||||
/// @ingroup gtx
|
||||
///
|
||||
/// @brief Add std::hash support for glm types
|
||||
///
|
||||
/// <glm/gtx/hash.inl> need to be included to use these functionalities.
|
||||
|
||||
namespace glm {
|
||||
namespace detail
|
||||
{
|
||||
GLM_INLINE void hash_combine(size_t &seed, size_t hash)
|
||||
{
|
||||
hash += 0x9e3779b9 + (seed << 6) + (seed >> 2);
|
||||
seed ^= hash;
|
||||
}
|
||||
}}
|
||||
|
||||
namespace std
|
||||
{
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tvec1<T, P>>::operator()(glm::tvec1<T, P> const & v) const
|
||||
{
|
||||
hash<T> hasher;
|
||||
return hasher(v.x);
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tvec2<T, P>>::operator()(glm::tvec2<T, P> const & v) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<T> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(v.x));
|
||||
glm::detail::hash_combine(seed, hasher(v.y));
|
||||
return seed;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tvec3<T, P>>::operator()(glm::tvec3<T, P> const & v) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<T> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(v.x));
|
||||
glm::detail::hash_combine(seed, hasher(v.y));
|
||||
glm::detail::hash_combine(seed, hasher(v.z));
|
||||
return seed;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tvec4<T, P>>::operator()(glm::tvec4<T, P> const & v) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<T> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(v.x));
|
||||
glm::detail::hash_combine(seed, hasher(v.y));
|
||||
glm::detail::hash_combine(seed, hasher(v.z));
|
||||
glm::detail::hash_combine(seed, hasher(v.w));
|
||||
return seed;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tquat<T, P>>::operator()(glm::tquat<T,P> const & q) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<T> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(q.x));
|
||||
glm::detail::hash_combine(seed, hasher(q.y));
|
||||
glm::detail::hash_combine(seed, hasher(q.z));
|
||||
glm::detail::hash_combine(seed, hasher(q.w));
|
||||
return seed;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tdualquat<T, P>>::operator()(glm::tdualquat<T, P> const & q) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<glm::tquat<T, P>> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(q.real));
|
||||
glm::detail::hash_combine(seed, hasher(q.dual));
|
||||
return seed;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tmat2x2<T, P>>::operator()(glm::tmat2x2<T, P> const & m) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<glm::tvec2<T, P>> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||
return seed;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tmat2x3<T, P>>::operator()(glm::tmat2x3<T, P> const & m) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<glm::tvec3<T, P>> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||
return seed;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tmat2x4<T, P>>::operator()(glm::tmat2x4<T, P> const & m) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<glm::tvec4<T, P>> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||
return seed;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tmat3x2<T, P>>::operator()(glm::tmat3x2<T, P> const & m) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<glm::tvec2<T, P>> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||
glm::detail::hash_combine(seed, hasher(m[2]));
|
||||
return seed;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tmat3x3<T, P>>::operator()(glm::tmat3x3<T, P> const & m) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<glm::tvec3<T, P>> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||
glm::detail::hash_combine(seed, hasher(m[2]));
|
||||
return seed;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tmat3x4<T, P>>::operator()(glm::tmat3x4<T, P> const & m) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<glm::tvec4<T, P>> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||
glm::detail::hash_combine(seed, hasher(m[2]));
|
||||
return seed;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tmat4x2<T,P>>::operator()(glm::tmat4x2<T,P> const & m) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<glm::tvec2<T, P>> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||
glm::detail::hash_combine(seed, hasher(m[2]));
|
||||
glm::detail::hash_combine(seed, hasher(m[3]));
|
||||
return seed;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tmat4x3<T,P>>::operator()(glm::tmat4x3<T,P> const & m) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<glm::tvec3<T, P>> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||
glm::detail::hash_combine(seed, hasher(m[2]));
|
||||
glm::detail::hash_combine(seed, hasher(m[3]));
|
||||
return seed;
|
||||
}
|
||||
|
||||
template <typename T, glm::precision P>
|
||||
GLM_FUNC_QUALIFIER size_t hash<glm::tmat4x4<T,P>>::operator()(glm::tmat4x4<T, P> const & m) const
|
||||
{
|
||||
size_t seed = 0;
|
||||
hash<glm::tvec4<T, P>> hasher;
|
||||
glm::detail::hash_combine(seed, hasher(m[0]));
|
||||
glm::detail::hash_combine(seed, hasher(m[1]));
|
||||
glm::detail::hash_combine(seed, hasher(m[2]));
|
||||
glm::detail::hash_combine(seed, hasher(m[3]));
|
||||
return seed;
|
||||
}
|
||||
}
|
||||
252
common/glm/glm/gtx/type_trait.hpp
Normal file
252
common/glm/glm/gtx/type_trait.hpp
Normal file
@ -0,0 +1,252 @@
|
||||
/// @ref gtx_type_trait
|
||||
/// @file glm/gtx/type_trait.hpp
|
||||
///
|
||||
/// @see core (dependence)
|
||||
///
|
||||
/// @defgroup gtx_type_trait GLM_GTX_type_trait
|
||||
/// @ingroup gtx
|
||||
///
|
||||
/// @brief Defines traits for each type.
|
||||
///
|
||||
/// <glm/gtx/type_trait.hpp> need to be included to use these functionalities.
|
||||
|
||||
#pragma once
|
||||
|
||||
// Dependency:
|
||||
#include "../detail/type_vec2.hpp"
|
||||
#include "../detail/type_vec3.hpp"
|
||||
#include "../detail/type_vec4.hpp"
|
||||
#include "../detail/type_mat2x2.hpp"
|
||||
#include "../detail/type_mat2x3.hpp"
|
||||
#include "../detail/type_mat2x4.hpp"
|
||||
#include "../detail/type_mat3x2.hpp"
|
||||
#include "../detail/type_mat3x3.hpp"
|
||||
#include "../detail/type_mat3x4.hpp"
|
||||
#include "../detail/type_mat4x2.hpp"
|
||||
#include "../detail/type_mat4x3.hpp"
|
||||
#include "../detail/type_mat4x4.hpp"
|
||||
#include "../gtc/quaternion.hpp"
|
||||
#include "../gtx/dual_quaternion.hpp"
|
||||
|
||||
#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
|
||||
# pragma message("GLM: GLM_GTX_type_trait extension included")
|
||||
#endif
|
||||
|
||||
namespace glm
|
||||
{
|
||||
/// @addtogroup gtx_type_trait
|
||||
/// @{
|
||||
|
||||
template <template <typename, precision> class genType, typename T, precision P>
|
||||
struct type
|
||||
{
|
||||
static bool const is_vec = false;
|
||||
static bool const is_mat = false;
|
||||
static bool const is_quat = false;
|
||||
static length_t const components = 0;
|
||||
static length_t const cols = 0;
|
||||
static length_t const rows = 0;
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tvec1, T, P>
|
||||
{
|
||||
static bool const is_vec = true;
|
||||
static bool const is_mat = false;
|
||||
static bool const is_quat = false;
|
||||
enum
|
||||
{
|
||||
components = 1
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tvec2, T, P>
|
||||
{
|
||||
static bool const is_vec = true;
|
||||
static bool const is_mat = false;
|
||||
static bool const is_quat = false;
|
||||
enum
|
||||
{
|
||||
components = 2
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tvec3, T, P>
|
||||
{
|
||||
static bool const is_vec = true;
|
||||
static bool const is_mat = false;
|
||||
static bool const is_quat = false;
|
||||
enum
|
||||
{
|
||||
components = 3
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tvec4, T, P>
|
||||
{
|
||||
static bool const is_vec = true;
|
||||
static bool const is_mat = false;
|
||||
static bool const is_quat = false;
|
||||
enum
|
||||
{
|
||||
components = 4
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tmat2x2, T, P>
|
||||
{
|
||||
static bool const is_vec = false;
|
||||
static bool const is_mat = true;
|
||||
static bool const is_quat = false;
|
||||
enum
|
||||
{
|
||||
components = 2,
|
||||
cols = 2,
|
||||
rows = 2
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tmat2x3, T, P>
|
||||
{
|
||||
static bool const is_vec = false;
|
||||
static bool const is_mat = true;
|
||||
static bool const is_quat = false;
|
||||
enum
|
||||
{
|
||||
components = 2,
|
||||
cols = 2,
|
||||
rows = 3
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tmat2x4, T, P>
|
||||
{
|
||||
static bool const is_vec = false;
|
||||
static bool const is_mat = true;
|
||||
static bool const is_quat = false;
|
||||
enum
|
||||
{
|
||||
components = 2,
|
||||
cols = 2,
|
||||
rows = 4
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tmat3x2, T, P>
|
||||
{
|
||||
static bool const is_vec = false;
|
||||
static bool const is_mat = true;
|
||||
static bool const is_quat = false;
|
||||
enum
|
||||
{
|
||||
components = 3,
|
||||
cols = 3,
|
||||
rows = 2
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tmat3x3, T, P>
|
||||
{
|
||||
static bool const is_vec = false;
|
||||
static bool const is_mat = true;
|
||||
static bool const is_quat = false;
|
||||
enum
|
||||
{
|
||||
components = 3,
|
||||
cols = 3,
|
||||
rows = 3
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tmat3x4, T, P>
|
||||
{
|
||||
static bool const is_vec = false;
|
||||
static bool const is_mat = true;
|
||||
static bool const is_quat = false;
|
||||
enum
|
||||
{
|
||||
components = 3,
|
||||
cols = 3,
|
||||
rows = 4
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tmat4x2, T, P>
|
||||
{
|
||||
static bool const is_vec = false;
|
||||
static bool const is_mat = true;
|
||||
static bool const is_quat = false;
|
||||
enum
|
||||
{
|
||||
components = 4,
|
||||
cols = 4,
|
||||
rows = 2
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tmat4x3, T, P>
|
||||
{
|
||||
static bool const is_vec = false;
|
||||
static bool const is_mat = true;
|
||||
static bool const is_quat = false;
|
||||
enum
|
||||
{
|
||||
components = 4,
|
||||
cols = 4,
|
||||
rows = 3
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tmat4x4, T, P>
|
||||
{
|
||||
static bool const is_vec = false;
|
||||
static bool const is_mat = true;
|
||||
static bool const is_quat = false;
|
||||
enum
|
||||
{
|
||||
components = 4,
|
||||
cols = 4,
|
||||
rows = 4
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tquat, T, P>
|
||||
{
|
||||
static bool const is_vec = false;
|
||||
static bool const is_mat = false;
|
||||
static bool const is_quat = true;
|
||||
enum
|
||||
{
|
||||
components = 4
|
||||
};
|
||||
};
|
||||
|
||||
template <typename T, precision P>
|
||||
struct type<tdualquat, T, P>
|
||||
{
|
||||
static bool const is_vec = false;
|
||||
static bool const is_mat = false;
|
||||
static bool const is_quat = true;
|
||||
enum
|
||||
{
|
||||
components = 8
|
||||
};
|
||||
};
|
||||
|
||||
/// @}
|
||||
}//namespace glm
|
||||
|
||||
#include "type_trait.inl"
|
||||
0
common/glm/glm/gtx/type_trait.inl
Normal file
0
common/glm/glm/gtx/type_trait.inl
Normal file
240
common/glm/glm/simd/common.h
Normal file
240
common/glm/glm/simd/common.h
Normal file
@ -0,0 +1,240 @@
|
||||
/// @ref simd
|
||||
/// @file glm/simd/common.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_add(glm_vec4 a, glm_vec4 b)
|
||||
{
|
||||
return _mm_add_ps(a, b);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_add(glm_vec4 a, glm_vec4 b)
|
||||
{
|
||||
return _mm_add_ss(a, b);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_sub(glm_vec4 a, glm_vec4 b)
|
||||
{
|
||||
return _mm_sub_ps(a, b);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_sub(glm_vec4 a, glm_vec4 b)
|
||||
{
|
||||
return _mm_sub_ss(a, b);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_mul(glm_vec4 a, glm_vec4 b)
|
||||
{
|
||||
return _mm_mul_ps(a, b);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_mul(glm_vec4 a, glm_vec4 b)
|
||||
{
|
||||
return _mm_mul_ss(a, b);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_div(glm_vec4 a, glm_vec4 b)
|
||||
{
|
||||
return _mm_div_ps(a, b);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_div(glm_vec4 a, glm_vec4 b)
|
||||
{
|
||||
return _mm_div_ss(a, b);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_div_lowp(glm_vec4 a, glm_vec4 b)
|
||||
{
|
||||
return glm_vec4_mul(a, _mm_rcp_ps(b));
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_swizzle_xyzw(glm_vec4 a)
|
||||
{
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
return _mm_permute_ps(a, _MM_SHUFFLE(3, 2, 1, 0));
|
||||
# else
|
||||
return _mm_shuffle_ps(a, a, _MM_SHUFFLE(3, 2, 1, 0));
|
||||
# endif
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_fma(glm_vec4 a, glm_vec4 b, glm_vec4 c)
|
||||
{
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
return _mm_fmadd_ss(a, b, c);
|
||||
# else
|
||||
return _mm_add_ss(_mm_mul_ss(a, b), c);
|
||||
# endif
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_fma(glm_vec4 a, glm_vec4 b, glm_vec4 c)
|
||||
{
|
||||
# if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
return _mm_fmadd_ps(a, b, c);
|
||||
# else
|
||||
return glm_vec4_add(glm_vec4_mul(a, b), c);
|
||||
# endif
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_abs(glm_vec4 x)
|
||||
{
|
||||
return _mm_and_ps(x, _mm_castsi128_ps(_mm_set1_epi32(0x7FFFFFFF)));
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_ivec4 glm_ivec4_abs(glm_ivec4 x)
|
||||
{
|
||||
# if GLM_ARCH & GLM_ARCH_SSSE3_BIT
|
||||
return _mm_sign_epi32(x, x);
|
||||
# else
|
||||
glm_ivec4 const sgn0 = _mm_srai_epi32(x, 31);
|
||||
glm_ivec4 const inv0 = _mm_xor_si128(x, sgn0);
|
||||
glm_ivec4 const sub0 = _mm_sub_epi32(inv0, sgn0);
|
||||
return sub0;
|
||||
# endif
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_sign(glm_vec4 x)
|
||||
{
|
||||
glm_vec4 const zro0 = _mm_setzero_ps();
|
||||
glm_vec4 const cmp0 = _mm_cmplt_ps(x, zro0);
|
||||
glm_vec4 const cmp1 = _mm_cmpgt_ps(x, zro0);
|
||||
glm_vec4 const and0 = _mm_and_ps(cmp0, _mm_set1_ps(-1.0f));
|
||||
glm_vec4 const and1 = _mm_and_ps(cmp1, _mm_set1_ps(1.0f));
|
||||
glm_vec4 const or0 = _mm_or_ps(and0, and1);;
|
||||
return or0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_round(glm_vec4 x)
|
||||
{
|
||||
# if GLM_ARCH & GLM_ARCH_SSE41_BIT
|
||||
return _mm_round_ps(x, _MM_FROUND_TO_NEAREST_INT);
|
||||
# else
|
||||
glm_vec4 const sgn0 = _mm_castsi128_ps(_mm_set1_epi32(0x80000000));
|
||||
glm_vec4 const and0 = _mm_and_ps(sgn0, x);
|
||||
glm_vec4 const or0 = _mm_or_ps(and0, _mm_set_ps1(8388608.0f));
|
||||
glm_vec4 const add0 = glm_vec4_add(x, or0);
|
||||
glm_vec4 const sub0 = glm_vec4_sub(add0, or0);
|
||||
return sub0;
|
||||
# endif
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_floor(glm_vec4 x)
|
||||
{
|
||||
# if GLM_ARCH & GLM_ARCH_SSE41_BIT
|
||||
return _mm_floor_ps(x);
|
||||
# else
|
||||
glm_vec4 const rnd0 = glm_vec4_round(x);
|
||||
glm_vec4 const cmp0 = _mm_cmplt_ps(x, rnd0);
|
||||
glm_vec4 const and0 = _mm_and_ps(cmp0, _mm_set1_ps(1.0f));
|
||||
glm_vec4 const sub0 = glm_vec4_sub(rnd0, and0);
|
||||
return sub0;
|
||||
# endif
|
||||
}
|
||||
|
||||
/* trunc TODO
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_trunc(glm_vec4 x)
|
||||
{
|
||||
return glm_vec4();
|
||||
}
|
||||
*/
|
||||
|
||||
//roundEven
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_roundEven(glm_vec4 x)
|
||||
{
|
||||
glm_vec4 const sgn0 = _mm_castsi128_ps(_mm_set1_epi32(0x80000000));
|
||||
glm_vec4 const and0 = _mm_and_ps(sgn0, x);
|
||||
glm_vec4 const or0 = _mm_or_ps(and0, _mm_set_ps1(8388608.0f));
|
||||
glm_vec4 const add0 = glm_vec4_add(x, or0);
|
||||
glm_vec4 const sub0 = glm_vec4_sub(add0, or0);
|
||||
return sub0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_ceil(glm_vec4 x)
|
||||
{
|
||||
# if GLM_ARCH & GLM_ARCH_SSE41_BIT
|
||||
return _mm_ceil_ps(x);
|
||||
# else
|
||||
glm_vec4 const rnd0 = glm_vec4_round(x);
|
||||
glm_vec4 const cmp0 = _mm_cmpgt_ps(x, rnd0);
|
||||
glm_vec4 const and0 = _mm_and_ps(cmp0, _mm_set1_ps(1.0f));
|
||||
glm_vec4 const add0 = glm_vec4_add(rnd0, and0);
|
||||
return add0;
|
||||
# endif
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_fract(glm_vec4 x)
|
||||
{
|
||||
glm_vec4 const flr0 = glm_vec4_floor(x);
|
||||
glm_vec4 const sub0 = glm_vec4_sub(x, flr0);
|
||||
return sub0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_mod(glm_vec4 x, glm_vec4 y)
|
||||
{
|
||||
glm_vec4 const div0 = glm_vec4_div(x, y);
|
||||
glm_vec4 const flr0 = glm_vec4_floor(div0);
|
||||
glm_vec4 const mul0 = glm_vec4_mul(y, flr0);
|
||||
glm_vec4 const sub0 = glm_vec4_sub(x, mul0);
|
||||
return sub0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_clamp(glm_vec4 v, glm_vec4 minVal, glm_vec4 maxVal)
|
||||
{
|
||||
glm_vec4 const min0 = _mm_min_ps(v, maxVal);
|
||||
glm_vec4 const max0 = _mm_max_ps(min0, minVal);
|
||||
return max0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_mix(glm_vec4 v1, glm_vec4 v2, glm_vec4 a)
|
||||
{
|
||||
glm_vec4 const sub0 = glm_vec4_sub(_mm_set1_ps(1.0f), a);
|
||||
glm_vec4 const mul0 = glm_vec4_mul(v1, sub0);
|
||||
glm_vec4 const mad0 = glm_vec4_fma(v2, a, mul0);
|
||||
return mad0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_step(glm_vec4 edge, glm_vec4 x)
|
||||
{
|
||||
glm_vec4 const cmp = _mm_cmple_ps(x, edge);
|
||||
return _mm_movemask_ps(cmp) == 0 ? _mm_set1_ps(1.0f) : _mm_setzero_ps();
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_smoothstep(glm_vec4 edge0, glm_vec4 edge1, glm_vec4 x)
|
||||
{
|
||||
glm_vec4 const sub0 = glm_vec4_sub(x, edge0);
|
||||
glm_vec4 const sub1 = glm_vec4_sub(edge1, edge0);
|
||||
glm_vec4 const div0 = glm_vec4_sub(sub0, sub1);
|
||||
glm_vec4 const clp0 = glm_vec4_clamp(div0, _mm_setzero_ps(), _mm_set1_ps(1.0f));
|
||||
glm_vec4 const mul0 = glm_vec4_mul(_mm_set1_ps(2.0f), clp0);
|
||||
glm_vec4 const sub2 = glm_vec4_sub(_mm_set1_ps(3.0f), mul0);
|
||||
glm_vec4 const mul1 = glm_vec4_mul(clp0, clp0);
|
||||
glm_vec4 const mul2 = glm_vec4_mul(mul1, sub2);
|
||||
return mul2;
|
||||
}
|
||||
|
||||
// Agner Fog method
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_nan(glm_vec4 x)
|
||||
{
|
||||
glm_ivec4 const t1 = _mm_castps_si128(x); // reinterpret as 32-bit integer
|
||||
glm_ivec4 const t2 = _mm_sll_epi32(t1, _mm_cvtsi32_si128(1)); // shift out sign bit
|
||||
glm_ivec4 const t3 = _mm_set1_epi32(0xFF000000); // exponent mask
|
||||
glm_ivec4 const t4 = _mm_and_si128(t2, t3); // exponent
|
||||
glm_ivec4 const t5 = _mm_andnot_si128(t3, t2); // fraction
|
||||
glm_ivec4 const Equal = _mm_cmpeq_epi32(t3, t4);
|
||||
glm_ivec4 const Nequal = _mm_cmpeq_epi32(t5, _mm_setzero_si128());
|
||||
glm_ivec4 const And = _mm_and_si128(Equal, Nequal);
|
||||
return _mm_castsi128_ps(And); // exponent = all 1s and fraction != 0
|
||||
}
|
||||
|
||||
// Agner Fog method
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_inf(glm_vec4 x)
|
||||
{
|
||||
glm_ivec4 const t1 = _mm_castps_si128(x); // reinterpret as 32-bit integer
|
||||
glm_ivec4 const t2 = _mm_sll_epi32(t1, _mm_cvtsi32_si128(1)); // shift out sign bit
|
||||
return _mm_castsi128_ps(_mm_cmpeq_epi32(t2, _mm_set1_epi32(0xFF000000))); // exponent is all 1s, fraction is 0
|
||||
}
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
20
common/glm/glm/simd/exponential.h
Normal file
20
common/glm/glm/simd/exponential.h
Normal file
@ -0,0 +1,20 @@
|
||||
/// @ref simd
|
||||
/// @file glm/simd/experimental.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "platform.h"
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_sqrt_lowp(glm_vec4 x)
|
||||
{
|
||||
return _mm_mul_ss(_mm_rsqrt_ss(x), x);
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_sqrt_lowp(glm_vec4 x)
|
||||
{
|
||||
return _mm_mul_ps(_mm_rsqrt_ps(x), x);
|
||||
}
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
124
common/glm/glm/simd/geometric.h
Normal file
124
common/glm/glm/simd/geometric.h
Normal file
@ -0,0 +1,124 @@
|
||||
/// @ref simd
|
||||
/// @file glm/simd/geometric.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
GLM_FUNC_DECL glm_vec4 glm_vec4_dot(glm_vec4 v1, glm_vec4 v2);
|
||||
GLM_FUNC_DECL glm_vec4 glm_vec1_dot(glm_vec4 v1, glm_vec4 v2);
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_length(glm_vec4 x)
|
||||
{
|
||||
glm_vec4 const dot0 = glm_vec4_dot(x, x);
|
||||
glm_vec4 const sqt0 = _mm_sqrt_ps(dot0);
|
||||
return sqt0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_distance(glm_vec4 p0, glm_vec4 p1)
|
||||
{
|
||||
glm_vec4 const sub0 = _mm_sub_ps(p0, p1);
|
||||
glm_vec4 const len0 = glm_vec4_length(sub0);
|
||||
return len0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_dot(glm_vec4 v1, glm_vec4 v2)
|
||||
{
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
return _mm_dp_ps(v1, v2, 0xff);
|
||||
# elif GLM_ARCH & GLM_ARCH_SSE3_BIT
|
||||
glm_vec4 const mul0 = _mm_mul_ps(v1, v2);
|
||||
glm_vec4 const hadd0 = _mm_hadd_ps(mul0, mul0);
|
||||
glm_vec4 const hadd1 = _mm_hadd_ps(hadd0, hadd0);
|
||||
return hadd1;
|
||||
# else
|
||||
glm_vec4 const mul0 = _mm_mul_ps(v1, v2);
|
||||
glm_vec4 const swp0 = _mm_shuffle_ps(mul0, mul0, _MM_SHUFFLE(2, 3, 0, 1));
|
||||
glm_vec4 const add0 = _mm_add_ps(mul0, swp0);
|
||||
glm_vec4 const swp1 = _mm_shuffle_ps(add0, add0, _MM_SHUFFLE(0, 1, 2, 3));
|
||||
glm_vec4 const add1 = _mm_add_ps(add0, swp1);
|
||||
return add1;
|
||||
# endif
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec1_dot(glm_vec4 v1, glm_vec4 v2)
|
||||
{
|
||||
# if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
return _mm_dp_ps(v1, v2, 0xff);
|
||||
# elif GLM_ARCH & GLM_ARCH_SSE3_BIT
|
||||
glm_vec4 const mul0 = _mm_mul_ps(v1, v2);
|
||||
glm_vec4 const had0 = _mm_hadd_ps(mul0, mul0);
|
||||
glm_vec4 const had1 = _mm_hadd_ps(had0, had0);
|
||||
return had1;
|
||||
# else
|
||||
glm_vec4 const mul0 = _mm_mul_ps(v1, v2);
|
||||
glm_vec4 const mov0 = _mm_movehl_ps(mul0, mul0);
|
||||
glm_vec4 const add0 = _mm_add_ps(mov0, mul0);
|
||||
glm_vec4 const swp1 = _mm_shuffle_ps(add0, add0, 1);
|
||||
glm_vec4 const add1 = _mm_add_ss(add0, swp1);
|
||||
return add1;
|
||||
# endif
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_cross(glm_vec4 v1, glm_vec4 v2)
|
||||
{
|
||||
glm_vec4 const swp0 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 0, 2, 1));
|
||||
glm_vec4 const swp1 = _mm_shuffle_ps(v1, v1, _MM_SHUFFLE(3, 1, 0, 2));
|
||||
glm_vec4 const swp2 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 0, 2, 1));
|
||||
glm_vec4 const swp3 = _mm_shuffle_ps(v2, v2, _MM_SHUFFLE(3, 1, 0, 2));
|
||||
glm_vec4 const mul0 = _mm_mul_ps(swp0, swp3);
|
||||
glm_vec4 const mul1 = _mm_mul_ps(swp1, swp2);
|
||||
glm_vec4 const sub0 = _mm_sub_ps(mul0, mul1);
|
||||
return sub0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_normalize(glm_vec4 v)
|
||||
{
|
||||
glm_vec4 const dot0 = glm_vec4_dot(v, v);
|
||||
glm_vec4 const isr0 = _mm_rsqrt_ps(dot0);
|
||||
glm_vec4 const mul0 = _mm_mul_ps(v, isr0);
|
||||
return mul0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_faceforward(glm_vec4 N, glm_vec4 I, glm_vec4 Nref)
|
||||
{
|
||||
glm_vec4 const dot0 = glm_vec4_dot(Nref, I);
|
||||
glm_vec4 const sgn0 = glm_vec4_sign(dot0);
|
||||
glm_vec4 const mul0 = _mm_mul_ps(sgn0, _mm_set1_ps(-1.0f));
|
||||
glm_vec4 const mul1 = _mm_mul_ps(N, mul0);
|
||||
return mul1;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_vec4 glm_vec4_reflect(glm_vec4 I, glm_vec4 N)
|
||||
{
|
||||
glm_vec4 const dot0 = glm_vec4_dot(N, I);
|
||||
glm_vec4 const mul0 = _mm_mul_ps(N, dot0);
|
||||
glm_vec4 const mul1 = _mm_mul_ps(mul0, _mm_set1_ps(2.0f));
|
||||
glm_vec4 const sub0 = _mm_sub_ps(I, mul1);
|
||||
return sub0;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER __m128 glm_vec4_refract(glm_vec4 I, glm_vec4 N, glm_vec4 eta)
|
||||
{
|
||||
glm_vec4 const dot0 = glm_vec4_dot(N, I);
|
||||
glm_vec4 const mul0 = _mm_mul_ps(eta, eta);
|
||||
glm_vec4 const mul1 = _mm_mul_ps(dot0, dot0);
|
||||
glm_vec4 const sub0 = _mm_sub_ps(_mm_set1_ps(1.0f), mul0);
|
||||
glm_vec4 const sub1 = _mm_sub_ps(_mm_set1_ps(1.0f), mul1);
|
||||
glm_vec4 const mul2 = _mm_mul_ps(sub0, sub1);
|
||||
|
||||
if(_mm_movemask_ps(_mm_cmplt_ss(mul2, _mm_set1_ps(0.0f))) == 0)
|
||||
return _mm_set1_ps(0.0f);
|
||||
|
||||
glm_vec4 const sqt0 = _mm_sqrt_ps(mul2);
|
||||
glm_vec4 const mad0 = glm_vec4_fma(eta, dot0, sqt0);
|
||||
glm_vec4 const mul4 = _mm_mul_ps(mad0, N);
|
||||
glm_vec4 const mul5 = _mm_mul_ps(eta, I);
|
||||
glm_vec4 const sub2 = _mm_sub_ps(mul5, mul4);
|
||||
|
||||
return sub2;
|
||||
}
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
115
common/glm/glm/simd/integer.h
Normal file
115
common/glm/glm/simd/integer.h
Normal file
@ -0,0 +1,115 @@
|
||||
/// @ref simd
|
||||
/// @file glm/simd/integer.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_uvec4 glm_i128_interleave(glm_uvec4 x)
|
||||
{
|
||||
glm_uvec4 const Mask4 = _mm_set1_epi32(0x0000FFFF);
|
||||
glm_uvec4 const Mask3 = _mm_set1_epi32(0x00FF00FF);
|
||||
glm_uvec4 const Mask2 = _mm_set1_epi32(0x0F0F0F0F);
|
||||
glm_uvec4 const Mask1 = _mm_set1_epi32(0x33333333);
|
||||
glm_uvec4 const Mask0 = _mm_set1_epi32(0x55555555);
|
||||
|
||||
glm_uvec4 Reg1;
|
||||
glm_uvec4 Reg2;
|
||||
|
||||
// REG1 = x;
|
||||
// REG2 = y;
|
||||
//Reg1 = _mm_unpacklo_epi64(x, y);
|
||||
Reg1 = x;
|
||||
|
||||
//REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF);
|
||||
//REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF);
|
||||
Reg2 = _mm_slli_si128(Reg1, 2);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask4);
|
||||
|
||||
//REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF);
|
||||
//REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF);
|
||||
Reg2 = _mm_slli_si128(Reg1, 1);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask3);
|
||||
|
||||
//REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F);
|
||||
//REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 4);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask2);
|
||||
|
||||
//REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333);
|
||||
//REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 2);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask1);
|
||||
|
||||
//REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555);
|
||||
//REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 1);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask0);
|
||||
|
||||
//return REG1 | (REG2 << 1);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 1);
|
||||
Reg2 = _mm_srli_si128(Reg2, 8);
|
||||
Reg1 = _mm_or_si128(Reg1, Reg2);
|
||||
|
||||
return Reg1;
|
||||
}
|
||||
|
||||
GLM_FUNC_QUALIFIER glm_uvec4 glm_i128_interleave2(glm_uvec4 x, glm_uvec4 y)
|
||||
{
|
||||
glm_uvec4 const Mask4 = _mm_set1_epi32(0x0000FFFF);
|
||||
glm_uvec4 const Mask3 = _mm_set1_epi32(0x00FF00FF);
|
||||
glm_uvec4 const Mask2 = _mm_set1_epi32(0x0F0F0F0F);
|
||||
glm_uvec4 const Mask1 = _mm_set1_epi32(0x33333333);
|
||||
glm_uvec4 const Mask0 = _mm_set1_epi32(0x55555555);
|
||||
|
||||
glm_uvec4 Reg1;
|
||||
glm_uvec4 Reg2;
|
||||
|
||||
// REG1 = x;
|
||||
// REG2 = y;
|
||||
Reg1 = _mm_unpacklo_epi64(x, y);
|
||||
|
||||
//REG1 = ((REG1 << 16) | REG1) & glm::uint64(0x0000FFFF0000FFFF);
|
||||
//REG2 = ((REG2 << 16) | REG2) & glm::uint64(0x0000FFFF0000FFFF);
|
||||
Reg2 = _mm_slli_si128(Reg1, 2);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask4);
|
||||
|
||||
//REG1 = ((REG1 << 8) | REG1) & glm::uint64(0x00FF00FF00FF00FF);
|
||||
//REG2 = ((REG2 << 8) | REG2) & glm::uint64(0x00FF00FF00FF00FF);
|
||||
Reg2 = _mm_slli_si128(Reg1, 1);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask3);
|
||||
|
||||
//REG1 = ((REG1 << 4) | REG1) & glm::uint64(0x0F0F0F0F0F0F0F0F);
|
||||
//REG2 = ((REG2 << 4) | REG2) & glm::uint64(0x0F0F0F0F0F0F0F0F);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 4);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask2);
|
||||
|
||||
//REG1 = ((REG1 << 2) | REG1) & glm::uint64(0x3333333333333333);
|
||||
//REG2 = ((REG2 << 2) | REG2) & glm::uint64(0x3333333333333333);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 2);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask1);
|
||||
|
||||
//REG1 = ((REG1 << 1) | REG1) & glm::uint64(0x5555555555555555);
|
||||
//REG2 = ((REG2 << 1) | REG2) & glm::uint64(0x5555555555555555);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 1);
|
||||
Reg1 = _mm_or_si128(Reg2, Reg1);
|
||||
Reg1 = _mm_and_si128(Reg1, Mask0);
|
||||
|
||||
//return REG1 | (REG2 << 1);
|
||||
Reg2 = _mm_slli_epi32(Reg1, 1);
|
||||
Reg2 = _mm_srli_si128(Reg2, 8);
|
||||
Reg1 = _mm_or_si128(Reg1, Reg2);
|
||||
|
||||
return Reg1;
|
||||
}
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
1028
common/glm/glm/simd/matrix.h
Normal file
1028
common/glm/glm/simd/matrix.h
Normal file
File diff suppressed because it is too large
Load Diff
8
common/glm/glm/simd/packing.h
Normal file
8
common/glm/glm/simd/packing.h
Normal file
@ -0,0 +1,8 @@
|
||||
/// @ref simd
|
||||
/// @file glm/simd/packing.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
452
common/glm/glm/simd/platform.h
Normal file
452
common/glm/glm/simd/platform.h
Normal file
@ -0,0 +1,452 @@
|
||||
/// @ref simd
|
||||
/// @file glm/simd/platform.h
|
||||
|
||||
#pragma once
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Platform
|
||||
|
||||
#define GLM_PLATFORM_UNKNOWN 0x00000000
|
||||
#define GLM_PLATFORM_WINDOWS 0x00010000
|
||||
#define GLM_PLATFORM_LINUX 0x00020000
|
||||
#define GLM_PLATFORM_APPLE 0x00040000
|
||||
//#define GLM_PLATFORM_IOS 0x00080000
|
||||
#define GLM_PLATFORM_ANDROID 0x00100000
|
||||
#define GLM_PLATFORM_CHROME_NACL 0x00200000
|
||||
#define GLM_PLATFORM_UNIX 0x00400000
|
||||
#define GLM_PLATFORM_QNXNTO 0x00800000
|
||||
#define GLM_PLATFORM_WINCE 0x01000000
|
||||
#define GLM_PLATFORM_CYGWIN 0x02000000
|
||||
|
||||
#ifdef GLM_FORCE_PLATFORM_UNKNOWN
|
||||
# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN
|
||||
#elif defined(__CYGWIN__)
|
||||
# define GLM_PLATFORM GLM_PLATFORM_CYGWIN
|
||||
#elif defined(__QNXNTO__)
|
||||
# define GLM_PLATFORM GLM_PLATFORM_QNXNTO
|
||||
#elif defined(__APPLE__)
|
||||
# define GLM_PLATFORM GLM_PLATFORM_APPLE
|
||||
#elif defined(WINCE)
|
||||
# define GLM_PLATFORM GLM_PLATFORM_WINCE
|
||||
#elif defined(_WIN32)
|
||||
# define GLM_PLATFORM GLM_PLATFORM_WINDOWS
|
||||
#elif defined(__native_client__)
|
||||
# define GLM_PLATFORM GLM_PLATFORM_CHROME_NACL
|
||||
#elif defined(__ANDROID__)
|
||||
# define GLM_PLATFORM GLM_PLATFORM_ANDROID
|
||||
#elif defined(__linux)
|
||||
# define GLM_PLATFORM GLM_PLATFORM_LINUX
|
||||
#elif defined(__unix)
|
||||
# define GLM_PLATFORM GLM_PLATFORM_UNIX
|
||||
#else
|
||||
# define GLM_PLATFORM GLM_PLATFORM_UNKNOWN
|
||||
#endif//
|
||||
|
||||
// Report platform detection
|
||||
#if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_MESSAGE_PLATFORM_DISPLAYED)
|
||||
# define GLM_MESSAGE_PLATFORM_DISPLAYED
|
||||
# if(GLM_PLATFORM & GLM_PLATFORM_QNXNTO)
|
||||
# pragma message("GLM: QNX platform detected")
|
||||
//# elif(GLM_PLATFORM & GLM_PLATFORM_IOS)
|
||||
//# pragma message("GLM: iOS platform detected")
|
||||
# elif(GLM_PLATFORM & GLM_PLATFORM_APPLE)
|
||||
# pragma message("GLM: Apple platform detected")
|
||||
# elif(GLM_PLATFORM & GLM_PLATFORM_WINCE)
|
||||
# pragma message("GLM: WinCE platform detected")
|
||||
# elif(GLM_PLATFORM & GLM_PLATFORM_WINDOWS)
|
||||
# pragma message("GLM: Windows platform detected")
|
||||
# elif(GLM_PLATFORM & GLM_PLATFORM_CHROME_NACL)
|
||||
# pragma message("GLM: Native Client detected")
|
||||
# elif(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
|
||||
# pragma message("GLM: Android platform detected")
|
||||
# elif(GLM_PLATFORM & GLM_PLATFORM_LINUX)
|
||||
# pragma message("GLM: Linux platform detected")
|
||||
# elif(GLM_PLATFORM & GLM_PLATFORM_UNIX)
|
||||
# pragma message("GLM: UNIX platform detected")
|
||||
# elif(GLM_PLATFORM & GLM_PLATFORM_UNKNOWN)
|
||||
# pragma message("GLM: platform unknown")
|
||||
# else
|
||||
# pragma message("GLM: platform not detected")
|
||||
# endif
|
||||
#endif//GLM_MESSAGES
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Compiler
|
||||
|
||||
#define GLM_COMPILER_UNKNOWN 0x00000000
|
||||
|
||||
// Intel
|
||||
#define GLM_COMPILER_INTEL 0x00100000
|
||||
#define GLM_COMPILER_INTEL12 0x00100010
|
||||
#define GLM_COMPILER_INTEL12_1 0x00100020
|
||||
#define GLM_COMPILER_INTEL13 0x00100030
|
||||
#define GLM_COMPILER_INTEL14 0x00100040
|
||||
#define GLM_COMPILER_INTEL15 0x00100050
|
||||
#define GLM_COMPILER_INTEL16 0x00100060
|
||||
|
||||
// Visual C++ defines
|
||||
#define GLM_COMPILER_VC 0x01000000
|
||||
#define GLM_COMPILER_VC10 0x01000090
|
||||
#define GLM_COMPILER_VC11 0x010000A0
|
||||
#define GLM_COMPILER_VC12 0x010000B0
|
||||
#define GLM_COMPILER_VC14 0x010000C0
|
||||
#define GLM_COMPILER_VC15 0x010000D0
|
||||
|
||||
// GCC defines
|
||||
#define GLM_COMPILER_GCC 0x02000000
|
||||
#define GLM_COMPILER_GCC44 0x020000B0
|
||||
#define GLM_COMPILER_GCC45 0x020000C0
|
||||
#define GLM_COMPILER_GCC46 0x020000D0
|
||||
#define GLM_COMPILER_GCC47 0x020000E0
|
||||
#define GLM_COMPILER_GCC48 0x020000F0
|
||||
#define GLM_COMPILER_GCC49 0x02000100
|
||||
#define GLM_COMPILER_GCC50 0x02000200
|
||||
#define GLM_COMPILER_GCC51 0x02000300
|
||||
#define GLM_COMPILER_GCC52 0x02000400
|
||||
#define GLM_COMPILER_GCC53 0x02000500
|
||||
#define GLM_COMPILER_GCC54 0x02000600
|
||||
#define GLM_COMPILER_GCC60 0x02000700
|
||||
#define GLM_COMPILER_GCC61 0x02000800
|
||||
#define GLM_COMPILER_GCC62 0x02000900
|
||||
#define GLM_COMPILER_GCC70 0x02000A00
|
||||
#define GLM_COMPILER_GCC71 0x02000B00
|
||||
#define GLM_COMPILER_GCC72 0x02000C00
|
||||
#define GLM_COMPILER_GCC80 0x02000D00
|
||||
|
||||
// CUDA
|
||||
#define GLM_COMPILER_CUDA 0x10000000
|
||||
#define GLM_COMPILER_CUDA40 0x10000040
|
||||
#define GLM_COMPILER_CUDA41 0x10000050
|
||||
#define GLM_COMPILER_CUDA42 0x10000060
|
||||
#define GLM_COMPILER_CUDA50 0x10000070
|
||||
#define GLM_COMPILER_CUDA60 0x10000080
|
||||
#define GLM_COMPILER_CUDA65 0x10000090
|
||||
#define GLM_COMPILER_CUDA70 0x100000A0
|
||||
#define GLM_COMPILER_CUDA75 0x100000B0
|
||||
#define GLM_COMPILER_CUDA80 0x100000C0
|
||||
|
||||
// Clang
|
||||
#define GLM_COMPILER_CLANG 0x20000000
|
||||
#define GLM_COMPILER_CLANG32 0x20000030
|
||||
#define GLM_COMPILER_CLANG33 0x20000040
|
||||
#define GLM_COMPILER_CLANG34 0x20000050
|
||||
#define GLM_COMPILER_CLANG35 0x20000060
|
||||
#define GLM_COMPILER_CLANG36 0x20000070
|
||||
#define GLM_COMPILER_CLANG37 0x20000080
|
||||
#define GLM_COMPILER_CLANG38 0x20000090
|
||||
#define GLM_COMPILER_CLANG39 0x200000A0
|
||||
#define GLM_COMPILER_CLANG40 0x200000B0
|
||||
#define GLM_COMPILER_CLANG41 0x200000C0
|
||||
#define GLM_COMPILER_CLANG42 0x200000D0
|
||||
|
||||
// Build model
|
||||
#define GLM_MODEL_32 0x00000010
|
||||
#define GLM_MODEL_64 0x00000020
|
||||
|
||||
// Force generic C++ compiler
|
||||
#ifdef GLM_FORCE_COMPILER_UNKNOWN
|
||||
# define GLM_COMPILER GLM_COMPILER_UNKNOWN
|
||||
|
||||
#elif defined(__INTEL_COMPILER)
|
||||
# if __INTEL_COMPILER == 1200
|
||||
# define GLM_COMPILER GLM_COMPILER_INTEL12
|
||||
# elif __INTEL_COMPILER == 1210
|
||||
# define GLM_COMPILER GLM_COMPILER_INTEL12_1
|
||||
# elif __INTEL_COMPILER == 1300
|
||||
# define GLM_COMPILER GLM_COMPILER_INTEL13
|
||||
# elif __INTEL_COMPILER == 1400
|
||||
# define GLM_COMPILER GLM_COMPILER_INTEL14
|
||||
# elif __INTEL_COMPILER == 1500
|
||||
# define GLM_COMPILER GLM_COMPILER_INTEL15
|
||||
# elif __INTEL_COMPILER >= 1600
|
||||
# define GLM_COMPILER GLM_COMPILER_INTEL16
|
||||
# else
|
||||
# define GLM_COMPILER GLM_COMPILER_INTEL
|
||||
# endif
|
||||
|
||||
// CUDA
|
||||
#elif defined(__CUDACC__)
|
||||
# if !defined(CUDA_VERSION) && !defined(GLM_FORCE_CUDA)
|
||||
# include <cuda.h> // make sure version is defined since nvcc does not define it itself!
|
||||
# endif
|
||||
# if CUDA_VERSION < 3000
|
||||
# error "GLM requires CUDA 3.0 or higher"
|
||||
# else
|
||||
# define GLM_COMPILER GLM_COMPILER_CUDA
|
||||
# endif
|
||||
|
||||
// Clang
|
||||
#elif defined(__clang__)
|
||||
# if GLM_PLATFORM & GLM_PLATFORM_APPLE
|
||||
# if __clang_major__ == 5 && __clang_minor__ == 0
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG33
|
||||
# elif __clang_major__ == 5 && __clang_minor__ == 1
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG34
|
||||
# elif __clang_major__ == 6 && __clang_minor__ == 0
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG35
|
||||
# elif __clang_major__ == 6 && __clang_minor__ >= 1
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG36
|
||||
# elif __clang_major__ >= 7
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG37
|
||||
# else
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG
|
||||
# endif
|
||||
# else
|
||||
# if __clang_major__ == 3 && __clang_minor__ == 0
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG30
|
||||
# elif __clang_major__ == 3 && __clang_minor__ == 1
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG31
|
||||
# elif __clang_major__ == 3 && __clang_minor__ == 2
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG32
|
||||
# elif __clang_major__ == 3 && __clang_minor__ == 3
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG33
|
||||
# elif __clang_major__ == 3 && __clang_minor__ == 4
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG34
|
||||
# elif __clang_major__ == 3 && __clang_minor__ == 5
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG35
|
||||
# elif __clang_major__ == 3 && __clang_minor__ == 6
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG36
|
||||
# elif __clang_major__ == 3 && __clang_minor__ == 7
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG37
|
||||
# elif __clang_major__ == 3 && __clang_minor__ == 8
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG38
|
||||
# elif __clang_major__ == 3 && __clang_minor__ >= 9
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG39
|
||||
# elif __clang_major__ == 4 && __clang_minor__ == 0
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG40
|
||||
# elif __clang_major__ == 4 && __clang_minor__ == 1
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG41
|
||||
# elif __clang_major__ == 4 && __clang_minor__ >= 2
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG42
|
||||
# elif __clang_major__ >= 4
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG42
|
||||
# else
|
||||
# define GLM_COMPILER GLM_COMPILER_CLANG
|
||||
# endif
|
||||
# endif
|
||||
|
||||
// Visual C++
|
||||
#elif defined(_MSC_VER)
|
||||
# if _MSC_VER < 1600
|
||||
# error "GLM requires Visual C++ 10 - 2010 or higher"
|
||||
# elif _MSC_VER == 1600
|
||||
# define GLM_COMPILER GLM_COMPILER_VC11
|
||||
# elif _MSC_VER == 1700
|
||||
# define GLM_COMPILER GLM_COMPILER_VC11
|
||||
# elif _MSC_VER == 1800
|
||||
# define GLM_COMPILER GLM_COMPILER_VC12
|
||||
# elif _MSC_VER == 1900
|
||||
# define GLM_COMPILER GLM_COMPILER_VC14
|
||||
# elif _MSC_VER >= 1910
|
||||
# define GLM_COMPILER GLM_COMPILER_VC15
|
||||
# else//_MSC_VER
|
||||
# define GLM_COMPILER GLM_COMPILER_VC
|
||||
# endif//_MSC_VER
|
||||
|
||||
// G++
|
||||
#elif defined(__GNUC__) || defined(__MINGW32__)
|
||||
# if (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC42)
|
||||
# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 3)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC43)
|
||||
# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 4)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC44)
|
||||
# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 5)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC45)
|
||||
# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 6)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC46)
|
||||
# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 7)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC47)
|
||||
# elif (__GNUC__ == 4) && (__GNUC_MINOR__ == 8)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC48)
|
||||
# elif (__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC49)
|
||||
# elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 0)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC50)
|
||||
# elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 1)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC51)
|
||||
# elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 2)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC52)
|
||||
# elif (__GNUC__ == 5) && (__GNUC_MINOR__ == 3)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC53)
|
||||
# elif (__GNUC__ == 5) && (__GNUC_MINOR__ >= 4)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC54)
|
||||
# elif (__GNUC__ == 6) && (__GNUC_MINOR__ == 0)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC60)
|
||||
# elif (__GNUC__ == 6) && (__GNUC_MINOR__ == 1)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC61)
|
||||
# elif (__GNUC__ == 6) && (__GNUC_MINOR__ >= 2)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC62)
|
||||
# elif (__GNUC__ == 7) && (__GNUC_MINOR__ == 0)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC70)
|
||||
# elif (__GNUC__ == 7) && (__GNUC_MINOR__ == 1)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC71)
|
||||
# elif (__GNUC__ == 7) && (__GNUC_MINOR__ == 2)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC72)
|
||||
# elif (__GNUC__ >= 8)
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC80)
|
||||
# else
|
||||
# define GLM_COMPILER (GLM_COMPILER_GCC)
|
||||
# endif
|
||||
|
||||
#else
|
||||
# define GLM_COMPILER GLM_COMPILER_UNKNOWN
|
||||
#endif
|
||||
|
||||
#ifndef GLM_COMPILER
|
||||
# error "GLM_COMPILER undefined, your compiler may not be supported by GLM. Add #define GLM_COMPILER 0 to ignore this message."
|
||||
#endif//GLM_COMPILER
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Instruction sets
|
||||
|
||||
// User defines: GLM_FORCE_PURE GLM_FORCE_SSE2 GLM_FORCE_SSE3 GLM_FORCE_AVX GLM_FORCE_AVX2 GLM_FORCE_AVX2
|
||||
|
||||
#define GLM_ARCH_X86_BIT 0x00000001
|
||||
#define GLM_ARCH_SSE2_BIT 0x00000002
|
||||
#define GLM_ARCH_SSE3_BIT 0x00000004
|
||||
#define GLM_ARCH_SSSE3_BIT 0x00000008
|
||||
#define GLM_ARCH_SSE41_BIT 0x00000010
|
||||
#define GLM_ARCH_SSE42_BIT 0x00000020
|
||||
#define GLM_ARCH_AVX_BIT 0x00000040
|
||||
#define GLM_ARCH_AVX2_BIT 0x00000080
|
||||
#define GLM_ARCH_AVX512_BIT 0x00000100 // Skylake subset
|
||||
#define GLM_ARCH_ARM_BIT 0x00000100
|
||||
#define GLM_ARCH_NEON_BIT 0x00000200
|
||||
#define GLM_ARCH_MIPS_BIT 0x00010000
|
||||
#define GLM_ARCH_PPC_BIT 0x01000000
|
||||
|
||||
#define GLM_ARCH_PURE (0x00000000)
|
||||
#define GLM_ARCH_X86 (GLM_ARCH_X86_BIT)
|
||||
#define GLM_ARCH_SSE2 (GLM_ARCH_SSE2_BIT | GLM_ARCH_X86)
|
||||
#define GLM_ARCH_SSE3 (GLM_ARCH_SSE3_BIT | GLM_ARCH_SSE2)
|
||||
#define GLM_ARCH_SSSE3 (GLM_ARCH_SSSE3_BIT | GLM_ARCH_SSE3)
|
||||
#define GLM_ARCH_SSE41 (GLM_ARCH_SSE41_BIT | GLM_ARCH_SSSE3)
|
||||
#define GLM_ARCH_SSE42 (GLM_ARCH_SSE42_BIT | GLM_ARCH_SSE41)
|
||||
#define GLM_ARCH_AVX (GLM_ARCH_AVX_BIT | GLM_ARCH_SSE42)
|
||||
#define GLM_ARCH_AVX2 (GLM_ARCH_AVX2_BIT | GLM_ARCH_AVX)
|
||||
#define GLM_ARCH_AVX512 (GLM_ARCH_AVX512_BIT | GLM_ARCH_AVX2) // Skylake subset
|
||||
#define GLM_ARCH_ARM (GLM_ARCH_ARM_BIT)
|
||||
#define GLM_ARCH_NEON (GLM_ARCH_NEON_BIT | GLM_ARCH_ARM)
|
||||
#define GLM_ARCH_MIPS (GLM_ARCH_MIPS_BIT)
|
||||
#define GLM_ARCH_PPC (GLM_ARCH_PPC_BIT)
|
||||
|
||||
#if defined(GLM_FORCE_PURE)
|
||||
# define GLM_ARCH GLM_ARCH_PURE
|
||||
#elif defined(GLM_FORCE_MIPS)
|
||||
# define GLM_ARCH (GLM_ARCH_MIPS)
|
||||
#elif defined(GLM_FORCE_PPC)
|
||||
# define GLM_ARCH (GLM_ARCH_PPC)
|
||||
#elif defined(GLM_FORCE_NEON)
|
||||
# define GLM_ARCH (GLM_ARCH_NEON)
|
||||
#elif defined(GLM_FORCE_AVX512)
|
||||
# define GLM_ARCH (GLM_ARCH_AVX512)
|
||||
#elif defined(GLM_FORCE_AVX2)
|
||||
# define GLM_ARCH (GLM_ARCH_AVX2)
|
||||
#elif defined(GLM_FORCE_AVX)
|
||||
# define GLM_ARCH (GLM_ARCH_AVX)
|
||||
#elif defined(GLM_FORCE_SSE42)
|
||||
# define GLM_ARCH (GLM_ARCH_SSE42)
|
||||
#elif defined(GLM_FORCE_SSE41)
|
||||
# define GLM_ARCH (GLM_ARCH_SSE41)
|
||||
#elif defined(GLM_FORCE_SSSE3)
|
||||
# define GLM_ARCH (GLM_ARCH_SSSE3)
|
||||
#elif defined(GLM_FORCE_SSE3)
|
||||
# define GLM_ARCH (GLM_ARCH_SSE3)
|
||||
#elif defined(GLM_FORCE_SSE2)
|
||||
# define GLM_ARCH (GLM_ARCH_SSE2)
|
||||
#elif (GLM_COMPILER & (GLM_COMPILER_CLANG | GLM_COMPILER_GCC)) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_LINUX))
|
||||
// This is Skylake set of instruction set
|
||||
# if defined(__AVX512BW__) && defined(__AVX512F__) && defined(__AVX512CD__) && defined(__AVX512VL__) && defined(__AVX512DQ__)
|
||||
# define GLM_ARCH (GLM_ARCH_AVX512)
|
||||
# elif defined(__AVX2__)
|
||||
# define GLM_ARCH (GLM_ARCH_AVX2)
|
||||
# elif defined(__AVX__)
|
||||
# define GLM_ARCH (GLM_ARCH_AVX)
|
||||
# elif defined(__SSE4_2__)
|
||||
# define GLM_ARCH (GLM_ARCH_SSE42)
|
||||
# elif defined(__SSE4_1__)
|
||||
# define GLM_ARCH (GLM_ARCH_SSE41)
|
||||
# elif defined(__SSSE3__)
|
||||
# define GLM_ARCH (GLM_ARCH_SSSE3)
|
||||
# elif defined(__SSE3__)
|
||||
# define GLM_ARCH (GLM_ARCH_SSE3)
|
||||
# elif defined(__SSE2__)
|
||||
# define GLM_ARCH (GLM_ARCH_SSE2)
|
||||
# elif defined(__i386__) || defined(__x86_64__)
|
||||
# define GLM_ARCH (GLM_ARCH_X86)
|
||||
# elif defined(__ARM_NEON)
|
||||
# define GLM_ARCH (GLM_ARCH_ARM | GLM_ARCH_NEON)
|
||||
# elif defined(__arm__ )
|
||||
# define GLM_ARCH (GLM_ARCH_ARM)
|
||||
# elif defined(__mips__ )
|
||||
# define GLM_ARCH (GLM_ARCH_MIPS)
|
||||
# elif defined(__powerpc__ )
|
||||
# define GLM_ARCH (GLM_ARCH_PPC)
|
||||
# else
|
||||
# define GLM_ARCH (GLM_ARCH_PURE)
|
||||
# endif
|
||||
#elif (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))
|
||||
# if defined(_M_ARM)
|
||||
# define GLM_ARCH (GLM_ARCH_ARM)
|
||||
# elif defined(__AVX2__)
|
||||
# define GLM_ARCH (GLM_ARCH_AVX2)
|
||||
# elif defined(__AVX__)
|
||||
# define GLM_ARCH (GLM_ARCH_AVX)
|
||||
# elif defined(_M_X64)
|
||||
# define GLM_ARCH (GLM_ARCH_SSE2)
|
||||
# elif defined(_M_IX86_FP)
|
||||
# if _M_IX86_FP >= 2
|
||||
# define GLM_ARCH (GLM_ARCH_SSE2)
|
||||
# else
|
||||
# define GLM_ARCH (GLM_ARCH_PURE)
|
||||
# endif
|
||||
# elif defined(_M_PPC)
|
||||
# define GLM_ARCH (GLM_ARCH_PPC)
|
||||
# else
|
||||
# define GLM_ARCH (GLM_ARCH_PURE)
|
||||
# endif
|
||||
#else
|
||||
# define GLM_ARCH GLM_ARCH_PURE
|
||||
#endif
|
||||
|
||||
// With MinGW-W64, including intrinsic headers before intrin.h will produce some errors. The problem is
|
||||
// that windows.h (and maybe other headers) will silently include intrin.h, which of course causes problems.
|
||||
// To fix, we just explicitly include intrin.h here.
|
||||
#if defined(__MINGW64__) && (GLM_ARCH != GLM_ARCH_PURE)
|
||||
# include <intrin.h>
|
||||
#endif
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
# include <immintrin.h>
|
||||
#elif GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
# include <immintrin.h>
|
||||
#elif GLM_ARCH & GLM_ARCH_SSE42_BIT
|
||||
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||
# include <popcntintrin.h>
|
||||
# endif
|
||||
# include <nmmintrin.h>
|
||||
#elif GLM_ARCH & GLM_ARCH_SSE41_BIT
|
||||
# include <smmintrin.h>
|
||||
#elif GLM_ARCH & GLM_ARCH_SSSE3_BIT
|
||||
# include <tmmintrin.h>
|
||||
#elif GLM_ARCH & GLM_ARCH_SSE3_BIT
|
||||
# include <pmmintrin.h>
|
||||
#elif GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
# include <emmintrin.h>
|
||||
#endif//GLM_ARCH
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
typedef __m128 glm_vec4;
|
||||
typedef __m128i glm_ivec4;
|
||||
typedef __m128i glm_uvec4;
|
||||
#endif
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_AVX_BIT
|
||||
typedef __m256d glm_dvec4;
|
||||
#endif
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_AVX2_BIT
|
||||
typedef __m256i glm_i64vec4;
|
||||
typedef __m256i glm_u64vec4;
|
||||
#endif
|
||||
9
common/glm/glm/simd/trigonometric.h
Normal file
9
common/glm/glm/simd/trigonometric.h
Normal file
@ -0,0 +1,9 @@
|
||||
/// @ref simd
|
||||
/// @file glm/simd/trigonometric.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
8
common/glm/glm/simd/vector_relational.h
Normal file
8
common/glm/glm/simd/vector_relational.h
Normal file
@ -0,0 +1,8 @@
|
||||
/// @ref simd
|
||||
/// @file glm/simd/vector_relational.h
|
||||
|
||||
#pragma once
|
||||
|
||||
#if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
|
||||
#endif//GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||
982
common/glm/readme.md
Normal file
982
common/glm/readme.md
Normal file
@ -0,0 +1,982 @@
|
||||

|
||||
|
||||
[OpenGL Mathematics](http://glm.g-truc.net/) (*GLM*) is a header only C++ mathematics library for graphics software based on the [OpenGL Shading Language (GLSL) specifications](https://www.opengl.org/registry/doc/GLSLangSpec.4.50.diff.pdf).
|
||||
|
||||
*GLM* provides classes and functions designed and implemented with the same naming conventions and functionalities than *GLSL* so that anyone who knows *GLSL*, can use *GLM* as well in C++.
|
||||
|
||||
This project isn't limited to *GLSL* features. An extension system, based on the *GLSL* extension conventions, provides extended capabilities: matrix transformations, quaternions, data packing, random numbers, noise, etc...
|
||||
|
||||
This library works perfectly with *[OpenGL](https://www.opengl.org)* but it also ensures interoperability with other third party libraries and SDK. It is a good candidate for software rendering (raytracing / rasterisation), image processing, physic simulations and any development context that requires a simple and convenient mathematics library.
|
||||
|
||||
*GLM* is written in C++98 but can take advantage of C++11 when supported by the compiler. It is a platform independent library with no dependence and it officially supports the following compilers:
|
||||
- [Apple Clang 4.0](https://developer.apple.com/library/mac/documentation/CompilerTools/Conceptual/LLVMCompilerOverview/index.html) and higher
|
||||
- [GCC](http://gcc.gnu.org/) 4.2 and higher
|
||||
- [Intel C++ Composer](https://software.intel.com/en-us/intel-compilers) XE 2013 and higher
|
||||
- [LLVM](http://llvm.org/) 3.0 and higher
|
||||
- [Visual C++](http://www.visualstudio.com/) 2010 and higher
|
||||
- [CUDA](https://developer.nvidia.com/about-cuda) 4.0 and higher (experimental)
|
||||
- Any conform C++98 or C++11 compiler
|
||||
|
||||
For more information about *GLM*, please have a look at the [manual](http://glm.g-truc.net/0.9.7/glm-0.9.7.pdf) and the [API reference documentation](http://glm.g-truc.net/0.9.7/api/index.html).
|
||||
The source code and the documentation are licensed under the [Happy Bunny License (Modified MIT) or the MIT License](./copying.txt).
|
||||
|
||||
Thanks for contributing to the project by [submitting issues](https://github.com/g-truc/glm/issues) for bug reports and feature requests. Any feedback is welcome at [glm@g-truc.net](mailto://glm@g-truc.net).
|
||||
|
||||
|
||||
```c++
|
||||
#include <glm/vec3.hpp> // glm::vec3
|
||||
#include <glm/vec4.hpp> // glm::vec4
|
||||
#include <glm/mat4x4.hpp> // glm::mat4
|
||||
#include <glm/gtc/matrix_transform.hpp> // glm::translate, glm::rotate, glm::scale, glm::perspective
|
||||
#include <glm/gtc/constants.hpp> // glm::pi
|
||||
|
||||
glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
|
||||
{
|
||||
glm::mat4 Projection = glm::perspective(glm::pi<float>() * 0.25f, 4.0f / 3.0f, 0.1f, 100.f);
|
||||
glm::mat4 View = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate));
|
||||
View = glm::rotate(View, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f));
|
||||
View = glm::rotate(View, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f));
|
||||
glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f));
|
||||
return Projection * View * Model;
|
||||
}
|
||||
```
|
||||
|
||||
## Project Health
|
||||
|
||||
| Service | System | Compiler | Status |
|
||||
| ------- | ------ | -------- | ------ |
|
||||
| [Drone](https://drone.io/github.com/g-truc/glm) | Linux 64 bits | GCC 4.6.3 | [](https://drone.io/github.com/g-truc/glm/latest) |
|
||||
|
||||
## [Lastest release](https://github.com/g-truc/glm/releases/latest)
|
||||
|
||||
## Release notes
|
||||
|
||||
#### [GLM 0.9.8.4](https://github.com/g-truc/glm/releases/tag/0.9.8.4) - 2017-01-22
|
||||
##### Fixes:
|
||||
- Fixed GTC_packing test failing on GCC x86 due to denorms #212 #577
|
||||
- Fixed POPCNT optimization build in Clang #512
|
||||
- Fixed intersectRayPlane returns true in parallel case #578
|
||||
- Fixed GCC 6.2 compiler warnings #580
|
||||
- Fixed GTX_matrix_decompose decompose #582 #448
|
||||
- Fixed GCC 4.5 and older build #566
|
||||
- Fixed Visual C++ internal error when declaring a global vec type with siwzzle expression enabled #594
|
||||
- Fixed GLM_FORCE_CXX11 with Clang and libstlc++ which wasn't using C++11 STL features. #604
|
||||
|
||||
#### [GLM 0.9.8.3](https://github.com/g-truc/glm/releases/tag/0.9.8.3) - 2016-11-12
|
||||
##### Improvements:
|
||||
- Broader support of GLM_FORCE_UNRESTRICTED_GENTYPE #378
|
||||
|
||||
##### Fixes:
|
||||
- Fixed Android build error with C++11 compiler but C++98 STL #284 #564
|
||||
- Fixed GTX_transform2 shear* functions #403
|
||||
- Fixed interaction between GLM_FORCE_UNRESTRICTED_GENTYPE and ortho function #568
|
||||
- Fixed bitCount with AVX on 32 bit builds #567
|
||||
- Fixed CMake find_package with version specification #572 #573
|
||||
|
||||
#### [GLM 0.9.8.2](https://github.com/g-truc/glm/releases/tag/0.9.8.2) - 2016-11-01
|
||||
##### Improvements:
|
||||
- Added Visual C++ 15 detection
|
||||
- Added Clang 4.0 detection
|
||||
- Added warning messages when using GLM_FORCE_CXX** but the compiler
|
||||
is known to not fully support the requested C++ version #555
|
||||
- Refactored GLM_COMPILER_VC values
|
||||
- Made quat, vec, mat type component length() static #565
|
||||
|
||||
##### Fixes:
|
||||
- Fixed Visual C++ constexpr build error #555, #556
|
||||
|
||||
#### [GLM 0.9.8.1](https://github.com/g-truc/glm/releases/tag/0.9.8.1) - 2016-09-25
|
||||
##### Improvements:
|
||||
- Optimized quaternion log function #554
|
||||
|
||||
##### Fixes:
|
||||
- Fixed GCC warning filtering, replaced -pedantic by -Wpedantic
|
||||
- Fixed SIMD faceforward bug. #549
|
||||
- Fixed GCC 4.8 with C++11 compilation option #550
|
||||
- Fixed Visual Studio aligned type W4 warning #548
|
||||
- Fixed packing/unpacking function fixed for 5_6_5 and 5_5_5_1 #552
|
||||
|
||||
#### [GLM 0.9.8.0](https://github.com/g-truc/glm/releases/tag/0.9.8.0) - 2016-09-11
|
||||
##### Features:
|
||||
- Added right and left handed projection and clip control support #447 #415 #119
|
||||
- Added compNormalize and compScale functions to GTX_component_wise
|
||||
- Added packF3x9_E1x5 and unpackF3x9_E1x5 to GTC_packing for RGB9E5 #416
|
||||
- Added (un)packHalf to GTC_packing
|
||||
- Added (un)packUnorm and (un)packSnorm to GTC_packing
|
||||
- Added 16bit pack and unpack to GTC_packing
|
||||
- Added 8bit pack and unpack to GTC_packing
|
||||
- Added missing bvec* && and || operators
|
||||
- Added iround and uround to GTC_integer, fast round on positive values
|
||||
- Added raw SIMD API
|
||||
- Added 'aligned' qualifiers
|
||||
- Added GTC_type_aligned with aligned *vec* types
|
||||
- Added GTC_functions extension
|
||||
- Added quaternion version of isnan and isinf #521
|
||||
- Added lowestBitValue to GTX_bit #536
|
||||
- Added GLM_FORCE_UNRESTRICTED_GENTYPE allowing non basic genType #543
|
||||
|
||||
##### Improvements:
|
||||
- Improved SIMD and swizzle operators interactions with GCC and Clang #474
|
||||
- Improved GTC_random linearRand documentation
|
||||
- Improved GTC_reciprocal documentation
|
||||
- Improved GLM_FORCE_EXPLICIT_CTOR coverage #481
|
||||
- Improved OpenMP support detection for Clang, GCC, ICC and VC
|
||||
- Improved GTX_wrap for SIMD friendliness
|
||||
- Added constexpr for *vec*, *mat*, *quat* and *dual_quat* types #493
|
||||
- Added NEON instruction set detection
|
||||
- Added MIPS CPUs detection
|
||||
- Added PowerPC CPUs detection
|
||||
- Use Cuda built-in function for abs function implementation with Cuda compiler
|
||||
- Factorized GLM_COMPILER_LLVM and GLM_COMPILER_APPLE_CLANG into GLM_COMPILER_CLANG
|
||||
- No more warnings for use of long long
|
||||
- Added more information to build messages
|
||||
|
||||
##### Fixes:
|
||||
- Fixed GTX_extended_min_max filename typo #386
|
||||
- Fixed intersectRayTriangle to not do any unintentional backface culling
|
||||
- Fixed long long warnings when using C++98 on GCC and Clang #482
|
||||
- Fixed sign with signed integer function on non-x86 architecture
|
||||
- Fixed strict aliasing warnings #473
|
||||
- Fixed missing vec1 overload to length2 and distance2 functions #431
|
||||
- Fixed GLM test '/fp:fast' and '/Za' command-line options are incompatible
|
||||
- Fixed quaterion to mat3 cast function mat3_cast from GTC_quaternion #542
|
||||
- Fixed GLM_GTX_io for Cuda #547 #546
|
||||
|
||||
##### Deprecation:
|
||||
- Removed GLM_FORCE_SIZE_FUNC define
|
||||
- Deprecated GLM_GTX_simd_vec4 extension
|
||||
- Deprecated GLM_GTX_simd_mat4 extension
|
||||
- Deprecated GLM_GTX_simd_quat extension
|
||||
- Deprecated GLM_SWIZZLE, use GLM_FORCE_SWIZZLE instead
|
||||
- Deprecated GLM_MESSAGES, use GLM_FORCE_MESSAGES instead
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.7.6](https://github.com/g-truc/glm/releases/tag/0.9.7.6) - 2016-07-16
|
||||
##### Improvements:
|
||||
- Added pkg-config file #509
|
||||
- Updated list of compiler versions detected
|
||||
- Improved C++ 11 STL detection #523
|
||||
|
||||
##### Fixes:
|
||||
- Fixed STL for C++11 detection on ICC #510
|
||||
- Fixed missing vec1 overload to length2 and distance2 functions #431
|
||||
- Fixed long long warnings when using C++98 on GCC and Clang #482
|
||||
- Fixed scalar reciprocal functions (GTC_reciprocal) #520
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.7.5](https://github.com/g-truc/glm/releases/tag/0.9.7.5) - 2016-05-24
|
||||
##### Improvements:
|
||||
- Added Visual C++ Clang toolset detection
|
||||
|
||||
##### Fixes:
|
||||
- Fixed uaddCarry warning #497
|
||||
- Fixed roundPowerOfTwo and floorPowerOfTwo #503
|
||||
- Fixed Visual C++ SIMD instruction set automatic detection in 64 bits
|
||||
- Fixed to_string when used with GLM_FORCE_INLINE #506
|
||||
- Fixed GLM_FORCE_INLINE with binary vec4 operators
|
||||
- Fixed GTX_extended_min_max filename typo #386
|
||||
- Fixed intersectRayTriangle to not do any unintentional backface culling
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.7.4](https://github.com/g-truc/glm/releases/tag/0.9.7.4) - 2016-03-19
|
||||
##### Fixes:
|
||||
- Fixed asinh and atanh warning with C++98 STL #484
|
||||
- Fixed polar coordinates function latitude #485
|
||||
- Fixed outerProduct defintions and operator signatures for mat2x4 and vec4 #475
|
||||
- Fixed eulerAngles precision error, returns NaN #451
|
||||
- Fixed undefined reference errors #489
|
||||
- Fixed missing GLM_PLATFORM_CYGWIN declaration #495
|
||||
- Fixed various undefined reference errors #490
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.7.3](https://github.com/g-truc/glm/releases/tag/0.9.7.3) - 2016-02-21
|
||||
##### Improvements:
|
||||
- Added AVX512 detection
|
||||
|
||||
##### Fixes:
|
||||
- Fixed CMake policy warning
|
||||
- Fixed GCC 6.0 detection #477
|
||||
- Fixed Clang build on Windows #479
|
||||
- Fixed 64 bits constants warnings on GCC #463
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.7.2](https://github.com/g-truc/glm/releases/tag/0.9.7.2) - 2016-01-03
|
||||
##### Fixes:
|
||||
- Fixed GTC_round floorMultiple/ceilMultiple #412
|
||||
- Fixed GTC_packing unpackUnorm3x10_1x2 #414
|
||||
- Fixed GTC_matrix_inverse affineInverse #192
|
||||
- Fixed ICC on Linux build errors #449
|
||||
- Fixed ldexp and frexp compilation errors
|
||||
- Fixed "Declaration shadows a field" warning #468
|
||||
- Fixed 'GLM_COMPILER_VC2005 is not defined' warning #468
|
||||
- Fixed various 'X is not defined' warnings #468
|
||||
- Fixed missing unary + operator #435
|
||||
- Fixed Cygwin build errors when using C++11 #405
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.7.1](https://github.com/g-truc/glm/releases/tag/0.9.7.1) - 2015-09-07
|
||||
##### Improvements:
|
||||
- Improved constexpr for constant functions coverage #198
|
||||
- Added to_string for quat and dual_quat in GTX_string_cast #375
|
||||
- Improved overall execution time of unit tests #396
|
||||
|
||||
##### Fixes:
|
||||
- Fixed strict alignment warnings #235 #370
|
||||
- Fixed link errors on compilers not supported default function #377
|
||||
- Fixed compilation warnings in vec4
|
||||
- Fixed non-identity quaternions for equal vectors #234
|
||||
- Fixed excessive GTX_fast_trigonometry execution time #396
|
||||
- Fixed Visual Studio 2015 'hides class member' warnings #394
|
||||
- Fixed builtin bitscan never being used #392
|
||||
- Removed unused func_noise.* files #398
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.7.0](https://github.com/g-truc/glm/releases/tag/0.9.7.0) - 2015-08-02
|
||||
##### Features:
|
||||
- Added GTC_color_space: convertLinearToSRGB and convertSRGBToLinear functions
|
||||
- Added 'fmod' overload to GTX_common with tests #308
|
||||
- Left handed perspective and lookAt functions #314
|
||||
- Added functions eulerAngleXYZ and extractEulerAngleXYZ #311
|
||||
- Added <glm/gtx/hash.hpp> to perform std::hash on GLM types #320 #367
|
||||
- Added <glm/gtx/wrap.hpp> for texcoord wrapping
|
||||
- Added static components and precision members to all vector and quat types #350
|
||||
- Added .gitignore #349
|
||||
- Added support of defaulted functions to GLM types, to use them in unions #366
|
||||
|
||||
##### Improvements:
|
||||
- Changed usage of __has_include to support Intel compiler #307
|
||||
- Specialized integer implementation of YCoCg-R #310
|
||||
- Don't show status message in 'FindGLM' if 'QUIET' option is set. #317
|
||||
- Added master branch continuous integration service on Linux 64 #332
|
||||
- Clarified manual regarding angle unit in GLM, added FAQ 11 #326
|
||||
- Updated list of compiler versions
|
||||
|
||||
##### Fixes:
|
||||
- Fixed default precision for quat and dual_quat type #312
|
||||
- Fixed (u)int64 MSB/LSB handling on BE archs #306
|
||||
- Fixed multi-line comment warning in g++. #315
|
||||
- Fixed specifier removal by 'std::make_pair<>' #333
|
||||
- Fixed perspective fovy argument documentation #327
|
||||
- Removed -m64 causing build issues on Linux 32 #331
|
||||
- Fixed isfinite with C++98 compilers #343
|
||||
- Fixed Intel compiler build error on Linux #354
|
||||
- Fixed use of libstdc++ with Clang #351
|
||||
- Fixed quaternion pow #346
|
||||
- Fixed decompose warnings #373
|
||||
- Fixed matrix conversions #371
|
||||
|
||||
##### Deprecation:
|
||||
- Removed integer specification for 'mod' in GTC_integer #308
|
||||
- Removed GTX_multiple, replaced by GTC_round
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.6.3](https://github.com/g-truc/glm/releases/tag/0.9.6.3) - 2015-02-15
|
||||
- Fixed Android doesn't have C++ 11 STL #284
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.6.2](https://github.com/g-truc/glm/releases/tag/0.9.6.2) - 2015-02-15
|
||||
##### Features:
|
||||
- Added display of GLM version with other GLM_MESSAGES
|
||||
- Added ARM instruction set detection
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
##### Improvements:
|
||||
- Removed assert for perspective with zFar < zNear #298
|
||||
- Added Visual Studio natvis support for vec1, quat and dualqual types
|
||||
- Cleaned up C++11 feature detections
|
||||
- Clarify GLM licensing
|
||||
|
||||
##### Fixes:
|
||||
- Fixed faceforward build #289
|
||||
- Fixed conflict with Xlib #define True 1 #293
|
||||
- Fixed decompose function VS2010 templating issues #294
|
||||
- Fixed mat4x3 = mat2x3 * mat4x2 operator #297
|
||||
- Fixed warnings in F2x11_1x10 packing function in GTC_packing #295
|
||||
- Fixed Visual Studio natvis support for vec4 #288
|
||||
- Fixed GTC_packing *pack*norm*x* build and added tests #292
|
||||
- Disabled GTX_scalar_multiplication for GCC, failing to build tests #242
|
||||
- Fixed Visual C++ 2015 constexpr errors: Disabled only partial support
|
||||
- Fixed functions not inlined with Clang #302
|
||||
- Fixed memory corruption (undefined behaviour) #303
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.6.1](https://github.com/g-truc/glm/releases/tag/0.9.6.1) - 2014-12-10
|
||||
##### Features:
|
||||
- Added GLM_LANG_CXX14_FLAG and GLM_LANG_CXX1Z_FLAG language feature flags
|
||||
- Added C++14 detection
|
||||
|
||||
##### Improvements:
|
||||
- Clean up GLM_MESSAGES compilation log to report only detected capabilities
|
||||
|
||||
##### Fixes:
|
||||
- Fixed scalar uaddCarry build error with Cuda #276
|
||||
- Fixed C++11 explicit conversion operators detection #282
|
||||
- Fixed missing explicit conversion when using integer log2 with *vec1 types
|
||||
- Fixed 64 bits integer GTX_string_cast to_string on VC 32 bit compiler
|
||||
- Fixed Android build issue, STL C++11 is not supported by the NDK #284
|
||||
- Fixed unsupported _BitScanForward64 and _BitScanReverse64 in VC10
|
||||
- Fixed Visual C++ 32 bit build #283
|
||||
- Fixed GLM_FORCE_SIZE_FUNC pragma message
|
||||
- Fixed C++98 only build
|
||||
- Fixed conflict between GTX_compatibility and GTC_quaternion #286
|
||||
- Fixed C++ language restriction using GLM_FORCE_CXX**
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.6.0](https://github.com/g-truc/glm/releases/tag/0.9.6.0) - 2014-11-30
|
||||
##### Features:
|
||||
- Exposed template vector and matrix types in 'glm' namespace #239, #244
|
||||
- Added GTX_scalar_multiplication for C++ 11 compiler only #242
|
||||
- Added GTX_range for C++ 11 compiler only #240
|
||||
- Added closestPointOnLine function for tvec2 to GTX_closest_point #238
|
||||
- Added GTC_vec1 extension, *vec1 support to *vec* types
|
||||
- Updated GTX_associated_min_max with vec1 support
|
||||
- Added support of precision and integers to linearRand #230
|
||||
- Added Integer types support to GTX_string_cast #249
|
||||
- Added vec3 slerp #237
|
||||
- Added GTX_common with isdenomal #223
|
||||
- Added GLM_FORCE_SIZE_FUNC to replace .length() by .size() #245
|
||||
- Added GLM_FORCE_NO_CTOR_INIT
|
||||
- Added 'uninitialize' to explicitly not initialize a GLM type
|
||||
- Added GTC_bitfield extension, promoted GTX_bit
|
||||
- Added GTC_integer extension, promoted GTX_bit and GTX_integer
|
||||
- Added GTC_round extension, promoted GTX_bit
|
||||
- Added GLM_FORCE_EXPLICIT_CTOR to require explicit type conversions #269
|
||||
- Added GTX_type_aligned for aligned vector, matrix and quaternion types
|
||||
|
||||
##### Improvements:
|
||||
- Rely on C++11 to implement isinf and isnan
|
||||
- Removed GLM_FORCE_CUDA, Cuda is implicitly detected
|
||||
- Separated Apple Clang and LLVM compiler detection
|
||||
- Used pragma once
|
||||
- Undetected C++ compiler automatically compile with GLM_FORCE_CXX98 and
|
||||
GLM_FORCE_PURE
|
||||
- Added not function (from GLSL specification) on VC12
|
||||
- Optimized bitfieldReverse and bitCount functions
|
||||
- Optimized findLSB and findMSB functions.
|
||||
- Optimized matrix-vector multiple performance with Cuda #257, #258
|
||||
- Reduced integer type redifinitions #233
|
||||
- Rewrited of GTX_fast_trigonometry #264 #265
|
||||
- Made types trivially copyable #263
|
||||
- Removed <iostream> in GLM tests
|
||||
- Used std features within GLM without redeclaring
|
||||
- Optimized cot function #272
|
||||
- Optimized sign function #272
|
||||
- Added explicit cast from quat to mat3 and mat4 #275
|
||||
|
||||
##### Fixes:
|
||||
- Fixed std::nextafter not supported with C++11 on Android #217
|
||||
- Fixed missing value_type for dual quaternion
|
||||
- Fixed return type of dual quaternion length
|
||||
- Fixed infinite loop in isfinite function with GCC #221
|
||||
- Fixed Visual Studio 14 compiler warnings
|
||||
- Fixed implicit conversion from another tvec2 type to another tvec2 #241
|
||||
- Fixed lack of consistency of quat and dualquat constructors
|
||||
- Fixed uaddCarray #253
|
||||
- Fixed float comparison warnings #270
|
||||
|
||||
##### Deprecation:
|
||||
- Removed degrees for function parameters
|
||||
- Removed GLM_FORCE_RADIANS, active by default
|
||||
- Removed VC 2005 / 8 and 2008 / 9 support
|
||||
- Removed GCC 3.4 to 4.3 support
|
||||
- Removed LLVM GCC support
|
||||
- Removed LLVM 2.6 to 3.1 support
|
||||
- Removed CUDA 3.0 to 3.2 support
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.5.4 - 2014-06-21](https://github.com/g-truc/glm/releases/tag/0.9.5.4)
|
||||
- Fixed non-utf8 character #196
|
||||
- Added FindGLM install for CMake #189
|
||||
- Fixed GTX_color_space - saturation #195
|
||||
- Fixed glm::isinf and glm::isnan for with Android NDK 9d #191
|
||||
- Fixed builtin GLM_ARCH_SSE4 #204
|
||||
- Optimized Quaternion vector rotation #205
|
||||
- Fixed missing doxygen @endcond tag #211
|
||||
- Fixed instruction set detection with Clang #158
|
||||
- Fixed orientate3 function #207
|
||||
- Fixed lerp when cosTheta is close to 1 in quaternion slerp #210
|
||||
- Added GTX_io for io with <iostream> #144
|
||||
- Fixed fastDistance ambiguity #215
|
||||
- Fixed tweakedInfinitePerspective #208 and added user-defined epsilon to
|
||||
tweakedInfinitePerspective
|
||||
- Fixed std::copy and std::vector with GLM types #214
|
||||
- Fixed strict aliasing issues #212, #152
|
||||
- Fixed std::nextafter not supported with C++11 on Android #213
|
||||
- Fixed corner cases in exp and log functions for quaternions #199
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.5.3 - 2014-04-02
|
||||
- Added instruction set auto detection with Visual C++ using _M_IX86_FP - /arch
|
||||
compiler argument
|
||||
- Fixed GTX_raw_data code dependency
|
||||
- Fixed GCC instruction set detection
|
||||
- Added GLM_GTX_matrix_transform_2d extension (#178, #176)
|
||||
- Fixed CUDA issues (#169, #168, #183, #182)
|
||||
- Added support for all extensions but GTX_string_cast to CUDA
|
||||
- Fixed strict aliasing warnings in GCC 4.8.1 / Android NDK 9c (#152)
|
||||
- Fixed missing bitfieldInterleave definisions
|
||||
- Fixed usubBorrow (#171)
|
||||
- Fixed eulerAngle*** not consistent for right-handed coordinate system (#173)
|
||||
- Added full tests for eulerAngle*** functions (#173)
|
||||
- Added workaround for a CUDA compiler bug (#186, #185)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.5.2 - 2014-02-08
|
||||
- Fixed initializer list ambiguity (#159, #160)
|
||||
- Fixed warnings with the Android NDK 9c
|
||||
- Fixed non power of two matrix products
|
||||
- Fixed mix function link error
|
||||
- Fixed SSE code included in GLM tests on "pure" platforms
|
||||
- Fixed undefined reference to fastInverseSqrt (#161)
|
||||
- Fixed GLM_FORCE_RADIANS with <glm/ext.hpp> build error (#165)
|
||||
- Fix dot product clamp range for vector angle functions. (#163)
|
||||
- Tentative fix for strict aliasing warning in GCC 4.8.1 / Android NDK 9c (#152)
|
||||
- Fixed GLM_GTC_constants description brief (#162)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.5.1 - 2014-01-11
|
||||
- Fixed angle and orientedAngle that sometimes return NaN values (#145)
|
||||
- Deprecated degrees for function parameters and display a message
|
||||
- Added possible static_cast conversion of GLM types (#72)
|
||||
- Fixed error 'inverse' is not a member of 'glm' from glm::unProject (#146)
|
||||
- Fixed mismatch between some declarations and definitions
|
||||
- Fixed inverse link error when using namespace glm; (#147)
|
||||
- Optimized matrix inverse and division code (#149)
|
||||
- Added intersectRayPlane function (#153)
|
||||
- Fixed outerProduct return type (#155)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.5.0 - 2013-12-25
|
||||
- Added forward declarations (glm/fwd.hpp) for faster compilations
|
||||
- Added per feature headers
|
||||
- Minimized GLM internal dependencies
|
||||
- Improved Intel Compiler detection
|
||||
- Added bitfieldInterleave and _mm_bit_interleave_si128 functions
|
||||
- Added GTX_scalar_relational
|
||||
- Added GTX_dual_quaternion
|
||||
- Added rotation function to GTX_quaternion (#22)
|
||||
- Added precision variation of each type
|
||||
- Added quaternion comparison functions
|
||||
- Fixed GTX_multiple for negative value
|
||||
- Removed GTX_ocl_type extension
|
||||
- Fixed post increment and decrement operators
|
||||
- Fixed perspective with zNear == 0 (#71)
|
||||
- Removed l-value swizzle operators
|
||||
- Cleaned up compiler detection code for unsupported compilers
|
||||
- Replaced C cast by C++ casts
|
||||
- Fixed .length() that should return a int and not a size_t
|
||||
- Added GLM_FORCE_SIZE_T_LENGTH and glm::length_t
|
||||
- Removed unnecessary conversions
|
||||
- Optimized packing and unpacking functions
|
||||
- Removed the normalization of the up argument of lookAt function (#114)
|
||||
- Added low precision specializations of inversesqrt
|
||||
- Fixed ldexp and frexp implementations
|
||||
- Increased assert coverage
|
||||
- Increased static_assert coverage
|
||||
- Replaced GLM traits by STL traits when possible
|
||||
- Allowed including individual core feature
|
||||
- Increased unit tests completness
|
||||
- Added creating of a quaternion from two vectors
|
||||
- Added C++11 initializer lists
|
||||
- Fixed umulExtended and imulExtended implementations for vector types (#76)
|
||||
- Fixed CUDA coverage for GTC extensions
|
||||
- Added GTX_io extension
|
||||
- Improved GLM messages enabled when defining GLM_MESSAGES
|
||||
- Hidden matrix _inverse function implementation detail into private section
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.4.6](https://github.com/g-truc/glm/releases/tag/0.9.4.6) - 2013-09-20
|
||||
- Fixed detection to select the last known compiler if newer version #106
|
||||
- Fixed is_int and is_uint code duplication with GCC and C++11 #107
|
||||
- Fixed test suite build while using Clang in C++11 mode
|
||||
- Added c++1y mode support in CMake test suite
|
||||
- Removed ms extension mode to CMake when no using Visual C++
|
||||
- Added pedantic mode to CMake test suite for Clang and GCC
|
||||
- Added use of GCC frontend on Unix for ICC and Visual C++ fronted on Windows
|
||||
for ICC
|
||||
- Added compilation errors for unsupported compiler versions
|
||||
- Fixed glm::orientation with GLM_FORCE_RADIANS defined #112
|
||||
- Fixed const ref issue on assignment operator taking a scalar parameter #116
|
||||
- Fixed glm::eulerAngleY implementation #117
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.4.5 - 2013-08-12
|
||||
- Fixed CUDA support
|
||||
- Fixed inclusion of intrinsics in "pure" mode #92
|
||||
- Fixed language detection on GCC when the C++0x mode isn't enabled #95
|
||||
- Fixed issue #97: register is deprecated in C++11
|
||||
- Fixed issue #96: CUDA issues
|
||||
- Added Windows CE detection #92
|
||||
- Added missing value_ptr for quaternions #99
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.4.4 - 2013-05-29
|
||||
- Fixed slerp when costheta is close to 1 #65
|
||||
- Fixed mat4x2 value_type constructor #70
|
||||
- Fixed glm.natvis for Visual C++ 12 #82
|
||||
- Added assert in inversesqrt to detect division by zero #61
|
||||
- Fixed missing swizzle operators #86
|
||||
- Fixed CUDA warnings #86
|
||||
- Fixed GLM natvis for VC11 #82
|
||||
- Fixed GLM_GTX_multiple with negative values #79
|
||||
- Fixed glm::perspective when zNear is zero #71
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.4.3 - 2013-03-20
|
||||
- Detected qualifier for Clang
|
||||
- Fixed C++11 mode for GCC, couldn't be enabled without MS extensions
|
||||
- Fixed squad, intermediate and exp quaternion functions
|
||||
- Fixed GTX_polar_coordinates euclidean function, takes a vec2 instead of a vec3
|
||||
- Clarify the license applying on the manual
|
||||
- Added a docx copy of the manual
|
||||
- Fixed GLM_GTX_matrix_interpolation
|
||||
- Fixed isnan and isinf on Android with Clang
|
||||
- Autodetected C++ version using __cplusplus value
|
||||
- Fixed mix for bool and bvec* third parameter
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.4.2 - 2013-02-14
|
||||
- Fixed compAdd from GTX_component_wise
|
||||
- Fixed SIMD support for Intel compiler on Windows
|
||||
- Fixed isnan and isinf for CUDA compiler
|
||||
- Fixed GLM_FORCE_RADIANS on glm::perspective
|
||||
- Fixed GCC warnings
|
||||
- Fixed packDouble2x32 on Xcode
|
||||
- Fixed mix for vec4 SSE implementation
|
||||
- Fixed 0x2013 dash character in comments that cause issue in Windows
|
||||
Japanese mode
|
||||
- Fixed documentation warnings
|
||||
- Fixed CUDA warnings
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.4.1 - 2012-12-22
|
||||
- Improved half support: -0.0 case and implicit conversions
|
||||
- Fixed Intel Composer Compiler support on Linux
|
||||
- Fixed interaction between quaternion and euler angles
|
||||
- Fixed GTC_constants build
|
||||
- Fixed GTX_multiple
|
||||
- Fixed quat slerp using mix function when cosTheta close to 1
|
||||
- Improved fvec4SIMD and fmat4x4SIMD implementations
|
||||
- Fixed assert messages
|
||||
- Added slerp and lerp quaternion functions and tests
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.4.0 - 2012-11-18
|
||||
- Added Intel Composer Compiler support
|
||||
- Promoted GTC_espilon extension
|
||||
- Promoted GTC_ulp extension
|
||||
- Removed GLM website from the source repository
|
||||
- Added GLM_FORCE_RADIANS so that all functions takes radians for arguments
|
||||
- Fixed detection of Clang and LLVM GCC on MacOS X
|
||||
- Added debugger visualizers for Visual C++ 2012
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.3.4](https://github.com/g-truc/glm/releases/tag/0.9.3.4) - 2012-06-30
|
||||
- Added SSE4 and AVX2 detection.
|
||||
- Removed VIRTREV_xstream and the incompatibility generated with GCC
|
||||
- Fixed C++11 compiler option for GCC
|
||||
- Removed MS language extension option for GCC (not fonctionnal)
|
||||
- Fixed bitfieldExtract for vector types
|
||||
- Fixed warnings
|
||||
- Fixed SSE includes
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.3.3 - 2012-05-10
|
||||
- Fixed isinf and isnan
|
||||
- Improved compatibility with Intel compiler
|
||||
- Added CMake test build options: SIMD, C++11, fast math and MS land ext
|
||||
- Fixed SIMD mat4 test on GCC
|
||||
- Fixed perspectiveFov implementation
|
||||
- Fixed matrixCompMult for none-square matrices
|
||||
- Fixed namespace issue on stream operators
|
||||
- Fixed various warnings
|
||||
- Added VC11 support
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.3.2 - 2012-03-15
|
||||
- Fixed doxygen documentation
|
||||
- Fixed Clang version detection
|
||||
- Fixed simd mat4 /= operator
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.3.1 - 2012-01-25
|
||||
- Fixed platform detection
|
||||
- Fixed warnings
|
||||
- Removed detail code from Doxygen doc
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.3.0 - 2012-01-09
|
||||
- Added CPP Check project
|
||||
- Fixed conflict with Windows headers
|
||||
- Fixed isinf implementation
|
||||
- Fixed Boost conflict
|
||||
- Fixed warnings
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.3.B - 2011-12-12
|
||||
- Added support for Chrone Native Client
|
||||
- Added epsilon constant
|
||||
- Removed value_size function from vector types
|
||||
- Fixed roundEven on GCC
|
||||
- Improved API documentation
|
||||
- Fixed modf implementation
|
||||
- Fixed step function accuracy
|
||||
- Fixed outerProduct
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.3.A - 2011-11-11
|
||||
- Improved doxygen documentation
|
||||
- Added new swizzle operators for C++11 compilers
|
||||
- Added new swizzle operators declared as functions
|
||||
- Added GLSL 4.20 length for vector and matrix types
|
||||
- Promoted GLM_GTC_noise extension: simplex, perlin, periodic noise functions
|
||||
- Promoted GLM_GTC_random extension: linear, gaussian and various random number
|
||||
generation distribution
|
||||
- Added GLM_GTX_constants: provides useful constants
|
||||
- Added extension versioning
|
||||
- Removed many unused namespaces
|
||||
- Fixed half based type contructors
|
||||
- Added GLSL core noise functions
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.2.7](https://github.com/g-truc/glm/releases/tag/0.9.2.7) - 2011-10-24
|
||||
- Added more swizzling constructors
|
||||
- Added missing none-squared matrix products
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.2.6](https://github.com/g-truc/glm/releases/tag/0.9.2.6) - 2011-10-01
|
||||
- Fixed half based type build on old GCC
|
||||
- Fixed /W4 warnings on Visual C++
|
||||
- Fixed some missing l-value swizzle operators
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.2.5 - 2011-09-20
|
||||
- Fixed floatBitToXint functions
|
||||
- Fixed pack and unpack functions
|
||||
- Fixed round functions
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.2.4 - 2011-09-03
|
||||
- Fixed extensions bugs
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.2.3 - 2011-06-08
|
||||
- Fixed build issues
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.2.2 - 2011-06-02
|
||||
- Expend matrix constructors flexibility
|
||||
- Improved quaternion implementation
|
||||
- Fixed many warnings across platforms and compilers
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.2.1 - 2011-05-24
|
||||
- Automatically detect CUDA support
|
||||
- Improved compiler detection
|
||||
- Fixed errors and warnings in VC with C++ extensions disabled
|
||||
- Fixed and tested GLM_GTX_vector_angle
|
||||
- Fixed and tested GLM_GTX_rotate_vector
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.2.0 - 2011-05-09
|
||||
- Added CUDA support
|
||||
- Added CTest test suite
|
||||
- Added GLM_GTX_ulp extension
|
||||
- Added GLM_GTX_noise extension
|
||||
- Added GLM_GTX_matrix_interpolation extension
|
||||
- Updated quaternion slerp interpolation
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.1.3](https://github.com/g-truc/glm/releases/tag/0.9.1.3) - 2011-05-07
|
||||
- Fixed bugs
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.1.2 - 2011-04-15
|
||||
- Fixed bugs
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.1.1 - 2011-03-17
|
||||
- Fixed bugs
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.1.0 - 2011-03-03
|
||||
- Fixed bugs
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.1.B - 2011-02-13
|
||||
- Updated API documentation
|
||||
- Improved SIMD implementation
|
||||
- Fixed Linux build
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.0.8](https://github.com/g-truc/glm/releases/tag/0.9.0.8) - 2011-02-13
|
||||
- Added quaternion product operator.
|
||||
- Clarify that GLM is a header only library.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.1.A - 2011-01-31
|
||||
- Added SIMD support
|
||||
- Added new swizzle functions
|
||||
- Improved static assert error message with C++0x static_assert
|
||||
- New setup system
|
||||
- Reduced branching
|
||||
- Fixed trunc implementation
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### [GLM 0.9.0.7](https://github.com/g-truc/glm/releases/tag/0.9.0.7) - 2011-01-30
|
||||
- Added GLSL 4.10 packing functions
|
||||
- Added == and != operators for every types.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.0.6 - 2010-12-21
|
||||
- Many matrices bugs fixed
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.0.5 - 2010-11-01
|
||||
- Improved Clang support
|
||||
- Fixed bugs
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.0.4 - 2010-10-04
|
||||
- Added autoexp for GLM
|
||||
- Fixed bugs
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.0.3 - 2010-08-26
|
||||
- Fixed non-squared matrix operators
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.0.2 - 2010-07-08
|
||||
- Added GLM_GTX_int_10_10_10_2
|
||||
- Fixed bugs
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.0.1 - 2010-06-21
|
||||
- Fixed extensions errors
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.0.0 - 2010-05-25
|
||||
- Objective-C support
|
||||
- Fixed warnings
|
||||
- Updated documentation
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.B.2 - 2010-04-30
|
||||
- Git transition
|
||||
- Removed experimental code from releases
|
||||
- Fixed bugs
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.B.1 - 2010-04-03
|
||||
- Based on GLSL 4.00 specification
|
||||
- Added the new core functions
|
||||
- Added some implicit conversion support
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.A.2 - 2010-02-20
|
||||
- Improved some possible errors messages
|
||||
- Improved declarations and definitions match
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.9.A.1 - 2010-02-09
|
||||
- Removed deprecated features
|
||||
- Internal redesign
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.4.4 final - 2010-01-25
|
||||
- Fixed warnings
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.4.3 final - 2009-11-16
|
||||
- Fixed Half float arithmetic
|
||||
- Fixed setup defines
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.4.2 final - 2009-10-19
|
||||
- Fixed Half float adds
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.4.1 final - 2009-10-05
|
||||
- Updated documentation
|
||||
- Fixed MacOS X build
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.4.0 final - 2009-09-16
|
||||
- Added GCC 4.4 and VC2010 support
|
||||
- Added matrix optimizations
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.3.5 final - 2009-08-11
|
||||
- Fixed bugs
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.3.4 final - 2009-08-10
|
||||
- Updated GLM according GLSL 1.5 spec
|
||||
- Fixed bugs
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.3.3 final - 2009-06-25
|
||||
- Fixed bugs
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.3.2 final - 2009-06-04
|
||||
- Added GLM_GTC_quaternion
|
||||
- Added GLM_GTC_type_precision
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.3.1 final - 2009-05-21
|
||||
- Fixed old extension system.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.3.0 final - 2009-05-06
|
||||
- Added stable extensions.
|
||||
- Added new extension system.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.2.3 final - 2009-04-01
|
||||
- Fixed bugs.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.2.2 final - 2009-02-24
|
||||
- Fixed bugs.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.2.1 final - 2009-02-13
|
||||
- Fixed bugs.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.2 final - 2009-01-21
|
||||
- Fixed bugs.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.1 final - 2008-10-30
|
||||
- Fixed bugs.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.0 final - 2008-10-23
|
||||
- New method to use extension.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.0 beta3 - 2008-10-10
|
||||
- Added CMake support for GLM tests.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.0 beta2 - 2008-10-04
|
||||
- Improved half scalars and vectors support.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.8.0 beta1 - 2008-09-26
|
||||
- Improved GLSL conformance
|
||||
- Added GLSL 1.30 support
|
||||
- Improved API documentation
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.7.6 final - 2008-08-08
|
||||
- Improved C++ standard comformance
|
||||
- Added Static assert for types checking
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.7.5 final - 2008-07-05
|
||||
- Added build message system with Visual Studio
|
||||
- Pedantic build with GCC
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.7.4 final - 2008-06-01
|
||||
- Added external dependencies system.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.7.3 final - 2008-05-24
|
||||
- Fixed bugs
|
||||
- Added new extension group
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.7.2 final - 2008-04-27
|
||||
- Updated documentation
|
||||
- Added preprocessor options
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.7.1 final - 2008-03-24
|
||||
- Disabled half on GCC
|
||||
- Fixed extensions
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.7.0 final - 2008-03-22
|
||||
- Changed to MIT license
|
||||
- Added new documentation
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.6.4 - 2007-12-10
|
||||
- Fixed swizzle operators
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.6.3 - 2007-11-05
|
||||
- Fixed type data accesses
|
||||
- Fixed 3DSMax sdk conflict
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.6.2 - 2007-10-08
|
||||
- Fixed extension
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.6.1 - 2007-10-07
|
||||
- Fixed a namespace error
|
||||
- Added extensions
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.6.0 : 2007-09-16
|
||||
- Added new extension namespace mecanium
|
||||
- Added Automatic compiler detection
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.5.1 - 2007-02-19
|
||||
- Fixed swizzle operators
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.5.0 - 2007-01-06
|
||||
- Upgrated to GLSL 1.2
|
||||
- Added swizzle operators
|
||||
- Added setup settings
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.4.1 - 2006-05-22
|
||||
- Added OpenGL examples
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.4.0 - 2006-05-17
|
||||
- Added missing operators to vec* and mat*
|
||||
- Added first GLSL 1.2 features
|
||||
- Fixed windows.h before glm.h when windows.h required
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.3.2 - 2006-04-21
|
||||
- Fixed texcoord components access.
|
||||
- Fixed mat4 and imat4 division operators.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.3.1 - 2006-03-28
|
||||
- Added GCC 4.0 support under MacOS X.
|
||||
- Added GCC 4.0 and 4.1 support under Linux.
|
||||
- Added code optimisations.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.3 - 2006-02-19
|
||||
- Improved GLSL type conversion and construction compliance.
|
||||
- Added experimental extensions.
|
||||
- Added Doxygen Documentation.
|
||||
- Added code optimisations.
|
||||
- Fixed bugs.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.2 - 2005-05-05
|
||||
- Improve adaptative from GLSL.
|
||||
- Add experimental extensions based on OpenGL extension process.
|
||||
- Fixe bugs.
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
#### GLM 0.1 - 2005-02-21
|
||||
- Add vec2, vec3, vec4 GLSL types
|
||||
- Add ivec2, ivec3, ivec4 GLSL types
|
||||
- Add bvec2, bvec3, bvec4 GLSL types
|
||||
- Add mat2, mat3, mat4 GLSL types
|
||||
- Add almost all functions
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user