mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 12:41:54 +00:00
Fixed Visual C++ vec4 simd specification code path
This commit is contained in:
parent
5f1bb47bf2
commit
d01630079c
@ -93,6 +93,7 @@ namespace detail
|
||||
# if(GLM_HAS_ANONYMOUS_UNION && defined(GLM_SWIZZLE))
|
||||
union
|
||||
{
|
||||
typename simd<T>::type data;
|
||||
struct { T r, g, b, a; };
|
||||
struct { T s, t, p, q; };
|
||||
struct { T x, y, z, w;};
|
||||
|
@ -108,13 +108,13 @@ namespace detail
|
||||
template <>
|
||||
template <precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, lowp>::tvec4(tvec4<float, Q> const & v) :
|
||||
data(_mm_set_ps(w, z, y, x))
|
||||
data(_mm_set_ps(v.w, v.z, v.y, v.x))
|
||||
{}
|
||||
|
||||
template <>
|
||||
template <precision Q>
|
||||
GLM_FUNC_QUALIFIER tvec4<float, mediump>::tvec4(tvec4<float, Q> const & v) :
|
||||
data(_mm_set_ps(w, z, y, x))
|
||||
data(_mm_set_ps(v.w, v.z, v.y, v.x))
|
||||
{}
|
||||
#endif
|
||||
|
||||
|
@ -13,30 +13,8 @@
|
||||
|
||||
#if(GLM_ARCH != GLM_ARCH_PURE)
|
||||
|
||||
|
||||
struct value
|
||||
{
|
||||
value(float x, float y, float z, float w) :
|
||||
x(x), y(y), z(z), w(w)
|
||||
{}
|
||||
|
||||
union
|
||||
{
|
||||
__m128 data;
|
||||
struct
|
||||
{
|
||||
union { float x, r, s; };
|
||||
union { float y, g, t; };
|
||||
union { float z, b, p; };
|
||||
union { float w, a, q; };
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
int main()
|
||||
{
|
||||
value Value(1.0, 0.5, 0.0, 0.7);
|
||||
|
||||
glm::simdVec4 A1(0.0f, 0.1f, 0.2f, 0.3f);
|
||||
glm::simdVec4 B1(0.4f, 0.5f, 0.6f, 0.7f);
|
||||
glm::simdVec4 C1 = A1 + B1;
|
||||
|
Loading…
Reference in New Issue
Block a user