From eb20cdc6ae1105ce5ec1aa00698577dd314dacd0 Mon Sep 17 00:00:00 2001 From: Christophe Riccio Date: Sun, 17 Jul 2016 02:17:25 +0200 Subject: [PATCH] Added precision qualifier tests --- glm/detail/precision.hpp | 22 +++++++++++----------- test/gtc/gtc_type_aligned.cpp | 8 ++++++++ 2 files changed, 19 insertions(+), 11 deletions(-) diff --git a/glm/detail/precision.hpp b/glm/detail/precision.hpp index 8b1e2929..d3ced27f 100644 --- a/glm/detail/precision.hpp +++ b/glm/detail/precision.hpp @@ -7,17 +7,17 @@ namespace glm { enum precision { - highp, - mediump, - lowp, aligned_highp, aligned_mediump, aligned_lowp, - packed_highp = highp, - packed_mediump = mediump, - packed_lowp = lowp, - packed = packed_highp, + packed_highp, + packed_mediump, + packed_lowp, aligned = aligned_highp, + packed = packed_highp, + highp = packed_highp, + mediump = packed_mediump, + lowp = packed_lowp, # ifdef GLM_FORCE_ALIGNED defaultp = aligned_highp # else @@ -27,26 +27,26 @@ namespace glm namespace detail { - template + template struct is_aligned { static const bool value = false; }; template<> - struct is_aligned + struct is_aligned { static const bool value = true; }; template<> - struct is_aligned + struct is_aligned { static const bool value = true; }; template<> - struct is_aligned + struct is_aligned { static const bool value = true; }; diff --git a/test/gtc/gtc_type_aligned.cpp b/test/gtc/gtc_type_aligned.cpp index 303b7aec..202cc6fd 100644 --- a/test/gtc/gtc_type_aligned.cpp +++ b/test/gtc/gtc_type_aligned.cpp @@ -1,6 +1,14 @@ +#define GLM_MESSAGES #define GLM_FORCE_ALIGNED #include +GLM_STATIC_ASSERT(glm::detail::is_aligned::value, "aligned_lowp is not aligned"); +GLM_STATIC_ASSERT(glm::detail::is_aligned::value, "aligned_mediump is not aligned"); +GLM_STATIC_ASSERT(glm::detail::is_aligned::value, "aligned_highp is not aligned"); +GLM_STATIC_ASSERT(!glm::detail::is_aligned::value, "packed_highp is aligned"); +GLM_STATIC_ASSERT(!glm::detail::is_aligned::value, "packed_mediump is aligned"); +GLM_STATIC_ASSERT(!glm::detail::is_aligned::value, "packed_lowp is aligned"); + struct my_vec4_packed { glm::uint32 a;