mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 12:41:54 +00:00
All the vec4 geometry functions have SIMD optimizations
This commit is contained in:
parent
b5521ca7c2
commit
449c7ccedf
@ -5,6 +5,24 @@
|
|||||||
namespace glm{
|
namespace glm{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
|
template <precision P>
|
||||||
|
struct compute_length<tvec4, float, P>
|
||||||
|
{
|
||||||
|
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const & v)
|
||||||
|
{
|
||||||
|
return _mm_cvtss_f32(glm_f32v4_len(v.data));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
template <precision P>
|
||||||
|
struct compute_distance<tvec4, float, P>
|
||||||
|
{
|
||||||
|
GLM_FUNC_QUALIFIER static float call(tvec4<float, P> const & p0, tvec4<float, P> const & p1)
|
||||||
|
{
|
||||||
|
return _mm_cvtss_f32(glm_f32v4_dst(p0.data, p1.data));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
template <precision P>
|
template <precision P>
|
||||||
struct compute_dot<tvec4, float, P>
|
struct compute_dot<tvec4, float, P>
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user