Browse Source

Added repro test for Conversion error with an aligned matrix #777

Groove 7 years ago
parent
commit
97e189606f
1 changed files with 21 additions and 0 deletions
  1. 21 0
      test/gtc/gtc_type_aligned.cpp

+ 21 - 0
test/gtc/gtc_type_aligned.cpp

@@ -3,6 +3,7 @@
 
 #if GLM_USE_ALIGNED_GENTYPES == GLM_ENABLE
 #include <glm/gtc/type_aligned.hpp>
+#include <glm/ext/vector_relational.hpp>
 
 GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_lowp>::value, "aligned_lowp is not aligned");
 GLM_STATIC_ASSERT(glm::detail::is_aligned<glm::aligned_mediump>::value, "aligned_mediump is not aligned");
@@ -126,12 +127,32 @@ static int test_ctor()
 	return Error;
 }
 
+/*
+using namespace glm;
+
+typedef mat<4, 4, float, aligned> aligned_mat4;
+
+static int test_aligned_mat4()
+{
+	int Error = 0;
+
+	aligned_mat4 m(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15);
+	aligned_mat4 t = transpose(m);
+	aligned_mat4 const expected = mat4(0, 4, 8, 12, 1, 5, 9, 13, 2, 6, 10, 14, 3, 7, 11, 15);
+	for (length_t l = 0; l < expected.length(); ++l)
+		Error += all(equal(t[l], expected[l], 0.0001f)) ? 0 : 1;
+
+	return Error;
+}
+*/
+
 int main()
 {
 	int Error = 0;
 
 	Error += test_ctor();
 	Error += test_copy();
+//	Error += test_aligned_mat4();
 
 	return Error;
 }