Added precision qualifier tests

master
Christophe Riccio ago%!(EXTRA string=9 years)
parent 71004231c6
commit eb20cdc6ae
  1. 22
      glm/detail/precision.hpp
  2. 8
      test/gtc/gtc_type_aligned.cpp

@ -7,17 +7,17 @@ namespace glm
{ {
enum precision enum precision
{ {
highp,
mediump,
lowp,
aligned_highp, aligned_highp,
aligned_mediump, aligned_mediump,
aligned_lowp, aligned_lowp,
packed_highp = highp, packed_highp,
packed_mediump = mediump, packed_mediump,
packed_lowp = lowp, packed_lowp,
packed = packed_highp,
aligned = aligned_highp, aligned = aligned_highp,
packed = packed_highp,
highp = packed_highp,
mediump = packed_mediump,
lowp = packed_lowp,
# ifdef GLM_FORCE_ALIGNED # ifdef GLM_FORCE_ALIGNED
defaultp = aligned_highp defaultp = aligned_highp
# else # else
@ -27,26 +27,26 @@ namespace glm
namespace detail namespace detail
{ {
template <precision P> template <glm::precision P>
struct is_aligned struct is_aligned
{ {
static const bool value = false; static const bool value = false;
}; };
template<> template<>
struct is_aligned<aligned_lowp> struct is_aligned<glm::aligned_lowp>
{ {
static const bool value = true; static const bool value = true;
}; };
template<> template<>
struct is_aligned<aligned_mediump> struct is_aligned<glm::aligned_mediump>
{ {
static const bool value = true; static const bool value = true;
}; };
template<> template<>
struct is_aligned<aligned_highp> struct is_aligned<glm::aligned_highp>
{ {
static const bool value = true; static const bool value = true;
}; };

@ -1,6 +1,14 @@
#define GLM_MESSAGES
#define GLM_FORCE_ALIGNED #define GLM_FORCE_ALIGNED
#include <glm/gtc/type_aligned.hpp> #include <glm/gtc/type_aligned.hpp>
GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_lowp>::value, "aligned_lowp is not aligned");
GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_mediump>::value, "aligned_mediump is not aligned");
GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_highp>::value, "aligned_highp is not aligned");
GLM_STATIC_ASSERT(!glm::detail::is_aligned<glm::packed_highp>::value, "packed_highp is aligned");
GLM_STATIC_ASSERT(!glm::detail::is_aligned<glm::packed_mediump>::value, "packed_mediump is aligned");
GLM_STATIC_ASSERT(!glm::detail::is_aligned<glm::packed_lowp>::value, "packed_lowp is aligned");
struct my_vec4_packed struct my_vec4_packed
{ {
glm::uint32 a; glm::uint32 a;

Loading…
Cancel
Save