浏览代码

Fix aligned types when SIMD is NOT used

christophe 1 月之前
父节点
当前提交
ff64b7da64

+ 1 - 1
glm/detail/compute_vector_decl.hpp

@@ -27,7 +27,7 @@ namespace glm {
 			GLM_FUNC_QUALIFIER GLM_CONSTEXPR static vec<L, T, Q> call(vec<L, T, Q> const& a, vec<L, T, Q> const& b)
 			{
 				return detail::functor2<vec, L, T, Q>::call(std::multiplies<T>(), a, b);
-			}
+			}			
 		};
 
 		template<length_t L, typename T, qualifier Q, bool UseSimd>

+ 440 - 194
glm/detail/glm.cpp

@@ -15,250 +15,496 @@
 namespace glm
 {
 // tvec1 type explicit instantiation
-template struct vec<1, uint8, lowp>;
-template struct vec<1, uint16, lowp>;
-template struct vec<1, uint32, lowp>;
-template struct vec<1, uint64, lowp>;
-template struct vec<1, int8, lowp>;
-template struct vec<1, int16, lowp>;
-template struct vec<1, int32, lowp>;
-template struct vec<1, int64, lowp>;
-template struct vec<1, float32, lowp>;
-template struct vec<1, float64, lowp>;
-
-template struct vec<1, uint8, mediump>;
-template struct vec<1, uint16, mediump>;
-template struct vec<1, uint32, mediump>;
-template struct vec<1, uint64, mediump>;
-template struct vec<1, int8, mediump>;
-template struct vec<1, int16, mediump>;
-template struct vec<1, int32, mediump>;
-template struct vec<1, int64, mediump>;
-template struct vec<1, float32, mediump>;
-template struct vec<1, float64, mediump>;
-
-template struct vec<1, uint8, highp>;
-template struct vec<1, uint16, highp>;
-template struct vec<1, uint32, highp>;
-template struct vec<1, uint64, highp>;
-template struct vec<1, int8, highp>;
-template struct vec<1, int16, highp>;
-template struct vec<1, int32, highp>;
-template struct vec<1, int64, highp>;
-template struct vec<1, float32, highp>;
-template struct vec<1, float64, highp>;
+template struct vec<1, uint8, packed_lowp>;
+template struct vec<1, uint16, packed_lowp>;
+template struct vec<1, uint32, packed_lowp>;
+template struct vec<1, uint64, packed_lowp>;
+template struct vec<1, int8, packed_lowp>;
+template struct vec<1, int16, packed_lowp>;
+template struct vec<1, int32, packed_lowp>;
+template struct vec<1, int64, packed_lowp>;
+template struct vec<1, float32, packed_lowp>;
+template struct vec<1, float64, packed_lowp>;
+
+template struct vec<1, uint8, packed_mediump>;
+template struct vec<1, uint16, packed_mediump>;
+template struct vec<1, uint32, packed_mediump>;
+template struct vec<1, uint64, packed_mediump>;
+template struct vec<1, int8, packed_mediump>;
+template struct vec<1, int16, packed_mediump>;
+template struct vec<1, int32, packed_mediump>;
+template struct vec<1, int64, packed_mediump>;
+template struct vec<1, float32, packed_mediump>;
+template struct vec<1, float64, packed_mediump>;
+
+template struct vec<1, uint8, packed_highp>;
+template struct vec<1, uint16, packed_highp>;
+template struct vec<1, uint32, packed_highp>;
+template struct vec<1, uint64, packed_highp>;
+template struct vec<1, int8, packed_highp>;
+template struct vec<1, int16, packed_highp>;
+template struct vec<1, int32, packed_highp>;
+template struct vec<1, int64, packed_highp>;
+template struct vec<1, float32, packed_highp>;
+template struct vec<1, float64, packed_highp>;
 
 // tvec2 type explicit instantiation
-template struct vec<2, uint8, lowp>;
-template struct vec<2, uint16, lowp>;
-template struct vec<2, uint32, lowp>;
-template struct vec<2, uint64, lowp>;
-template struct vec<2, int8, lowp>;
-template struct vec<2, int16, lowp>;
-template struct vec<2, int32, lowp>;
-template struct vec<2, int64, lowp>;
-template struct vec<2, float32, lowp>;
-template struct vec<2, float64, lowp>;
-
-template struct vec<2, uint8, mediump>;
-template struct vec<2, uint16, mediump>;
-template struct vec<2, uint32, mediump>;
-template struct vec<2, uint64, mediump>;
-template struct vec<2, int8, mediump>;
-template struct vec<2, int16, mediump>;
-template struct vec<2, int32, mediump>;
-template struct vec<2, int64, mediump>;
-template struct vec<2, float32, mediump>;
-template struct vec<2, float64, mediump>;
-
-template struct vec<2, uint8, highp>;
-template struct vec<2, uint16, highp>;
-template struct vec<2, uint32, highp>;
-template struct vec<2, uint64, highp>;
-template struct vec<2, int8, highp>;
-template struct vec<2, int16, highp>;
-template struct vec<2, int32, highp>;
-template struct vec<2, int64, highp>;
-template struct vec<2, float32, highp>;
-template struct vec<2, float64, highp>;
+template struct vec<2, uint8, packed_lowp>;
+template struct vec<2, uint16, packed_lowp>;
+template struct vec<2, uint32, packed_lowp>;
+template struct vec<2, uint64, packed_lowp>;
+template struct vec<2, int8, packed_lowp>;
+template struct vec<2, int16, packed_lowp>;
+template struct vec<2, int32, packed_lowp>;
+template struct vec<2, int64, packed_lowp>;
+template struct vec<2, float32, packed_lowp>;
+template struct vec<2, float64, packed_lowp>;
+
+template struct vec<2, uint8, packed_mediump>;
+template struct vec<2, uint16, packed_mediump>;
+template struct vec<2, uint32, packed_mediump>;
+template struct vec<2, uint64, packed_mediump>;
+template struct vec<2, int8, packed_mediump>;
+template struct vec<2, int16, packed_mediump>;
+template struct vec<2, int32, packed_mediump>;
+template struct vec<2, int64, packed_mediump>;
+template struct vec<2, float32, packed_mediump>;
+template struct vec<2, float64, packed_mediump>;
+
+template struct vec<2, uint8, packed_highp>;
+template struct vec<2, uint16, packed_highp>;
+template struct vec<2, uint32, packed_highp>;
+template struct vec<2, uint64, packed_highp>;
+template struct vec<2, int8, packed_highp>;
+template struct vec<2, int16, packed_highp>;
+template struct vec<2, int32, packed_highp>;
+template struct vec<2, int64, packed_highp>;
+template struct vec<2, float32, packed_highp>;
+template struct vec<2, float64, packed_highp>;
 
 // tvec3 type explicit instantiation
-template struct vec<3, uint8, lowp>;
-template struct vec<3, uint16, lowp>;
-template struct vec<3, uint32, lowp>;
-template struct vec<3, uint64, lowp>;
-template struct vec<3, int8, lowp>;
-template struct vec<3, int16, lowp>;
-template struct vec<3, int32, lowp>;
-template struct vec<3, int64, lowp>;
-template struct vec<3, float32, lowp>;
-template struct vec<3, float64, lowp>;
-
-template struct vec<3, uint8, mediump>;
-template struct vec<3, uint16, mediump>;
-template struct vec<3, uint32, mediump>;
-template struct vec<3, uint64, mediump>;
-template struct vec<3, int8, mediump>;
-template struct vec<3, int16, mediump>;
-template struct vec<3, int32, mediump>;
-template struct vec<3, int64, mediump>;
-template struct vec<3, float32, mediump>;
-template struct vec<3, float64, mediump>;
-
-template struct vec<3, uint8, highp>;
-template struct vec<3, uint16, highp>;
-template struct vec<3, uint32, highp>;
-template struct vec<3, uint64, highp>;
-template struct vec<3, int8, highp>;
-template struct vec<3, int16, highp>;
-template struct vec<3, int32, highp>;
-template struct vec<3, int64, highp>;
-template struct vec<3, float32, highp>;
-template struct vec<3, float64, highp>;
+template struct vec<3, uint8, packed_lowp>;
+template struct vec<3, uint16, packed_lowp>;
+template struct vec<3, uint32, packed_lowp>;
+template struct vec<3, uint64, packed_lowp>;
+template struct vec<3, int8, packed_lowp>;
+template struct vec<3, int16, packed_lowp>;
+template struct vec<3, int32, packed_lowp>;
+template struct vec<3, int64, packed_lowp>;
+template struct vec<3, float32, packed_lowp>;
+template struct vec<3, float64, packed_lowp>;
+
+template struct vec<3, uint8, packed_mediump>;
+template struct vec<3, uint16, packed_mediump>;
+template struct vec<3, uint32, packed_mediump>;
+template struct vec<3, uint64, packed_mediump>;
+template struct vec<3, int8, packed_mediump>;
+template struct vec<3, int16, packed_mediump>;
+template struct vec<3, int32, packed_mediump>;
+template struct vec<3, int64, packed_mediump>;
+template struct vec<3, float32, packed_mediump>;
+template struct vec<3, float64, packed_mediump>;
+
+template struct vec<3, uint8, packed_highp>;
+template struct vec<3, uint16, packed_highp>;
+template struct vec<3, uint32, packed_highp>;
+template struct vec<3, uint64, packed_highp>;
+template struct vec<3, int8, packed_highp>;
+template struct vec<3, int16, packed_highp>;
+template struct vec<3, int32, packed_highp>;
+template struct vec<3, int64, packed_highp>;
+template struct vec<3, float32, packed_highp>;
+template struct vec<3, float64, packed_highp>;
 
 // tvec4 type explicit instantiation
-template struct vec<4, uint8, lowp>;
-template struct vec<4, uint16, lowp>;
-template struct vec<4, uint32, lowp>;
-template struct vec<4, uint64, lowp>;
-template struct vec<4, int8, lowp>;
-template struct vec<4, int16, lowp>;
-template struct vec<4, int32, lowp>;
-template struct vec<4, int64, lowp>;
-template struct vec<4, float32, lowp>;
-template struct vec<4, float64, lowp>;
-
-template struct vec<4, uint8, mediump>;
-template struct vec<4, uint16, mediump>;
-template struct vec<4, uint32, mediump>;
-template struct vec<4, uint64, mediump>;
-template struct vec<4, int8, mediump>;
-template struct vec<4, int16, mediump>;
-template struct vec<4, int32, mediump>;
-template struct vec<4, int64, mediump>;
-template struct vec<4, float32, mediump>;
-template struct vec<4, float64, mediump>;
-
-template struct vec<4, uint8, highp>;
-template struct vec<4, uint16, highp>;
-template struct vec<4, uint32, highp>;
-template struct vec<4, uint64, highp>;
-template struct vec<4, int8, highp>;
-template struct vec<4, int16, highp>;
-template struct vec<4, int32, highp>;
-template struct vec<4, int64, highp>;
-template struct vec<4, float32, highp>;
-template struct vec<4, float64, highp>;
+template struct vec<4, uint8, packed_lowp>;
+template struct vec<4, uint16, packed_lowp>;
+template struct vec<4, uint32, packed_lowp>;
+template struct vec<4, uint64, packed_lowp>;
+template struct vec<4, int8, packed_lowp>;
+template struct vec<4, int16, packed_lowp>;
+template struct vec<4, int32, packed_lowp>;
+template struct vec<4, int64, packed_lowp>;
+template struct vec<4, float32, packed_lowp>;
+template struct vec<4, float64, packed_lowp>;
+
+template struct vec<4, uint8, packed_mediump>;
+template struct vec<4, uint16, packed_mediump>;
+template struct vec<4, uint32, packed_mediump>;
+template struct vec<4, uint64, packed_mediump>;
+template struct vec<4, int8, packed_mediump>;
+template struct vec<4, int16, packed_mediump>;
+template struct vec<4, int32, packed_mediump>;
+template struct vec<4, int64, packed_mediump>;
+template struct vec<4, float32, packed_mediump>;
+template struct vec<4, float64, packed_mediump>;
+
+template struct vec<4, uint8, packed_highp>;
+template struct vec<4, uint16, packed_highp>;
+template struct vec<4, uint32, packed_highp>;
+template struct vec<4, uint64, packed_highp>;
+template struct vec<4, int8, packed_highp>;
+template struct vec<4, int16, packed_highp>;
+template struct vec<4, int32, packed_highp>;
+template struct vec<4, int64, packed_highp>;
+template struct vec<4, float32, packed_highp>;
+template struct vec<4, float64, packed_highp>;
 
 // tmat2x2 type explicit instantiation
-template struct mat<2, 2, float32, lowp>;
-template struct mat<2, 2, float64, lowp>;
+template struct mat<2, 2, float32, packed_lowp>;
+template struct mat<2, 2, float64, packed_lowp>;
 
-template struct mat<2, 2, float32, mediump>;
-template struct mat<2, 2, float64, mediump>;
+template struct mat<2, 2, float32, packed_mediump>;
+template struct mat<2, 2, float64, packed_mediump>;
 
-template struct mat<2, 2, float32, highp>;
-template struct mat<2, 2, float64, highp>;
+template struct mat<2, 2, float32, packed_highp>;
+template struct mat<2, 2, float64, packed_highp>;
 
 // tmat2x3 type explicit instantiation
-template struct mat<2, 3, float32, lowp>;
-template struct mat<2, 3, float64, lowp>;
+template struct mat<2, 3, float32, packed_lowp>;
+template struct mat<2, 3, float64, packed_lowp>;
 
-template struct mat<2, 3, float32, mediump>;
-template struct mat<2, 3, float64, mediump>;
+template struct mat<2, 3, float32, packed_mediump>;
+template struct mat<2, 3, float64, packed_mediump>;
 
-template struct mat<2, 3, float32, highp>;
-template struct mat<2, 3, float64, highp>;
+template struct mat<2, 3, float32, packed_highp>;
+template struct mat<2, 3, float64, packed_highp>;
 
 // tmat2x4 type explicit instantiation
-template struct mat<2, 4, float32, lowp>;
-template struct mat<2, 4, float64, lowp>;
+template struct mat<2, 4, float32, packed_lowp>;
+template struct mat<2, 4, float64, packed_lowp>;
 
-template struct mat<2, 4, float32, mediump>;
-template struct mat<2, 4, float64, mediump>;
+template struct mat<2, 4, float32, packed_mediump>;
+template struct mat<2, 4, float64, packed_mediump>;
 
-template struct mat<2, 4, float32, highp>;
-template struct mat<2, 4, float64, highp>;
+template struct mat<2, 4, float32, packed_highp>;
+template struct mat<2, 4, float64, packed_highp>;
 
 // tmat3x2 type explicit instantiation
-template struct mat<3, 2, float32, lowp>;
-template struct mat<3, 2, float64, lowp>;
+template struct mat<3, 2, float32, packed_lowp>;
+template struct mat<3, 2, float64, packed_lowp>;
 
-template struct mat<3, 2, float32, mediump>;
-template struct mat<3, 2, float64, mediump>;
+template struct mat<3, 2, float32, packed_mediump>;
+template struct mat<3, 2, float64, packed_mediump>;
 
-template struct mat<3, 2, float32, highp>;
-template struct mat<3, 2, float64, highp>;
+template struct mat<3, 2, float32, packed_highp>;
+template struct mat<3, 2, float64, packed_highp>;
 
 // tmat3x3 type explicit instantiation
-template struct mat<3, 3, float32, lowp>;
-template struct mat<3, 3, float64, lowp>;
+template struct mat<3, 3, float32, packed_lowp>;
+template struct mat<3, 3, float64, packed_lowp>;
 
-template struct mat<3, 3, float32, mediump>;
-template struct mat<3, 3, float64, mediump>;
+template struct mat<3, 3, float32, packed_mediump>;
+template struct mat<3, 3, float64, packed_mediump>;
 
-template struct mat<3, 3, float32, highp>;
-template struct mat<3, 3, float64, highp>;
+template struct mat<3, 3, float32, packed_highp>;
+template struct mat<3, 3, float64, packed_highp>;
 
 // tmat3x4 type explicit instantiation
-template struct mat<3, 4, float32, lowp>;
-template struct mat<3, 4, float64, lowp>;
+template struct mat<3, 4, float32, packed_lowp>;
+template struct mat<3, 4, float64, packed_lowp>;
 
-template struct mat<3, 4, float32, mediump>;
-template struct mat<3, 4, float64, mediump>;
+template struct mat<3, 4, float32, packed_mediump>;
+template struct mat<3, 4, float64, packed_mediump>;
 
-template struct mat<3, 4, float32, highp>;
-template struct mat<3, 4, float64, highp>;
+template struct mat<3, 4, float32, packed_highp>;
+template struct mat<3, 4, float64, packed_highp>;
 
 // tmat4x2 type explicit instantiation
-template struct mat<4, 2, float32, lowp>;
-template struct mat<4, 2, float64, lowp>;
+template struct mat<4, 2, float32, packed_lowp>;
+template struct mat<4, 2, float64, packed_lowp>;
 
-template struct mat<4, 2, float32, mediump>;
-template struct mat<4, 2, float64, mediump>;
+template struct mat<4, 2, float32, packed_mediump>;
+template struct mat<4, 2, float64, packed_mediump>;
 
-template struct mat<4, 2, float32, highp>;
-template struct mat<4, 2, float64, highp>;
+template struct mat<4, 2, float32, packed_highp>;
+template struct mat<4, 2, float64, packed_highp>;
 
 // tmat4x3 type explicit instantiation
-template struct mat<4, 3, float32, lowp>;
-template struct mat<4, 3, float64, lowp>;
+template struct mat<4, 3, float32, packed_lowp>;
+template struct mat<4, 3, float64, packed_lowp>;
 
-template struct mat<4, 3, float32, mediump>;
-template struct mat<4, 3, float64, mediump>;
+template struct mat<4, 3, float32, packed_mediump>;
+template struct mat<4, 3, float64, packed_mediump>;
 
-template struct mat<4, 3, float32, highp>;
-template struct mat<4, 3, float64, highp>;
+template struct mat<4, 3, float32, packed_highp>;
+template struct mat<4, 3, float64, packed_highp>;
 
 // tmat4x4 type explicit instantiation
-template struct mat<4, 4, float32, lowp>;
-template struct mat<4, 4, float64, lowp>;
+template struct mat<4, 4, float32, packed_lowp>;
+template struct mat<4, 4, float64, packed_lowp>;
 
-template struct mat<4, 4, float32, mediump>;
-template struct mat<4, 4, float64, mediump>;
+template struct mat<4, 4, float32, packed_mediump>;
+template struct mat<4, 4, float64, packed_mediump>;
 
-template struct mat<4, 4, float32, highp>;
-template struct mat<4, 4, float64, highp>;
+template struct mat<4, 4, float32, packed_highp>;
+template struct mat<4, 4, float64, packed_highp>;
 
 // tquat type explicit instantiation
-template struct qua<float32, lowp>;
-template struct qua<float64, lowp>;
+template struct qua<float32, packed_lowp>;
+template struct qua<float64, packed_lowp>;
 
-template struct qua<float32, mediump>;
-template struct qua<float64, mediump>;
+template struct qua<float32, packed_mediump>;
+template struct qua<float64, packed_mediump>;
 
-template struct qua<float32, highp>;
-template struct qua<float64, highp>;
+template struct qua<float32, packed_highp>;
+template struct qua<float64, packed_highp>;
 
 //tdualquat type explicit instantiation
-template struct tdualquat<float32, lowp>;
-template struct tdualquat<float64, lowp>;
+template struct tdualquat<float32, packed_lowp>;
+template struct tdualquat<float64, packed_lowp>;
 
-template struct tdualquat<float32, mediump>;
-template struct tdualquat<float64, mediump>;
+template struct tdualquat<float32, packed_mediump>;
+template struct tdualquat<float64, packed_mediump>;
 
-template struct tdualquat<float32, highp>;
-template struct tdualquat<float64, highp>;
+template struct tdualquat<float32, packed_highp>;
+template struct tdualquat<float64, packed_highp>;
+
+// tvec1 type explicit instantiation
+template struct vec<1, uint8, aligned_lowp>;
+template struct vec<1, uint16, aligned_lowp>;
+template struct vec<1, uint32, aligned_lowp>;
+template struct vec<1, uint64, aligned_lowp>;
+template struct vec<1, int8, aligned_lowp>;
+template struct vec<1, int16, aligned_lowp>;
+template struct vec<1, int32, aligned_lowp>;
+template struct vec<1, int64, aligned_lowp>;
+template struct vec<1, float32, aligned_lowp>;
+template struct vec<1, float64, aligned_lowp>;
+
+template struct vec<1, uint8, aligned_mediump>;
+template struct vec<1, uint16, aligned_mediump>;
+template struct vec<1, uint32, aligned_mediump>;
+template struct vec<1, uint64, aligned_mediump>;
+template struct vec<1, int8, aligned_mediump>;
+template struct vec<1, int16, aligned_mediump>;
+template struct vec<1, int32, aligned_mediump>;
+template struct vec<1, int64, aligned_mediump>;
+template struct vec<1, float32, aligned_mediump>;
+template struct vec<1, float64, aligned_mediump>;
+
+template struct vec<1, uint8, aligned_highp>;
+template struct vec<1, uint16, aligned_highp>;
+template struct vec<1, uint32, aligned_highp>;
+template struct vec<1, uint64, aligned_highp>;
+template struct vec<1, int8, aligned_highp>;
+template struct vec<1, int16, aligned_highp>;
+template struct vec<1, int32, aligned_highp>;
+template struct vec<1, int64, aligned_highp>;
+template struct vec<1, float32, aligned_highp>;
+template struct vec<1, float64, aligned_highp>;
+
+// tvec2 type explicit instantiation
+template struct vec<2, uint8, aligned_lowp>;
+template struct vec<2, uint16, aligned_lowp>;
+template struct vec<2, uint32, aligned_lowp>;
+template struct vec<2, uint64, aligned_lowp>;
+template struct vec<2, int8, aligned_lowp>;
+template struct vec<2, int16, aligned_lowp>;
+template struct vec<2, int32, aligned_lowp>;
+template struct vec<2, int64, aligned_lowp>;
+template struct vec<2, float32, aligned_lowp>;
+template struct vec<2, float64, aligned_lowp>;
+
+template struct vec<2, uint8, aligned_mediump>;
+template struct vec<2, uint16, aligned_mediump>;
+template struct vec<2, uint32, aligned_mediump>;
+template struct vec<2, uint64, aligned_mediump>;
+template struct vec<2, int8, aligned_mediump>;
+template struct vec<2, int16, aligned_mediump>;
+template struct vec<2, int32, aligned_mediump>;
+template struct vec<2, int64, aligned_mediump>;
+template struct vec<2, float32, aligned_mediump>;
+template struct vec<2, float64, aligned_mediump>;
+
+template struct vec<2, uint8, aligned_highp>;
+template struct vec<2, uint16, aligned_highp>;
+template struct vec<2, uint32, aligned_highp>;
+template struct vec<2, uint64, aligned_highp>;
+template struct vec<2, int8, aligned_highp>;
+template struct vec<2, int16, aligned_highp>;
+template struct vec<2, int32, aligned_highp>;
+template struct vec<2, int64, aligned_highp>;
+template struct vec<2, float32, aligned_highp>;
+template struct vec<2, float64, aligned_highp>;
+
+// tvec3 type explicit instantiation
+template struct vec<3, uint8, aligned_lowp>;
+template struct vec<3, uint16, aligned_lowp>;
+template struct vec<3, uint32, aligned_lowp>;
+template struct vec<3, uint64, aligned_lowp>;
+template struct vec<3, int8, aligned_lowp>;
+template struct vec<3, int16, aligned_lowp>;
+template struct vec<3, int32, aligned_lowp>;
+template struct vec<3, int64, aligned_lowp>;
+template struct vec<3, float32, aligned_lowp>;
+template struct vec<3, float64, aligned_lowp>;
+
+template struct vec<3, uint8, aligned_mediump>;
+template struct vec<3, uint16, aligned_mediump>;
+template struct vec<3, uint32, aligned_mediump>;
+template struct vec<3, uint64, aligned_mediump>;
+template struct vec<3, int8, aligned_mediump>;
+template struct vec<3, int16, aligned_mediump>;
+template struct vec<3, int32, aligned_mediump>;
+template struct vec<3, int64, aligned_mediump>;
+template struct vec<3, float32, aligned_mediump>;
+template struct vec<3, float64, aligned_mediump>;
+
+template struct vec<3, uint8, aligned_highp>;
+template struct vec<3, uint16, aligned_highp>;
+template struct vec<3, uint32, aligned_highp>;
+template struct vec<3, uint64, aligned_highp>;
+template struct vec<3, int8, aligned_highp>;
+template struct vec<3, int16, aligned_highp>;
+template struct vec<3, int32, aligned_highp>;
+template struct vec<3, int64, aligned_highp>;
+template struct vec<3, float32, aligned_highp>;
+template struct vec<3, float64, aligned_highp>;
+
+// tvec4 type explicit instantiation
+template struct vec<4, uint8, aligned_lowp>;
+template struct vec<4, uint16, aligned_lowp>;
+template struct vec<4, uint32, aligned_lowp>;
+template struct vec<4, uint64, aligned_lowp>;
+template struct vec<4, int8, aligned_lowp>;
+template struct vec<4, int16, aligned_lowp>;
+template struct vec<4, int32, aligned_lowp>;
+template struct vec<4, int64, aligned_lowp>;
+template struct vec<4, float32, aligned_lowp>;
+template struct vec<4, float64, aligned_lowp>;
+
+template struct vec<4, uint8, aligned_mediump>;
+template struct vec<4, uint16, aligned_mediump>;
+template struct vec<4, uint32, aligned_mediump>;
+template struct vec<4, uint64, aligned_mediump>;
+template struct vec<4, int8, aligned_mediump>;
+template struct vec<4, int16, aligned_mediump>;
+template struct vec<4, int32, aligned_mediump>;
+template struct vec<4, int64, aligned_mediump>;
+template struct vec<4, float32, aligned_mediump>;
+template struct vec<4, float64, aligned_mediump>;
+
+template struct vec<4, uint8, aligned_highp>;
+template struct vec<4, uint16, aligned_highp>;
+template struct vec<4, uint32, aligned_highp>;
+template struct vec<4, uint64, aligned_highp>;
+template struct vec<4, int8, aligned_highp>;
+template struct vec<4, int16, aligned_highp>;
+template struct vec<4, int32, aligned_highp>;
+template struct vec<4, int64, aligned_highp>;
+template struct vec<4, float32, aligned_highp>;
+template struct vec<4, float64, aligned_highp>;
+
+// tmat2x2 type explicit instantiation
+template struct mat<2, 2, float32, aligned_lowp>;
+template struct mat<2, 2, float64, aligned_lowp>;
+
+template struct mat<2, 2, float32, aligned_mediump>;
+template struct mat<2, 2, float64, aligned_mediump>;
+
+template struct mat<2, 2, float32, aligned_highp>;
+template struct mat<2, 2, float64, aligned_highp>;
+
+// tmat2x3 type explicit instantiation
+template struct mat<2, 3, float32, aligned_lowp>;
+template struct mat<2, 3, float64, aligned_lowp>;
+
+template struct mat<2, 3, float32, aligned_mediump>;
+template struct mat<2, 3, float64, aligned_mediump>;
+
+template struct mat<2, 3, float32, aligned_highp>;
+template struct mat<2, 3, float64, aligned_highp>;
+
+// tmat2x4 type explicit instantiation
+template struct mat<2, 4, float32, aligned_lowp>;
+template struct mat<2, 4, float64, aligned_lowp>;
+
+template struct mat<2, 4, float32, aligned_mediump>;
+template struct mat<2, 4, float64, aligned_mediump>;
+
+template struct mat<2, 4, float32, aligned_highp>;
+template struct mat<2, 4, float64, aligned_highp>;
+
+// tmat3x2 type explicit instantiation
+template struct mat<3, 2, float32, aligned_lowp>;
+template struct mat<3, 2, float64, aligned_lowp>;
+
+template struct mat<3, 2, float32, aligned_mediump>;
+template struct mat<3, 2, float64, aligned_mediump>;
+
+template struct mat<3, 2, float32, aligned_highp>;
+template struct mat<3, 2, float64, aligned_highp>;
+
+// tmat3x3 type explicit instantiation
+template struct mat<3, 3, float32, aligned_lowp>;
+template struct mat<3, 3, float64, aligned_lowp>;
+
+template struct mat<3, 3, float32, aligned_mediump>;
+template struct mat<3, 3, float64, aligned_mediump>;
+
+template struct mat<3, 3, float32, aligned_highp>;
+template struct mat<3, 3, float64, aligned_highp>;
+
+// tmat3x4 type explicit instantiation
+template struct mat<3, 4, float32, aligned_lowp>;
+template struct mat<3, 4, float64, aligned_lowp>;
+
+template struct mat<3, 4, float32, aligned_mediump>;
+template struct mat<3, 4, float64, aligned_mediump>;
+
+template struct mat<3, 4, float32, aligned_highp>;
+template struct mat<3, 4, float64, aligned_highp>;
+
+// tmat4x2 type explicit instantiation
+template struct mat<4, 2, float32, aligned_lowp>;
+template struct mat<4, 2, float64, aligned_lowp>;
+
+template struct mat<4, 2, float32, aligned_mediump>;
+template struct mat<4, 2, float64, aligned_mediump>;
+
+template struct mat<4, 2, float32, aligned_highp>;
+template struct mat<4, 2, float64, aligned_highp>;
+
+// tmat4x3 type explicit instantiation
+template struct mat<4, 3, float32, aligned_lowp>;
+template struct mat<4, 3, float64, aligned_lowp>;
+
+template struct mat<4, 3, float32, aligned_mediump>;
+template struct mat<4, 3, float64, aligned_mediump>;
+
+template struct mat<4, 3, float32, aligned_highp>;
+template struct mat<4, 3, float64, aligned_highp>;
+
+// tmat4x4 type explicit instantiation
+template struct mat<4, 4, float32, aligned_lowp>;
+template struct mat<4, 4, float64, aligned_lowp>;
+
+template struct mat<4, 4, float32, aligned_mediump>;
+template struct mat<4, 4, float64, aligned_mediump>;
+
+template struct mat<4, 4, float32, aligned_highp>;
+template struct mat<4, 4, float64, aligned_highp>;
+/* FIXME
+// tquat type explicit instantiation
+template struct qua<float32, aligned_lowp>;
+template struct qua<float64, aligned_lowp>;
+
+template struct qua<float32, aligned_mediump>;
+template struct qua<float64, aligned_mediump>;
+
+template struct qua<float32, aligned_highp>;
+template struct qua<float64, aligned_highp>;
+*/
+//tdualquat type explicit instantiation
+template struct tdualquat<float32, aligned_lowp>;
+template struct tdualquat<float64, aligned_lowp>;
+
+template struct tdualquat<float32, aligned_mediump>;
+template struct tdualquat<float64, aligned_mediump>;
+
+template struct tdualquat<float32, aligned_highp>;
+template struct tdualquat<float64, aligned_highp>;
 
 }//namespace glm
 

+ 98 - 82
glm/detail/qualifier.hpp

@@ -7,27 +7,27 @@ namespace glm
 	/// Qualify GLM types in term of alignment (packed, aligned) and precision in term of ULPs (lowp, mediump, highp)
 	enum qualifier
 	{
-		packed_highp, ///< Typed data is tightly packed in memory and operations are executed with high precision in term of ULPs
-		packed_mediump, ///< Typed data is tightly packed in memory  and operations are executed with medium precision in term of ULPs for higher performance
-		packed_lowp, ///< Typed data is tightly packed in memory  and operations are executed with low precision in term of ULPs to maximize performance
-
-#		if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
-			aligned_highp, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs
-			aligned_mediump, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs for higher performance
-			aligned_lowp, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance
-			aligned = aligned_highp, ///< By default aligned qualifier is also high precision
-#		endif
-
-		highp = packed_highp, ///< By default highp qualifier is also packed
-		mediump = packed_mediump, ///< By default mediump qualifier is also packed
-		lowp = packed_lowp, ///< By default lowp qualifier is also packed
+		packed_highp = 0, ///< Typed data is tightly packed in memory and operations are executed with high precision in term of ULPs
+		packed_mediump = 1, ///< Typed data is tightly packed in memory  and operations are executed with medium precision in term of ULPs for higher performance
+		packed_lowp = 2, ///< Typed data is tightly packed in memory  and operations are executed with low precision in term of ULPs to maximize performance
 		packed = packed_highp, ///< By default packed qualifier is also high precision
 
-#		if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE && defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES)
-			defaultp = aligned_highp
-#		else
-			defaultp = highp
+		aligned_highp = 3, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs
+		aligned_mediump = 4, ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs for higher performance
+		aligned_lowp = 5, // ///< Typed data is aligned in memory allowing SIMD optimizations and operations are executed with high precision in term of ULPs to maximize performance
+		aligned = aligned_highp, ///< By default aligned qualifier is also high precision
+
+#		if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES)
+			highp = aligned_highp, ///< By default highp qualifier is also packed
+			mediump = aligned_mediump, ///< By default mediump qualifier is also packed
+			lowp = aligned_lowp, ///< By default lowp qualifier is also packed
+#		else 
+			highp = packed_highp, ///< By default highp qualifier is also packed
+			mediump = packed_mediump, ///< By default mediump qualifier is also packed
+			lowp = packed_lowp, ///< By default lowp qualifier is also packed
 #		endif
+
+		defaultp = highp
 	};
 
 	typedef qualifier precision;
@@ -53,141 +53,146 @@ namespace glm
 
 namespace detail
 {
+#if GLM_COMPILER & GLM_COMPILER_CLANG
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wpadded"
+#endif
+
 	template<glm::qualifier P>
 	struct is_aligned
 	{
 		static const bool value = false;
 	};
 
-#	if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
-		template<>
-		struct is_aligned<glm::aligned_lowp>
-		{
-			static const bool value = true;
-		};
+	template<>
+	struct is_aligned<glm::aligned_lowp>
+	{
+		static const bool value = true;
+	};
 
-		template<>
-		struct is_aligned<glm::aligned_mediump>
-		{
-			static const bool value = true;
-		};
+	template<>
+	struct is_aligned<glm::aligned_mediump>
+	{
+		static const bool value = true;
+	};
 
-		template<>
-		struct is_aligned<glm::aligned_highp>
-		{
-			static const bool value = true;
-		};
-#	endif
+	template<>
+	struct is_aligned<glm::aligned_highp>
+	{
+		static const bool value = true;
+	};
 
 	template<length_t L, typename T, bool is_aligned>
 	struct storage
 	{
-		typedef struct type {
-			T data[L];
-		} type;
+		T data[L];
 	};
 
 	template<length_t L, typename T>
-	struct storage<L, T, true>
+	struct alignas(L * sizeof(T)) storage<L, T, true>
 	{
-		typedef struct alignas(L * sizeof(T)) type {
-			T data[L];
-		} type;
+		T data[L];
 	};
 
 	template<typename T>
-	struct storage<3, T, true>
+	struct alignas(4 * sizeof(T)) storage<3, T, true>
 	{
-		typedef struct alignas(4 * sizeof(T)) type {
-			T data[4];
-		} type;
+		T data[3];
 	};
 
 #	if GLM_ARCH & GLM_ARCH_SSE2_BIT
 	template<>
 	struct storage<4, float, true>
 	{
-		typedef glm_f32vec4 type;
+		glm_f32vec4 data;
 	};
 
 	template<>
 	struct storage<4, int, true>
 	{
-		typedef glm_i32vec4 type;
+		glm_i32vec4 data;
 	};
 
 	template<>
 	struct storage<4, unsigned int, true>
 	{
-		typedef glm_u32vec4 type;
+		glm_u32vec4 data;
 	};
 
 	template<>
 	struct storage<3, float, true>
 	{
-		typedef glm_f32vec4 type;
+		glm_f32vec4 data;
 	};
 
 	template<>
 	struct storage<3, int, true>
 	{
-		typedef glm_i32vec4 type;
+		glm_i32vec4 data;
 	};
 
 	template<>
 	struct storage<3, unsigned int, true>
 	{
-		typedef glm_u32vec4 type;
+		glm_u32vec4 data;
 	};
 
 	template<>
 	struct storage<2, double, true>
 	{
-		typedef glm_f64vec2 type;
+		glm_f64vec2 data;
 	};
 
 	template<>
 	struct storage<2, detail::int64, true>
 	{
-		typedef glm_i64vec2 type;
+		glm_i64vec2 data;
 	};
 
 	template<>
 	struct storage<2, detail::uint64, true>
 	{
-		typedef glm_u64vec2 type;
+		glm_u64vec2 data;
 	};
 
 
 	template<>
 	struct storage<3, detail::uint64, true>
 	{
-		typedef glm_u64vec2 type;
+		glm_u64vec2 data;
 	};
 
 	template<>
 	struct storage<4, double, true>
 	{
 #	if (GLM_ARCH & GLM_ARCH_AVX_BIT)
-		typedef glm_f64vec4 type;
+		glm_f64vec4 data;
 #	else
-		struct type
-		{
-			glm_f64vec2 data[2];
-			GLM_CONSTEXPR glm_f64vec2 getv(int i) const {
-				return data[i];
-			}
-			GLM_CONSTEXPR void setv(int i, const glm_f64vec2& v) {
-				data[i] = v;
-			}
-		};
+		glm_f64vec2 data[2];
+		GLM_CONSTEXPR glm_f64vec2 getv(int i) const {
+			return data[i];
+		}
+		GLM_CONSTEXPR void setv(int i, const glm_f64vec2& v) {
+			data[i] = v;
+		}
 #	endif
 	};
 
-
 	template<>
-	struct storage<3, double, true> : public storage<4, double, true>
-	{};
+	struct storage<3, double, true>
+	{
+#	if (GLM_ARCH & GLM_ARCH_AVX_BIT)
+		glm_f64vec4 data;
+#	else
+		glm_f64vec2 data[2];
+		GLM_CONSTEXPR glm_f64vec2 getv(int i) const {
+			return data[i];
+		}
+		GLM_CONSTEXPR void setv(int i, const glm_f64vec2& v) {
+			data[i] = v;
+		}
+#	endif
+	};
 	
 #	endif
 
@@ -195,13 +200,13 @@ namespace detail
 	template<>
 	struct storage<4, detail::int64, true>
 	{
-		typedef glm_i64vec4 type;
+		glm_i64vec4 data;
 	};
 
 	template<>
 	struct storage<4, detail::uint64, true>
 	{
-		typedef glm_u64vec4 type;
+		glm_u64vec4 data;
 	};
 #	endif
 
@@ -209,33 +214,40 @@ namespace detail
 	template<>
 	struct storage<4, float, true>
 	{
-		typedef glm_f32vec4 type;
+		glm_f32vec4 data;
 	};
 
 	template<>
-	struct storage<3, float, true> : public storage<4, float, true>
-	{};
+	struct storage<3, float, true>
+	{
+		glm_f32vec4 data;
+	};
 
 	template<>
 	struct storage<4, int, true>
 	{
-		typedef glm_i32vec4 type;
+		glm_i32vec4 data;
 	};
 
 	template<>
-	struct storage<3, int, true> : public storage<4, int, true>
-	{};
+	struct storage<3, int, true>
+	{
+		glm_i32vec4 data;
+	};
 
 	template<>
 	struct storage<4, unsigned int, true>
 	{
-		typedef glm_u32vec4 type;
+		glm_u32vec4 type;
 	};
-/* TODO: Duplicate ?
+
 	template<>
-	struct storage<3, unsigned int, true> : public storage<4, unsigned int, true>
-	{};
+	struct storage<3, unsigned int, true>
+	{
+		glm_u32vec4 type;
+	};
 
+/* TODO: Duplicate ?
 	template<>
 	struct storage<3, double, true>
 	{
@@ -246,6 +258,10 @@ namespace detail
 */
 #	endif
 
+#if GLM_COMPILER & GLM_COMPILER_CLANG
+#pragma clang diagnostic pop
+#endif
+
 	enum genTypeEnum
 	{
 		GENTYPE_VEC,

+ 0 - 13
glm/detail/setup.hpp

@@ -321,19 +321,6 @@
 #	endif
 #endif
 
-///////////////////////////////////////////////////////////////////////////////////
-// Qualifiers
-
-#if (GLM_COMPILER & GLM_COMPILER_VC) || ((GLM_COMPILER & GLM_COMPILER_INTEL) && (GLM_PLATFORM & GLM_PLATFORM_WINDOWS))
-#	define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef __declspec(align(alignment)) type name
-#elif GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG | GLM_COMPILER_INTEL)
-#	define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __attribute__((aligned(alignment)))
-#elif (GLM_COMPILER & GLM_COMPILER_CUDA) || (GLM_COMPILER & GLM_COMPILER_HIP)
-#	define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name __align__(x)
-#else
-#	define GLM_ALIGNED_TYPEDEF(type, name, alignment) typedef type name
-#endif
-
 ///////////////////////////////////////////////////////////////////////////////////
 
 #ifdef GLM_FORCE_EXPLICIT_CTOR

+ 1 - 1
glm/detail/type_quat.hpp

@@ -48,7 +48,7 @@ namespace glm
 					struct { T x, y, z, w; };
 #				endif
 
-				typename detail::storage<4, T, detail::is_aligned<Q>::value>::type data;
+				typename detail::storage<4, T, detail::is_aligned<Q>::value> data;
 			};
 #		else
 #			ifdef GLM_FORCE_QUAT_DATA_WXYZ

+ 1 - 1
glm/detail/type_vec1.hpp

@@ -47,7 +47,7 @@ namespace glm
 				T r;
 				T s;
 
-				typename detail::storage<1, T, detail::is_aligned<Q>::value>::type data;
+				typename detail::storage<1, T, detail::is_aligned<Q>::value> data;
 /*
 #				if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
 					_GLM_SWIZZLE1_2_MEMBERS(T, Q, x)

+ 1 - 1
glm/detail/type_vec2.hpp

@@ -54,7 +54,7 @@ namespace glm
 				struct{ T r, g; };
 				struct{ T s, t; };
 
-				typename detail::storage<2, T, detail::is_aligned<Q>::value>::type data;
+				typename detail::storage<2, T, detail::is_aligned<Q>::value> data;
 
 #				if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
 					GLM_SWIZZLE2_2_MEMBERS(T, Q, x, y)

+ 1 - 1
glm/detail/type_vec3.hpp

@@ -59,7 +59,7 @@ namespace glm
 				struct{ T r, g, b; };
 				struct{ T s, t, p; };
 
-				typename detail::storage<3, T, detail::is_aligned<Q>::value>::type data;
+				typename detail::storage<3, T, detail::is_aligned<Q>::value> data;
 
 #				if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
 					GLM_SWIZZLE3_2_MEMBERS(T, Q, x, y, z)

+ 0 - 6
glm/detail/type_vec3.inl

@@ -836,7 +836,6 @@ namespace glm {
 	CTORSL(3, CTOR_INT3);
 	CTORSL(3, CTOR_VECF_INT3);
 
-
 	template<>
 	template<>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, double, aligned_highp>::vec(const vec<3, double, aligned_highp>& v)
@@ -849,9 +848,6 @@ namespace glm {
 	}
 #endif
 
-
-
-
 	template<>
 	template<>
 	GLM_FUNC_QUALIFIER GLM_CONSTEXPR vec<3, float, aligned_highp>::vec(const vec<3, float, aligned_highp>& v) :
@@ -958,8 +954,6 @@ namespace glm {
 	//CTORSL(3, CTOR_INT64);
 
 #endif //GLM_ARCH & GLM_ARCH_SSE2_BITt
-
-
 }
 
 #endif

+ 1 - 1
glm/detail/type_vec4.hpp

@@ -55,7 +55,7 @@ namespace glm
 				struct { T r, g, b, a; };
 				struct { T s, t, p, q; };
 
-				typename detail::storage<4, T, detail::is_aligned<Q>::value>::type data;
+				typename detail::storage<4, T, detail::is_aligned<Q>::value> data;
 
 #				if GLM_CONFIG_SWIZZLE == GLM_SWIZZLE_OPERATOR
 					GLM_SWIZZLE4_2_MEMBERS(T, Q, x, y, z, w)

+ 3 - 3
glm/ext.hpp

@@ -185,13 +185,13 @@
 #include "./gtc/random.hpp"
 #include "./gtc/reciprocal.hpp"
 #include "./gtc/round.hpp"
+//#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
+#include "./gtc/type_aligned.hpp"
+//#endif
 #include "./gtc/type_precision.hpp"
 #include "./gtc/type_ptr.hpp"
 #include "./gtc/ulp.hpp"
 #include "./gtc/vec1.hpp"
-#if GLM_CONFIG_ALIGNED_GENTYPES == GLM_ENABLE
-#	include "./gtc/type_aligned.hpp"
-#endif
 
 #ifdef GLM_ENABLE_EXPERIMENTAL
 #include "./gtx/associated_min_max.hpp"

+ 0 - 4
glm/gtc/type_aligned.hpp

@@ -12,10 +12,6 @@
 
 #pragma once
 
-#if (GLM_CONFIG_ALIGNED_GENTYPES == GLM_DISABLE)
-#	error "GLM: Aligned gentypes require to enable C++ language extensions. Define GLM_FORCE_ALIGNED_GENTYPES before including GLM headers to use aligned types."
-#endif
-
 #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
 # pragma message("GLM: GLM_GTC_type_aligned extension included")
 #endif

+ 0 - 1
glm/gtx/bit.hpp

@@ -49,7 +49,6 @@ namespace glm
 	GLM_FUNC_DECL genIUType powerOfTwoAbove(genIUType Value);
 
 	/// Return the power of two number which value is just higher the input value.
-	/// Deprecated, use ceilPowerOfTwo from GTC_round instead
 	///
 	/// @see gtc_round
 	/// @see gtx_bit

+ 47 - 597
glm/gtx/type_aligned.hpp

@@ -16,6 +16,7 @@
 // Dependency:
 #include "../gtc/type_precision.hpp"
 #include "../gtc/quaternion.hpp"
+#include "../gtc/type_aligned.hpp"
 
 #ifndef GLM_ENABLE_EXPERIMENTAL
 #	pragma message("GLM: GLM_GTX_type_aligned is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it.")
@@ -31,748 +32,201 @@ namespace glm
 	/// @addtogroup gtx_type_aligned
 	/// @{
 
-	/// Low qualifier 8 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_int8, aligned_lowp_int8, 1);
-
-	/// Low qualifier 16 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_int16, aligned_lowp_int16, 2);
-
-	/// Low qualifier 32 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_int32, aligned_lowp_int32, 4);
-
-	/// Low qualifier 64 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_int64, aligned_lowp_int64, 8);
-
-
-	/// Low qualifier 8 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_int8_t, aligned_lowp_int8_t, 1);
-
-	/// Low qualifier 16 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_int16_t, aligned_lowp_int16_t, 2);
-
-	/// Low qualifier 32 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_int32_t, aligned_lowp_int32_t, 4);
-
-	/// Low qualifier 64 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_int64_t, aligned_lowp_int64_t, 8);
-
-
-	/// Low qualifier 8 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_i8, aligned_lowp_i8, 1);
-
-	/// Low qualifier 16 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_i16, aligned_lowp_i16, 2);
-
-	/// Low qualifier 32 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_i32, aligned_lowp_i32, 4);
-
-	/// Low qualifier 64 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_i64, aligned_lowp_i64, 8);
-
-
-	/// Medium qualifier 8 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_int8, aligned_mediump_int8, 1);
-
-	/// Medium qualifier 16 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_int16, aligned_mediump_int16, 2);
-
-	/// Medium qualifier 32 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_int32, aligned_mediump_int32, 4);
-
-	/// Medium qualifier 64 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_int64, aligned_mediump_int64, 8);
-
-
-	/// Medium qualifier 8 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_int8_t, aligned_mediump_int8_t, 1);
-
-	/// Medium qualifier 16 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_int16_t, aligned_mediump_int16_t, 2);
-
-	/// Medium qualifier 32 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_int32_t, aligned_mediump_int32_t, 4);
-
-	/// Medium qualifier 64 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_int64_t, aligned_mediump_int64_t, 8);
-
-
-	/// Medium qualifier 8 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_i8, aligned_mediump_i8, 1);
-
-	/// Medium qualifier 16 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_i16, aligned_mediump_i16, 2);
-
-	/// Medium qualifier 32 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_i32, aligned_mediump_i32, 4);
-
-	/// Medium qualifier 64 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_i64, aligned_mediump_i64, 8);
-
-
-	/// High qualifier 8 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_int8, aligned_highp_int8, 1);
-
-	/// High qualifier 16 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_int16, aligned_highp_int16, 2);
-
-	/// High qualifier 32 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_int32, aligned_highp_int32, 4);
-
-	/// High qualifier 64 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_int64, aligned_highp_int64, 8);
-
-
-	/// High qualifier 8 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_int8_t, aligned_highp_int8_t, 1);
-
-	/// High qualifier 16 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_int16_t, aligned_highp_int16_t, 2);
-
-	/// High qualifier 32 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_int32_t, aligned_highp_int32_t, 4);
-
-	/// High qualifier 64 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_int64_t, aligned_highp_int64_t, 8);
-
-
-	/// High qualifier 8 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_i8, aligned_highp_i8, 1);
-
-	/// High qualifier 16 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_i16, aligned_highp_i16, 2);
-
-	/// High qualifier 32 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_i32, aligned_highp_i32, 4);
-
-	/// High qualifier 64 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_i64, aligned_highp_i64, 8);
-
-
-	/// Default qualifier 8 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(int8, aligned_int8, 1);
-
-	/// Default qualifier 16 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(int16, aligned_int16, 2);
-
-	/// Default qualifier 32 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(int32, aligned_int32, 4);
-
-	/// Default qualifier 64 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(int64, aligned_int64, 8);
-
-
-	/// Default qualifier 8 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(int8_t, aligned_int8_t, 1);
-
-	/// Default qualifier 16 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(int16_t, aligned_int16_t, 2);
-
-	/// Default qualifier 32 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(int32_t, aligned_int32_t, 4);
-
-	/// Default qualifier 64 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(int64_t, aligned_int64_t, 8);
-
-
 	/// Default qualifier 8 bit signed integer aligned scalar type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i8, aligned_i8, 1);
-
-	/// Default qualifier 16 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i16, aligned_i16, 2);
-
-	/// Default qualifier 32 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i32, aligned_i32, 4);
-
-	/// Default qualifier 64 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i64, aligned_i64, 8);
-
-
-	/// Default qualifier 32 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(ivec1, aligned_ivec1, 4);
-
-	/// Default qualifier 32 bit signed integer aligned vector of 2 components type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(ivec2, aligned_ivec2, 8);
-
-	/// Default qualifier 32 bit signed integer aligned vector of 3 components type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(ivec3, aligned_ivec3, 16);
-
-	/// Default qualifier 32 bit signed integer aligned vector of 4 components type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(ivec4, aligned_ivec4, 16);
-
-
-	/// Default qualifier 8 bit signed integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i8vec1, aligned_i8vec1, 1);
+	typedef vec<1, int8, aligned_highp>		aligned_i8vec1;
 
 	/// Default qualifier 8 bit signed integer aligned vector of 2 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i8vec2, aligned_i8vec2, 2);
+	typedef vec<2, int8, aligned_highp>		aligned_i8vec2;
 
 	/// Default qualifier 8 bit signed integer aligned vector of 3 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i8vec3, aligned_i8vec3, 4);
+	typedef vec<3, int8, aligned_highp>		aligned_i8vec3;
 
 	/// Default qualifier 8 bit signed integer aligned vector of 4 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i8vec4, aligned_i8vec4, 4);
+	typedef vec<4, int8, aligned_highp>		aligned_i8vec4;
 
 
 	/// Default qualifier 16 bit signed integer aligned scalar type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i16vec1, aligned_i16vec1, 2);
+	typedef vec<1, int16, aligned_highp>	aligned_i16vec1;
 
 	/// Default qualifier 16 bit signed integer aligned vector of 2 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i16vec2, aligned_i16vec2, 4);
+	typedef vec<2, int16, aligned_highp>	aligned_i16vec2;
 
 	/// Default qualifier 16 bit signed integer aligned vector of 3 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i16vec3, aligned_i16vec3, 8);
+	typedef vec<3, int16, aligned_highp>	aligned_i16vec3;
 
 	/// Default qualifier 16 bit signed integer aligned vector of 4 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i16vec4, aligned_i16vec4, 8);
+	typedef vec<4, int16, aligned_highp>	aligned_i16vec4;
 
 
 	/// Default qualifier 32 bit signed integer aligned scalar type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i32vec1, aligned_i32vec1, 4);
+	typedef vec<1, int32, aligned_highp>	aligned_i32vec1;
 
 	/// Default qualifier 32 bit signed integer aligned vector of 2 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i32vec2, aligned_i32vec2, 8);
+	typedef vec<2, int32, aligned_highp>	aligned_i32vec2;
 
 	/// Default qualifier 32 bit signed integer aligned vector of 3 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i32vec3, aligned_i32vec3, 16);
+	typedef vec<3, int32, aligned_highp>	aligned_i32vec3;
 
 	/// Default qualifier 32 bit signed integer aligned vector of 4 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i32vec4, aligned_i32vec4, 16);
+	typedef vec<4, int32, aligned_highp>	aligned_i32vec4;
 
 
 	/// Default qualifier 64 bit signed integer aligned scalar type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i64vec1, aligned_i64vec1, 8);
+	typedef vec<1, int64, aligned_highp>	aligned_i64vec1;
 
 	/// Default qualifier 64 bit signed integer aligned vector of 2 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i64vec2, aligned_i64vec2, 16);
+	typedef vec<2, int64, aligned_highp>	aligned_i64vec2;
 
 	/// Default qualifier 64 bit signed integer aligned vector of 3 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i64vec3, aligned_i64vec3, 32);
+	typedef vec<3, int64, aligned_highp>	aligned_i64vec3;
 
 	/// Default qualifier 64 bit signed integer aligned vector of 4 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(i64vec4, aligned_i64vec4, 32);
+	typedef vec<4, int64, aligned_highp>	aligned_i64vec4;
 
 
 	/////////////////////////////
 	// Unsigned int vector types
 
-	/// Low qualifier 8 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_uint8, aligned_lowp_uint8, 1);
-
-	/// Low qualifier 16 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_uint16, aligned_lowp_uint16, 2);
-
-	/// Low qualifier 32 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_uint32, aligned_lowp_uint32, 4);
-
-	/// Low qualifier 64 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_uint64, aligned_lowp_uint64, 8);
-
-
-	/// Low qualifier 8 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_uint8_t, aligned_lowp_uint8_t, 1);
-
-	/// Low qualifier 16 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_uint16_t, aligned_lowp_uint16_t, 2);
-
-	/// Low qualifier 32 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_uint32_t, aligned_lowp_uint32_t, 4);
-
-	/// Low qualifier 64 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_uint64_t, aligned_lowp_uint64_t, 8);
-
-
-	/// Low qualifier 8 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_u8, aligned_lowp_u8, 1);
-
-	/// Low qualifier 16 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_u16, aligned_lowp_u16, 2);
-
-	/// Low qualifier 32 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_u32, aligned_lowp_u32, 4);
-
-	/// Low qualifier 64 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(lowp_u64, aligned_lowp_u64, 8);
-
-
-	/// Medium qualifier 8 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_uint8, aligned_mediump_uint8, 1);
-
-	/// Medium qualifier 16 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_uint16, aligned_mediump_uint16, 2);
-
-	/// Medium qualifier 32 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_uint32, aligned_mediump_uint32, 4);
-
-	/// Medium qualifier 64 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_uint64, aligned_mediump_uint64, 8);
-
-
-	/// Medium qualifier 8 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_uint8_t, aligned_mediump_uint8_t, 1);
-
-	/// Medium qualifier 16 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_uint16_t, aligned_mediump_uint16_t, 2);
-
-	/// Medium qualifier 32 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_uint32_t, aligned_mediump_uint32_t, 4);
-
-	/// Medium qualifier 64 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_uint64_t, aligned_mediump_uint64_t, 8);
-
-
-	/// Medium qualifier 8 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_u8, aligned_mediump_u8, 1);
-
-	/// Medium qualifier 16 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_u16, aligned_mediump_u16, 2);
-
-	/// Medium qualifier 32 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_u32, aligned_mediump_u32, 4);
-
-	/// Medium qualifier 64 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mediump_u64, aligned_mediump_u64, 8);
-
-
-	/// High qualifier 8 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_uint8, aligned_highp_uint8, 1);
-
-	/// High qualifier 16 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_uint16, aligned_highp_uint16, 2);
-
-	/// High qualifier 32 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_uint32, aligned_highp_uint32, 4);
-
-	/// High qualifier 64 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_uint64, aligned_highp_uint64, 8);
-
-
-	/// High qualifier 8 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_uint8_t, aligned_highp_uint8_t, 1);
-
-	/// High qualifier 16 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_uint16_t, aligned_highp_uint16_t, 2);
-
-	/// High qualifier 32 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_uint32_t, aligned_highp_uint32_t, 4);
-
-	/// High qualifier 64 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_uint64_t, aligned_highp_uint64_t, 8);
-
-
-	/// High qualifier 8 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_u8, aligned_highp_u8, 1);
-
-	/// High qualifier 16 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_u16, aligned_highp_u16, 2);
-
-	/// High qualifier 32 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_u32, aligned_highp_u32, 4);
-
-	/// High qualifier 64 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(highp_u64, aligned_highp_u64, 8);
-
-
 	/// Default qualifier 8 bit unsigned integer aligned scalar type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(uint8, aligned_uint8, 1);
-
-	/// Default qualifier 16 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(uint16, aligned_uint16, 2);
-
-	/// Default qualifier 32 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(uint32, aligned_uint32, 4);
-
-	/// Default qualifier 64 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(uint64, aligned_uint64, 8);
-
-
-	/// Default qualifier 8 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(uint8_t, aligned_uint8_t, 1);
-
-	/// Default qualifier 16 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(uint16_t, aligned_uint16_t, 2);
-
-	/// Default qualifier 32 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(uint32_t, aligned_uint32_t, 4);
-
-	/// Default qualifier 64 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(uint64_t, aligned_uint64_t, 8);
-
-
-	/// Default qualifier 8 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u8, aligned_u8, 1);
-
-	/// Default qualifier 16 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u16, aligned_u16, 2);
-
-	/// Default qualifier 32 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u32, aligned_u32, 4);
-
-	/// Default qualifier 64 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u64, aligned_u64, 8);
-
-
-	/// Default qualifier 32 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(uvec1, aligned_uvec1, 4);
-
-	/// Default qualifier 32 bit unsigned integer aligned vector of 2 components type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(uvec2, aligned_uvec2, 8);
-
-	/// Default qualifier 32 bit unsigned integer aligned vector of 3 components type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(uvec3, aligned_uvec3, 16);
-
-	/// Default qualifier 32 bit unsigned integer aligned vector of 4 components type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(uvec4, aligned_uvec4, 16);
-
-
-	/// Default qualifier 8 bit unsigned integer aligned scalar type.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u8vec1, aligned_u8vec1, 1);
+	typedef vec<1, uint8, aligned_highp>	aligned_u8vec1;
 
 	/// Default qualifier 8 bit unsigned integer aligned vector of 2 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u8vec2, aligned_u8vec2, 2);
+	typedef vec<2, uint8, aligned_highp>	aligned_u8vec2;
 
 	/// Default qualifier 8 bit unsigned integer aligned vector of 3 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u8vec3, aligned_u8vec3, 4);
+	typedef vec<3, uint8, aligned_highp>	aligned_u8vec3;
 
 	/// Default qualifier 8 bit unsigned integer aligned vector of 4 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u8vec4, aligned_u8vec4, 4);
+	typedef vec<4, uint8, aligned_highp>	aligned_u8vec4;
 
 
 	/// Default qualifier 16 bit unsigned integer aligned scalar type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u16vec1, aligned_u16vec1, 2);
+	typedef vec<1, uint16, aligned_highp>	aligned_u16vec1;
 
 	/// Default qualifier 16 bit unsigned integer aligned vector of 2 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u16vec2, aligned_u16vec2, 4);
+	typedef vec<2, uint16, aligned_highp>	aligned_u16vec2;
 
 	/// Default qualifier 16 bit unsigned integer aligned vector of 3 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u16vec3, aligned_u16vec3, 8);
+	typedef vec<3, uint16, aligned_highp>	aligned_u16vec3;
 
 	/// Default qualifier 16 bit unsigned integer aligned vector of 4 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u16vec4, aligned_u16vec4, 8);
+	typedef vec<4, uint16, aligned_highp>	aligned_u16vec4;
 
 
 	/// Default qualifier 32 bit unsigned integer aligned scalar type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u32vec1, aligned_u32vec1, 4);
+	typedef vec<1, uint32, aligned_highp>	aligned_u32vec1;
 
 	/// Default qualifier 32 bit unsigned integer aligned vector of 2 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u32vec2, aligned_u32vec2, 8);
+	typedef vec<2, uint32, aligned_highp>	aligned_u32vec2;
 
 	/// Default qualifier 32 bit unsigned integer aligned vector of 3 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u32vec3, aligned_u32vec3, 16);
+	typedef vec<3, uint32, aligned_highp>	aligned_u32vec3;
 
 	/// Default qualifier 32 bit unsigned integer aligned vector of 4 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u32vec4, aligned_u32vec4, 16);
+	typedef vec<4, uint32, aligned_highp>	aligned_u32vec4;
 
 
 	/// Default qualifier 64 bit unsigned integer aligned scalar type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u64vec1, aligned_u64vec1, 8);
+	typedef vec<1, uint64, aligned_highp>	aligned_u64vec1;
 
 	/// Default qualifier 64 bit unsigned integer aligned vector of 2 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u64vec2, aligned_u64vec2, 16);
+	typedef vec<2, uint64, aligned_highp>	aligned_u64vec2;
 
 	/// Default qualifier 64 bit unsigned integer aligned vector of 3 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u64vec3, aligned_u64vec3, 32);
+	typedef vec<3, uint64, aligned_highp>	aligned_u64vec3;
 
 	/// Default qualifier 64 bit unsigned integer aligned vector of 4 components type.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(u64vec4, aligned_u64vec4, 32);
+	typedef vec<4, uint64, aligned_highp>	aligned_u64vec4;
 
 
 	//////////////////////
 	// Float vector types
 
-	/// 32 bit single-qualifier floating-point aligned scalar.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(float32, aligned_float32, 4);
-
-	/// 32 bit single-qualifier floating-point aligned scalar.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(float32_t, aligned_float32_t, 4);
-
-	/// 32 bit single-qualifier floating-point aligned scalar.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(float32, aligned_f32, 4);
-
-#	ifndef GLM_FORCE_SINGLE_ONLY
-
-	/// 64 bit double-qualifier floating-point aligned scalar.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(float64, aligned_float64, 8);
-
-	/// 64 bit double-qualifier floating-point aligned scalar.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(float64_t, aligned_float64_t, 8);
-
-	/// 64 bit double-qualifier floating-point aligned scalar.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(float64, aligned_f64, 8);
-
-#	endif//GLM_FORCE_SINGLE_ONLY
-
-
 	/// Single-qualifier floating-point aligned vector of 1 component.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(vec1, aligned_vec1, 4);
+	typedef vec<1, float, aligned_highp>	aligned_fvec1;
 
 	/// Single-qualifier floating-point aligned vector of 2 components.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(vec2, aligned_vec2, 8);
+	typedef vec<2, float, aligned_highp>	aligned_fvec2;
 
 	/// Single-qualifier floating-point aligned vector of 3 components.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(vec3, aligned_vec3, 16);
+	typedef vec<3, float, aligned_highp>	aligned_fvec3;
 
 	/// Single-qualifier floating-point aligned vector of 4 components.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(vec4, aligned_vec4, 16);
+	typedef vec<4, float, aligned_highp>	aligned_fvec4;
 
 
 	/// Single-qualifier floating-point aligned vector of 1 component.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(fvec1, aligned_fvec1, 4);
+	typedef vec<1, float, aligned_highp>	aligned_f32vec1;
 
 	/// Single-qualifier floating-point aligned vector of 2 components.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(fvec2, aligned_fvec2, 8);
+	typedef vec<2, float, aligned_highp>	aligned_f32vec2;
 
 	/// Single-qualifier floating-point aligned vector of 3 components.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(fvec3, aligned_fvec3, 16);
+	typedef vec<3, float, aligned_highp>	aligned_f32vec3;
 
 	/// Single-qualifier floating-point aligned vector of 4 components.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(fvec4, aligned_fvec4, 16);
-
-
-	/// Single-qualifier floating-point aligned vector of 1 component.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(f32vec1, aligned_f32vec1, 4);
-
-	/// Single-qualifier floating-point aligned vector of 2 components.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(f32vec2, aligned_f32vec2, 8);
-
-	/// Single-qualifier floating-point aligned vector of 3 components.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(f32vec3, aligned_f32vec3, 16);
-
-	/// Single-qualifier floating-point aligned vector of 4 components.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(f32vec4, aligned_f32vec4, 16);
-
-
-	/// Double-qualifier floating-point aligned vector of 1 component.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(dvec1, aligned_dvec1, 8);
-
-	/// Double-qualifier floating-point aligned vector of 2 components.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(dvec2, aligned_dvec2, 16);
-
-	/// Double-qualifier floating-point aligned vector of 3 components.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(dvec3, aligned_dvec3, 32);
-
-	/// Double-qualifier floating-point aligned vector of 4 components.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(dvec4, aligned_dvec4, 32);
+	typedef vec<4, float, aligned_highp>	aligned_f32vec4;
 
 
-#	ifndef GLM_FORCE_SINGLE_ONLY
-
 	/// Double-qualifier floating-point aligned vector of 1 component.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(f64vec1, aligned_f64vec1, 8);
+	typedef vec<1, double, aligned_highp>	aligned_f64vec1;
 
 	/// Double-qualifier floating-point aligned vector of 2 components.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(f64vec2, aligned_f64vec2, 16);
+	typedef vec<2, double, aligned_highp>	aligned_f64vec2;
 
 	/// Double-qualifier floating-point aligned vector of 3 components.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(f64vec3, aligned_f64vec3, 32);
+	typedef vec<3, double, aligned_highp>	aligned_f64vec3;
 
 	/// Double-qualifier floating-point aligned vector of 4 components.
 	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(f64vec4, aligned_f64vec4, 32);
-
-#	endif//GLM_FORCE_SINGLE_ONLY
+	typedef vec<4, double, aligned_highp>	aligned_f64vec4;
 
 	//////////////////////
 	// Float matrix types
-
-	/// Single-qualifier floating-point aligned 1x1 matrix.
-	/// @see gtx_type_aligned
-	//typedef detail::tmat1<f32> mat1;
-
-	/// Single-qualifier floating-point aligned 2x2 matrix.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mat2, aligned_mat2, 16);
-
-	/// Single-qualifier floating-point aligned 3x3 matrix.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mat3, aligned_mat3, 16);
-
-	/// Single-qualifier floating-point aligned 4x4 matrix.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mat4, aligned_mat4, 16);
-
-
-	/// Single-qualifier floating-point aligned 1x1 matrix.
-	/// @see gtx_type_aligned
-	//typedef detail::tmat1x1<f32> mat1;
-
-	/// Single-qualifier floating-point aligned 2x2 matrix.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mat2x2, aligned_mat2x2, 16);
-
-	/// Single-qualifier floating-point aligned 3x3 matrix.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mat3x3, aligned_mat3x3, 16);
-
-	/// Single-qualifier floating-point aligned 4x4 matrix.
-	/// @see gtx_type_aligned
-	GLM_ALIGNED_TYPEDEF(mat4x4, aligned_mat4x4, 16);
-
-
-	/// Single-qualifier floating-point aligned 1x1 matrix.
-	/// @see gtx_type_aligned
-	//typedef detail::tmat1x1<f32> fmat1;
-
+/*
 	/// Single-qualifier floating-point aligned 2x2 matrix.
 	/// @see gtx_type_aligned
 	GLM_ALIGNED_TYPEDEF(fmat2x2, aligned_fmat2, 16);
@@ -786,10 +240,6 @@ namespace glm
 	GLM_ALIGNED_TYPEDEF(fmat4x4, aligned_fmat4, 16);
 
 
-	/// Single-qualifier floating-point aligned 1x1 matrix.
-	/// @see gtx_type_aligned
-	//typedef f32 fmat1x1;
-
 	/// Single-qualifier floating-point aligned 2x2 matrix.
 	/// @see gtx_type_aligned
 	GLM_ALIGNED_TYPEDEF(fmat2x2, aligned_fmat2x2, 16);
@@ -973,7 +423,7 @@ namespace glm
 	GLM_ALIGNED_TYPEDEF(f64quat, aligned_f64quat, 32);
 
 #	endif//GLM_FORCE_SINGLE_ONLY
-
+*/
 	/// @}
 }//namespace glm
 

+ 145 - 0
test/core/core_force_aligned_gentypes.cpp

@@ -1,10 +1,155 @@
 #include <glm/glm.hpp>
 #include <glm/ext.hpp>
 
+#if GLM_COMPILER & GLM_COMPILER_CLANG
+#	pragma clang diagnostic push
+#	pragma clang diagnostic ignored "-Wpadded"
+#elif defined(_MSC_VER)
+#	pragma warning(push)
+#	pragma warning(disable: 4324)  // structure was padded due to alignment specifier
+#endif
+
+#ifdef GLM_FORCE_XYZW_ONLY
+#error Aligned types are not supported
+#endif
+
+// Every object of type struct_float will be aligned
+// to alignof(float) boundary (usually 4):
+struct alignas(float) struct_float
+{
+    // your definition here
+};
+
+struct alignas(16) struct_sse3_t
+{
+    float sse_data[3];
+};
+ 
+struct alignas(16) struct_sse4_t
+{
+    float sse_data[4];
+};
+
+struct struct_sse4_packed
+{
+    float sse_data[4];
+};
+
+struct alignas(16) storage_type {
+	float sse_data[3];
+};
+
+struct struct_sse4_data
+{
+	storage_type data;
+};
+
+template<glm::qualifier P>
+struct is_aligned
+{
+	static const bool value = false;
+};
+
+template<>
+struct is_aligned<glm::aligned_lowp>
+{
+	static const bool value = true;
+};
+
+template<>
+struct is_aligned<glm::aligned_mediump>
+{
+	static const bool value = true;
+};
+
+template<>
+struct is_aligned<glm::aligned_highp>
+{
+	static const bool value = true;
+};
+
+template<glm::length_t L, typename T, bool is_aligned>
+struct storage
+{
+	T data[L];
+};
+
+template<glm::length_t L, typename T>
+struct alignas(L * sizeof(T)) storage<L, T, true>
+{
+	T data[L];
+};
+
+template<typename T>
+struct alignas(4 * sizeof(T)) storage<3, T, true>
+{
+	T data[3];
+};
+
 int main()
 {
 	int Error = 0;
 
+	static_assert(sizeof(storage<4, float, true>) == 16);
+	static_assert(alignof(storage<4, float, true>) == 16);
+
+	static_assert(sizeof(storage<3, float, true>) == 16);
+	static_assert(alignof(storage<3, float, true>) == 16);
+
+	static_assert(sizeof(storage<4, float, false>) == 16);
+	static_assert(alignof(storage<4, float, false>) == 4);
+
+	static_assert(sizeof(storage<3, float, false>) == 12);
+	static_assert(alignof(storage<3, float, false>) == 4);
+
+	static_assert(sizeof(struct_sse3_t) == 16);
+	static_assert(alignof(struct_sse3_t) == 16);
+
+	static_assert(sizeof(struct_sse4_t) == 16);
+	static_assert(alignof(struct_sse4_t) == 16);
+
+	static_assert(sizeof(struct_sse4_packed) == 16);
+	static_assert(alignof(struct_sse4_packed) == 4);
+
+	static_assert(sizeof(struct_sse4_data) == 16);
+	static_assert(alignof(struct_sse4_data) == 16);
+
+	static_assert(alignof(struct_float) == 4);
+
+	static_assert(sizeof(glm::vec3) == 12);
+	static_assert(sizeof(glm::vec4) == 16);
+
+#if defined(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES)
+	static_assert(alignof(glm::vec3) == 16);
+	static_assert(alignof(glm::vec4) == 16);
+#else
+	static_assert(alignof(glm::vec3) == 4);
+	static_assert(alignof(glm::vec4) == 4);
+#endif
+
+#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // FIXME, should work without SIMD
+	static_assert(sizeof(glm::aligned_vec3) == 16);
+	static_assert(alignof(glm::aligned_vec3) == 16);
+#endif
+
+	static_assert(sizeof(glm::packed_vec3) == 12);
+	static_assert(alignof(glm::packed_vec3) == 4);
+
+	static_assert(sizeof(glm::aligned_vec4) == 16);
+#if (GLM_ARCH & GLM_ARCH_SIMD_BIT) // FIXME, should work without SIMD
+	static_assert(alignof(glm::aligned_vec4) == 16);
+#endif
+	static_assert(sizeof(glm::packed_vec4) == 16);
+	static_assert(alignof(glm::packed_vec4) == 4);
+
+	//static_assert(alignof(glm::detail::storage<3, float, true>) == 16);
+
 	return Error;
 }
 
+#if GLM_COMPILER & GLM_COMPILER_CLANG
+#	pragma clang diagnostic pop
+#elif defined(_MSC_VER)
+#	pragma warning(pop)
+#endif
+