diff --git a/glm/detail/type_vec.hpp b/glm/detail/type_vec.hpp index 2fe33407..11b25347 100644 --- a/glm/detail/type_vec.hpp +++ b/glm/detail/type_vec.hpp @@ -10,7 +10,7 @@ namespace glm{ namespace detail { template - struct simd_data + struct storage { typedef struct type { uint8 data[size]; @@ -18,7 +18,7 @@ namespace detail }; template - struct simd_data + struct storage { typedef GLM_ALIGNED_STRUCT(size) type { uint8 data[size]; @@ -27,19 +27,19 @@ namespace detail # if GLM_ARCH & GLM_ARCH_SSE2_BIT template <> - struct simd_data + struct storage { typedef glm_vec4 type; }; template <> - struct simd_data + struct storage { typedef glm_ivec4 type; }; template <> - struct simd_data + struct storage { typedef glm_uvec4 type; }; @@ -47,7 +47,7 @@ namespace detail # if (GLM_ARCH & GLM_ARCH_AVX_BIT) template <> - struct simd_data + struct storage { typedef glm_dvec4 type; }; @@ -55,13 +55,13 @@ namespace detail # if (GLM_ARCH & GLM_ARCH_AVX2_BIT) template <> - struct simd_data + struct storage { typedef glm_i64vec4 type; }; template <> - struct simd_data + struct storage { typedef glm_u64vec4 type; }; diff --git a/glm/detail/type_vec4.hpp b/glm/detail/type_vec4.hpp index f93d6f73..5b5c7b3a 100644 --- a/glm/detail/type_vec4.hpp +++ b/glm/detail/type_vec4.hpp @@ -34,7 +34,7 @@ namespace glm struct { T r, g, b, a; }; struct { T s, t, p, q; }; - typename detail::simd_data::value>::type data; + typename detail::storage::value>::type data; # ifdef GLM_SWIZZLE _GLM_SWIZZLE4_2_MEMBERS(T, P, glm::tvec2, x, y, z, w) diff --git a/test/gtc/gtc_type_aligned.cpp b/test/gtc/gtc_type_aligned.cpp index 11bf53de..fc0a66de 100644 --- a/test/gtc/gtc_type_aligned.cpp +++ b/test/gtc/gtc_type_aligned.cpp @@ -52,6 +52,37 @@ struct my_u8vec4_packed }; GLM_STATIC_ASSERT(sizeof(my_u8vec4_packed) == sizeof(glm::uint32) + sizeof(glm::u8vec4), "glm::u8vec4 packed is not correct"); +int test_copy() +{ + int Error = 0; + + { + glm::aligned_ivec4 const a(1); + glm::ivec4 const u(a); + + Error += a.x == u.x ? 0 : 1; + Error += a.y == u.y ? 0 : 1; + Error += a.z == u.z ? 0 : 1; + Error += a.w == u.w ? 0 : 1; + } + + { + my_ivec4_aligned a; + a.b = glm::ivec4(1); + + my_ivec4_packed u; + u.b = glm::ivec4(1); + + Error += a.b.x == u.b.x ? 0 : 1; + Error += a.b.y == u.b.y ? 0 : 1; + Error += a.b.z == u.b.z ? 0 : 1; + Error += a.b.w == u.b.w ? 0 : 1; + } + + return Error; +} + + int main() { int Error = 0;