mirror of
https://github.com/g-truc/glm.git
synced 2024-11-30 03:44:38 +00:00
GLM requires anynimous struct for SIMD optimizations and swizzle support #524
This commit is contained in:
parent
848d68fe96
commit
2a3d241d78
@ -27,7 +27,7 @@ namespace glm
|
|||||||
|
|
||||||
// -- Data --
|
// -- Data --
|
||||||
|
|
||||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
|
||||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
# pragma GCC diagnostic ignored "-Wpedantic"
|
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||||
|
@ -26,7 +26,7 @@ namespace glm
|
|||||||
|
|
||||||
// -- Data --
|
// -- Data --
|
||||||
|
|
||||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
|
||||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
# pragma GCC diagnostic ignored "-Wpedantic"
|
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||||
|
@ -26,7 +26,7 @@ namespace glm
|
|||||||
|
|
||||||
// -- Data --
|
// -- Data --
|
||||||
|
|
||||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
|
||||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
# pragma GCC diagnostic ignored "-Wpedantic"
|
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||||
|
@ -27,7 +27,7 @@ namespace glm
|
|||||||
|
|
||||||
// -- Data --
|
// -- Data --
|
||||||
|
|
||||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
|
||||||
# if GLM_COMPILER & GLM_COMPILER_GCC
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
# pragma GCC diagnostic push
|
# pragma GCC diagnostic push
|
||||||
# pragma GCC diagnostic ignored "-Wpedantic"
|
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||||
|
@ -40,12 +40,29 @@ namespace glm
|
|||||||
|
|
||||||
// -- Data --
|
// -- Data --
|
||||||
|
|
||||||
# if GLM_HAS_UNRESTRICTED_UNIONS
|
# if GLM_HAS_UNRESTRICTED_UNIONS && (defined(GLM_SWIZZLE) || (GLM_ARCH & (GLM_ARCH_SSE2_BIT | GLM_ARCH_NEON_BIT)))
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
# pragma GCC diagnostic push
|
||||||
|
# pragma GCC diagnostic ignored "-Wpedantic"
|
||||||
|
# endif
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# pragma clang diagnostic push
|
||||||
|
# pragma clang diagnostic ignored "-Wgnu-anonymous-struct"
|
||||||
|
# pragma clang diagnostic ignored "-Wnested-anon-types"
|
||||||
|
# endif
|
||||||
|
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
struct { T x, y, z, w;};
|
struct { T x, y, z, w;};
|
||||||
typename detail::storage<T, sizeof(T) * 4, detail::is_aligned<P>::value>::type data;
|
typename detail::storage<T, sizeof(T) * 4, detail::is_aligned<P>::value>::type data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_CLANG
|
||||||
|
# pragma clang diagnostic pop
|
||||||
|
# endif
|
||||||
|
# if GLM_COMPILER & GLM_COMPILER_GCC
|
||||||
|
# pragma GCC diagnostic pop
|
||||||
|
# endif
|
||||||
# else
|
# else
|
||||||
T x, y, z, w;
|
T x, y, z, w;
|
||||||
# endif
|
# endif
|
||||||
|
Loading…
Reference in New Issue
Block a user