mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 04:31:47 +00:00
Merge 0.9.8 branch
This commit is contained in:
commit
ecc91d4361
@ -89,6 +89,7 @@ else()
|
||||
add_definitions(/Za)
|
||||
elseif(("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") OR ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU"))
|
||||
add_definitions(-pedantic)
|
||||
add_definitions(-pedantic)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -647,6 +647,10 @@
|
||||
# define GLM_EXPLICIT
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define GLM_HAS_ALIGNED_TYPE GLM_HAS_UNRESTRICTED_UNIONS
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Length type
|
||||
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -49,7 +49,7 @@ namespace detail
|
||||
return Result;
|
||||
}
|
||||
};
|
||||
# endif
|
||||
# endif//GLM_SWIZZLE
|
||||
|
||||
template <precision P>
|
||||
struct compute_vec4_add<float, P, true>
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
||||
|
@ -1,6 +1,16 @@
|
||||
#define GLM_FORCE_ALIGNED
|
||||
#define GLM_MESSAGES
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#if GLM_HAS_ALIGNED_TYPE
|
||||
#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
|
||||
{
|
||||
glm::uint32 a;
|
||||
@ -27,7 +37,6 @@ struct my_dvec4_aligned
|
||||
glm::uint64 a;
|
||||
glm::aligned_dvec4 b;
|
||||
};
|
||||
//FIXME
|
||||
//GLM_STATIC_ASSERT(sizeof(my_dvec4_aligned) == sizeof(glm::aligned_dvec4) * 2, "glm::dvec4 aligned is not correct");
|
||||
|
||||
struct my_ivec4_packed
|
||||
@ -81,7 +90,6 @@ int test_copy()
|
||||
return Error;
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
int Error = 0;
|
||||
@ -99,3 +107,12 @@ int main()
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int main()
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif//GLM_HAS_ALIGNED_TYPE
|
||||
|
@ -17,9 +17,11 @@ namespace
|
||||
case glm::highp: os << "uhi"; break;
|
||||
case glm::mediump: os << "umd"; break;
|
||||
case glm::lowp: os << "ulo"; break;
|
||||
case glm::aligned_highp: os << "ahi"; break;
|
||||
case glm::aligned_mediump: os << "amd"; break;
|
||||
case glm::aligned_lowp: os << "alo"; break;
|
||||
# if GLM_HAS_ALIGNED_TYPE
|
||||
case glm::aligned_highp: os << "ahi"; break;
|
||||
case glm::aligned_mediump: os << "amd"; break;
|
||||
case glm::aligned_lowp: os << "alo"; break;
|
||||
# endif
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user