Improved aligned types support

This commit is contained in:
Christophe Riccio
2016-07-17 03:37:24 +02:00
parent ad1ae45066
commit 8c8c8367e3
4 changed files with 61 additions and 30 deletions

View File

@@ -7,18 +7,23 @@ namespace glm
{
enum precision
{
aligned_highp,
aligned_mediump,
aligned_lowp,
packed_highp,
packed_mediump,
packed_lowp,
aligned = aligned_highp,
packed = packed_highp,
# if GLM_HAS_ALIGNED_TYPE
aligned_highp,
aligned_mediump,
aligned_lowp,
aligned = aligned_highp,
# endif
highp = packed_highp,
mediump = packed_mediump,
lowp = packed_lowp,
# ifdef GLM_FORCE_ALIGNED
packed = packed_highp,
# if GLM_HAS_ALIGNED_TYPE && defined(GLM_FORCE_ALIGNED)
defaultp = aligned_highp
# else
defaultp = highp
@@ -33,22 +38,24 @@ namespace detail
static const bool value = false;
};
template<>
struct is_aligned<glm::aligned_lowp>
{
static const bool value = true;
};
# if GLM_HAS_ALIGNED_TYPE
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;
};
template<>
struct is_aligned<glm::aligned_highp>
{
static const bool value = true;
};
# endif
}//namespace detail
}//namespace glm

View File

@@ -50,6 +50,9 @@
#include "./gtc/type_ptr.hpp"
#include "./gtc/ulp.hpp"
#include "./gtc/vec1.hpp"
#if GLM_HAS_ALIGNED_TYPE
# include "./gtc/type_aligned.hpp"
#endif
#include "./gtx/associated_min_max.hpp"
#include "./gtx/bit.hpp"
@@ -95,7 +98,6 @@
#endif
#include "./gtx/transform.hpp"
#include "./gtx/transform2.hpp"
#include "./gtx/type_aligned.hpp"
#include "./gtx/vector_angle.hpp"
#include "./gtx/vector_query.hpp"
#include "./gtx/wrap.hpp"

View File

@@ -1,5 +1,21 @@
/// @ref gtc_type_aligned
/// @file glm/gtc/type_aligned.hpp
///
/// @see core (dependence)
///
/// @defgroup gtc_type_aligned GLM_GTC_type_aligned
/// @ingroup gtc
///
/// @brief Aligned types.
/// <glm/gtc/type_aligned.hpp> need to be included to use these features.
#if !GLM_HAS_ALIGNED_TYPE
# error "GLM: Aligned types are not supported on this platform"
#endif
#if(defined(GLM_MESSAGES) && !defined(glm_ext))
# pragma message("GLM: GLM_GTC_type_aligned extension included")
#endif
#pragma once