Browse Source

Added GLM_SIMD to enable automatic SIMD code generation for generic GLM types #235 #370

Christophe R 10 years ago
parent
commit
79f6d92c8a
4 changed files with 10 additions and 3 deletions
  1. 4 2
      glm/detail/type_vec4.hpp
  2. 1 1
      glm/detail/type_vec4.inl
  3. 4 0
      readme.md
  4. 1 0
      test/core/core_type_mat4x4.cpp

+ 4 - 2
glm/detail/type_vec4.hpp

@@ -114,14 +114,16 @@ namespace detail
 
 		// -- Data --
 
-#		if GLM_HAS_ANONYMOUS_UNION
+#		if GLM_HAS_ANONYMOUS_UNION && GLM_NOT_BUGGY_VC32BITS
 			union
 			{
 				struct { T x, y, z, w;};
 				struct { T r, g, b, a; };
 				struct { T s, t, p, q; };
 
-				typename detail::simd<T>::type data;
+#				ifdef GLM_SIMD
+					typename detail::simd<T>::type data;
+#				endif
 
 #				ifdef GLM_SWIZZLE
 					_GLM_SWIZZLE4_2_MEMBERS(T, P, tvec2, x, y, z, w)

+ 1 - 1
glm/detail/type_vec4.inl

@@ -1104,7 +1104,7 @@ namespace glm
 	}
 }//namespace glm
 
-#if GLM_HAS_ANONYMOUS_UNION && GLM_NOT_BUGGY_VC32BITS
+#if GLM_HAS_ANONYMOUS_UNION && defined(GLM_SIMD) && GLM_NOT_BUGGY_VC32BITS
 #if GLM_ARCH & GLM_ARCH_SSE2
 #	include "type_vec4_sse2.inl"
 #endif

+ 4 - 0
readme.md

@@ -50,6 +50,10 @@ glm::mat4 camera(float Translate, glm::vec2 const & Rotate)
 
 ## Release notes
 
+#### [GLM 0.9.7.1](https://github.com/g-truc/glm/releases/latest) - 2015-XX-XX
+##### Features:
+- Added GLM_SIMD to enable automatic SIMD code generation for generic GLM types #235 #370
+
 #### [GLM 0.9.7.0](https://github.com/g-truc/glm/releases/tag/0.9.7.0) - 2015-08-02
 ##### Features:
 - Added GTC_color_space: convertLinearToSRGB and convertSRGBToLinear functions

+ 1 - 0
test/core/core_type_mat4x4.cpp

@@ -29,6 +29,7 @@
 /// @author Christophe Riccio
 ///////////////////////////////////////////////////////////////////////////////////
 
+#define GLM_SIMD
 #include <glm/gtc/epsilon.hpp>
 #include <glm/matrix.hpp>
 #include <glm/mat2x2.hpp>