mirror of
https://github.com/g-truc/glm.git
synced 2025-04-13 08:43:00 +00:00
All the vec4 geometry functions have SIMD optimizations
This commit is contained in:
parent
b5521ca7c2
commit
449c7ccedf
1 changed files with 18 additions and 0 deletions
|
@ -5,6 +5,24 @@
|
|||
namespace glm{
|
||||
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>
|
||||
struct compute_dot<tvec4, float, P>
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue