Improved aligned types support
This commit is contained in:
@@ -647,6 +647,10 @@
|
||||
# define GLM_EXPLICIT
|
||||
#endif
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#define GLM_HAS_ALIGNED_TYPE GLM_HAS_UNRESTRICTED_UNIONS
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////
|
||||
// Length type
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -27,7 +27,7 @@ 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"
|
||||
|
||||
@@ -26,7 +26,7 @@ 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"
|
||||
|
||||
@@ -26,7 +26,7 @@ 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"
|
||||
|
||||
@@ -27,7 +27,7 @@ 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"
|
||||
|
||||
@@ -40,7 +40,7 @@ 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"
|
||||
|
||||
Reference in New Issue
Block a user