mirror of
https://github.com/g-truc/glm.git
synced 2024-11-23 01:14:34 +00:00
Merged graft commit
This commit is contained in:
parent
cb7179239b
commit
ca0b7a9929
@ -9,15 +9,6 @@
|
|||||||
namespace glm{
|
namespace glm{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
template<std::size_t N> struct aligned {};
|
|
||||||
template<> GLM_ALIGNED_STRUCT(1) aligned<1>{};
|
|
||||||
template<> GLM_ALIGNED_STRUCT(2) aligned<2>{};
|
|
||||||
template<> GLM_ALIGNED_STRUCT(4) aligned<4>{};
|
|
||||||
template<> GLM_ALIGNED_STRUCT(8) aligned<8>{};
|
|
||||||
template<> GLM_ALIGNED_STRUCT(16) aligned<16>{};
|
|
||||||
template<> GLM_ALIGNED_STRUCT(32) aligned<32>{};
|
|
||||||
template<> GLM_ALIGNED_STRUCT(64) aligned<64>{};
|
|
||||||
|
|
||||||
template <typename T, std::size_t size, bool aligned>
|
template <typename T, std::size_t size, bool aligned>
|
||||||
struct storage
|
struct storage
|
||||||
{
|
{
|
||||||
@ -26,15 +17,22 @@ namespace detail
|
|||||||
} type;
|
} type;
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T, std::size_t size>
|
#define GLM_ALIGNED_STORAGE_TYPE_STRUCT(x) \
|
||||||
struct storage<T, size, true>
|
template <typename T> \
|
||||||
{
|
struct storage<T, x, true> { \
|
||||||
struct type : aligned<size>
|
GLM_ALIGNED_STRUCT(x) type { \
|
||||||
{
|
uint8_t data[x]; \
|
||||||
uint8 data[size];
|
}; \
|
||||||
};
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
GLM_ALIGNED_STORAGE_TYPE_STRUCT(1)
|
||||||
|
GLM_ALIGNED_STORAGE_TYPE_STRUCT(2)
|
||||||
|
GLM_ALIGNED_STORAGE_TYPE_STRUCT(4)
|
||||||
|
GLM_ALIGNED_STORAGE_TYPE_STRUCT(8)
|
||||||
|
GLM_ALIGNED_STORAGE_TYPE_STRUCT(16)
|
||||||
|
GLM_ALIGNED_STORAGE_TYPE_STRUCT(32)
|
||||||
|
GLM_ALIGNED_STORAGE_TYPE_STRUCT(64)
|
||||||
|
|
||||||
# if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
# if GLM_ARCH & GLM_ARCH_SSE2_BIT
|
||||||
template <>
|
template <>
|
||||||
struct storage<float, 16, true>
|
struct storage<float, 16, true>
|
||||||
|
Loading…
Reference in New Issue
Block a user