mirror of
https://github.com/g-truc/glm.git
synced 2024-11-10 12:41:54 +00:00
Add support for x,y,z,w accessors to fvec4SIMD.
This is done via a union. It must be enabled with GLM_SIMD_ENABLE_XYZW_UNION. A nameless struct/union warning in VC (C4201) is explicitly disabled with the "pragma warning(push/pop)" system. Allowing xyzw access makes it much easier to toggle between SIMD and non-SIMD builds.
This commit is contained in:
parent
560b474008
commit
87c90590be
@ -54,6 +54,14 @@
|
|||||||
# pragma message("GLM: GLM_GTX_simd_vec4 extension included")
|
# pragma message("GLM: GLM_GTX_simd_vec4 extension included")
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
// Warning silencer for nameless struct/union.
|
||||||
|
#if (GLM_COMPILER & GLM_COMPILER_VC)
|
||||||
|
# pragma warning(push)
|
||||||
|
# pragma warning(disable:4201) // warning C4201: nonstandard extension used : nameless struct/union
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace glm{
|
namespace glm{
|
||||||
namespace detail
|
namespace detail
|
||||||
{
|
{
|
||||||
@ -69,7 +77,15 @@ namespace detail
|
|||||||
typedef fvec4SIMD type;
|
typedef fvec4SIMD type;
|
||||||
typedef tvec4<bool> bool_type;
|
typedef tvec4<bool> bool_type;
|
||||||
|
|
||||||
__m128 Data;
|
#ifdef GLM_SIMD_ENABLE_XYZW_UNION
|
||||||
|
union
|
||||||
|
{
|
||||||
|
__m128 Data;
|
||||||
|
struct {float x, y, z, w;};
|
||||||
|
};
|
||||||
|
#else
|
||||||
|
__m128 Data;
|
||||||
|
#endif
|
||||||
|
|
||||||
//////////////////////////////////////
|
//////////////////////////////////////
|
||||||
// Implicit basic constructors
|
// Implicit basic constructors
|
||||||
@ -490,6 +506,12 @@ namespace detail
|
|||||||
|
|
||||||
#include "simd_vec4.inl"
|
#include "simd_vec4.inl"
|
||||||
|
|
||||||
|
|
||||||
|
#if (GLM_COMPILER & GLM_COMPILER_VC)
|
||||||
|
# pragma warning(pop)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
#endif//(GLM_ARCH != GLM_ARCH_PURE)
|
#endif//(GLM_ARCH != GLM_ARCH_PURE)
|
||||||
|
|
||||||
#endif//GLM_GTX_simd_vec4
|
#endif//GLM_GTX_simd_vec4
|
||||||
|
Loading…
Reference in New Issue
Block a user