Merge 0.9.8 branch

This commit is contained in:
Christophe Riccio
2016-07-17 11:52:15 +02:00
18 changed files with 138 additions and 54 deletions

View File

@@ -12,6 +12,15 @@
#endif//(GLM_ARCH & GLM_ARCH_X86 && GLM_COMPILER & GLM_COMPILER_VC)
#include <limits>
#if !GLM_HAS_EXTENDED_INTEGER_TYPE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic ignored "-Wlong-long"
# endif
# if (GLM_COMPILER & GLM_COMPILER_CLANG)
# pragma clang diagnostic ignored "-Wc++11-long-long"
# endif
#endif
namespace glm{
namespace detail
{

View File

@@ -3,52 +3,61 @@
#pragma once
#include "setup.hpp"
namespace glm
{
enum precision
{
highp,
mediump,
lowp,
aligned_highp,
aligned_mediump,
aligned_lowp,
packed_highp = highp,
packed_mediump = mediump,
packed_lowp = lowp,
packed_highp,
packed_mediump,
packed_lowp,
# if GLM_HAS_ALIGNED_TYPE
aligned_highp,
aligned_mediump,
aligned_lowp,
aligned = aligned_highp,
# endif
highp = packed_highp,
mediump = packed_mediump,
lowp = packed_lowp,
packed = packed_highp,
aligned = aligned_highp,
# ifdef GLM_FORCE_ALIGNED
# if GLM_HAS_ALIGNED_TYPE && defined(GLM_FORCE_ALIGNED)
defaultp = aligned_highp
# else
defaultp = highp
# endif
};
namespace detail
{
template <precision P>
template <glm::precision P>
struct is_aligned
{
static const bool value = false;
};
template<>
struct is_aligned<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<aligned_mediump>
{
static const bool value = true;
};
template<>
struct is_aligned<glm::aligned_mediump>
{
static const bool value = true;
};
template<>
struct is_aligned<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

@@ -647,6 +647,10 @@
# define GLM_EXPLICIT
#endif
///////////////////////////////////////////////////////////////////////////////////
#define GLM_HAS_ALIGNED_TYPE GLM_HAS_UNRESTRICTED_UNIONS
///////////////////////////////////////////////////////////////////////////////////
// Length type

View File

@@ -35,7 +35,7 @@ namespace detail
typedef unsigned __int64 uint64;
# elif GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic ignored "-Wno-long-long"
# pragma GCC diagnostic ignored "-Wlong-long"
__extension__ typedef signed long long sint64;
__extension__ typedef unsigned long long uint64;

View File

@@ -16,7 +16,7 @@ namespace detail
uint8 data[size];
} type;
};
/*
template <typename T, std::size_t size>
struct storage<T, size, true>
{
@@ -24,7 +24,7 @@ namespace detail
uint8 data[size];
} type;
};
*/
# if GLM_ARCH & GLM_ARCH_SSE2_BIT
template <>
struct storage<float, 16, true>
@@ -43,6 +43,31 @@ namespace detail
{
typedef glm_uvec4 type;
};
/*
# else
typedef union __declspec(align(16)) glm_128
{
unsigned __int8 data[16];
} glm_128;
template <>
struct storage<float, 16, true>
{
typedef glm_128 type;
};
template <>
struct storage<int, 16, true>
{
typedef glm_128 type;
};
template <>
struct storage<unsigned int, 16, true>
{
typedef glm_128 type;
};
*/
# endif
# if (GLM_ARCH & GLM_ARCH_AVX_BIT)

View File

@@ -21,16 +21,16 @@ namespace glm
{
// -- Implementation detail --
typedef T value_type;
typedef tvec1<T, P> type;
typedef tvec1<bool, P> bool_type;
typedef T value_type;
// -- Data --
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
# if GLM_HAS_ALIGNED_TYPE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpedantic"
# pragma GCC diagnostic ignored "-pedantic"
# endif
# if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push

View File

@@ -26,10 +26,10 @@ namespace glm
// -- Data --
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
# if GLM_HAS_ALIGNED_TYPE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpedantic"
# pragma GCC diagnostic ignored "-pedantic"
# endif
# if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push

View File

@@ -20,16 +20,16 @@ namespace glm
{
// -- Implementation detail --
typedef T value_type;
typedef tvec3<T, P> type;
typedef tvec3<bool, P> bool_type;
typedef T value_type;
// -- Data --
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
# if GLM_HAS_ALIGNED_TYPE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpedantic"
# pragma GCC diagnostic ignored "-pedantic"
# endif
# if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push

View File

@@ -3,7 +3,6 @@
#pragma once
#include "setup.hpp"
#include "type_vec.hpp"
#ifdef GLM_SWIZZLE
# if GLM_HAS_ANONYMOUS_UNION
@@ -27,10 +26,10 @@ namespace glm
// -- Data --
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
# if GLM_HAS_ALIGNED_TYPE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpedantic"
# pragma GCC diagnostic ignored "-pedantic"
# endif
# if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push

View File

@@ -970,6 +970,6 @@ namespace detail
}
}//namespace glm
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_ALIGNED_TYPE
# include "type_vec4_simd.inl"
#endif

View File

@@ -49,7 +49,7 @@ namespace detail
return Result;
}
};
# endif
# endif//GLM_SWIZZLE
template <precision P>
struct compute_vec4_add<float, P, true>

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

@@ -40,10 +40,10 @@ namespace glm
// -- Data --
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
# if GLM_HAS_ALIGNED_TYPE
# if GLM_COMPILER & GLM_COMPILER_GCC
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wpedantic"
# pragma GCC diagnostic ignored "-pedantic"
# endif
# if GLM_COMPILER & GLM_COMPILER_CLANG
# pragma clang diagnostic push

View File

@@ -795,7 +795,7 @@ namespace detail
}
}//namespace glm
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_UNRESTRICTED_UNIONS
#if GLM_ARCH != GLM_ARCH_PURE && GLM_HAS_ALIGNED_TYPE
# include "quaternion_simd.inl"
#endif

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