Add some matrix math tests
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 25 Mar 2010 00:42:59 +0000 (17:42 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Thu, 25 Mar 2010 00:42:59 +0000 (17:42 -0700)
tests/matrix-01.glsl [new file with mode: 0644]
tests/matrix-02.glsl [new file with mode: 0644]
tests/matrix-03.glsl [new file with mode: 0644]
tests/matrix-04.glsl [new file with mode: 0644]
tests/matrix-05.glsl [new file with mode: 0644]
tests/matrix-06.glsl [new file with mode: 0644]
tests/matrix-07.glsl [new file with mode: 0644]
tests/matrix-08.glsl [new file with mode: 0644]

diff --git a/tests/matrix-01.glsl b/tests/matrix-01.glsl
new file mode 100644 (file)
index 0000000..f46416c
--- /dev/null
@@ -0,0 +1,6 @@
+/* FAIL - non-square matrices are not available in GLSL 1.10 */
+
+void main()
+{
+    mat2x3 m;
+}
diff --git a/tests/matrix-02.glsl b/tests/matrix-02.glsl
new file mode 100644 (file)
index 0000000..0630722
--- /dev/null
@@ -0,0 +1,6 @@
+/* FAIL - non-square matrices are not available in GLSL 1.10 */
+
+void main()
+{
+    mat2x4 m;
+}
diff --git a/tests/matrix-03.glsl b/tests/matrix-03.glsl
new file mode 100644 (file)
index 0000000..925dc80
--- /dev/null
@@ -0,0 +1,6 @@
+/* FAIL - non-square matrices are not available in GLSL 1.10 */
+
+void main()
+{
+    mat3x2 m;
+}
diff --git a/tests/matrix-04.glsl b/tests/matrix-04.glsl
new file mode 100644 (file)
index 0000000..5275619
--- /dev/null
@@ -0,0 +1,6 @@
+/* FAIL - non-square matrices are not available in GLSL 1.10 */
+
+void main()
+{
+    mat3x4 m;
+}
diff --git a/tests/matrix-05.glsl b/tests/matrix-05.glsl
new file mode 100644 (file)
index 0000000..74e1fd2
--- /dev/null
@@ -0,0 +1,6 @@
+/* FAIL - non-square matrices are not available in GLSL 1.10 */
+
+void main()
+{
+    mat4x2 m;
+}
diff --git a/tests/matrix-06.glsl b/tests/matrix-06.glsl
new file mode 100644 (file)
index 0000000..0a512b8
--- /dev/null
@@ -0,0 +1,6 @@
+/* FAIL - non-square matrices are not available in GLSL 1.10 */
+
+void main()
+{
+    mat4x3 m;
+}
diff --git a/tests/matrix-07.glsl b/tests/matrix-07.glsl
new file mode 100644 (file)
index 0000000..0b59aa6
--- /dev/null
@@ -0,0 +1,27 @@
+/* PASS */
+
+uniform mat2 a;
+uniform mat2 b;
+uniform mat2 c;
+uniform mat2 d;
+uniform mat3 e;
+uniform mat3 f;
+uniform mat3 g;
+uniform mat3 h;
+uniform mat4 i;
+uniform mat4 j;
+uniform mat4 k;
+uniform mat4 l;
+
+void main()
+{
+    mat2 x;
+    mat3 y;
+    mat4 z;
+
+    x = a * b + c / d;
+    y = e * f + g / h;
+    z = i * j + k / l;
+
+    gl_Position = gl_Vertex;
+}
diff --git a/tests/matrix-08.glsl b/tests/matrix-08.glsl
new file mode 100644 (file)
index 0000000..38138d2
--- /dev/null
@@ -0,0 +1,19 @@
+#version 120
+/* PASS */
+
+uniform mat2x3 a;
+uniform mat3x2 b;
+uniform mat3x3 c;
+uniform mat3x3 d;
+
+void main()
+{
+    mat3x3 x;
+
+    /* Multiplying a 2 column, 3 row matrix with a 3 column, 2 row matrix
+     * results in a 3 column, 3 row matrix.
+     */
+    x = (a * b) + c / d;
+
+    gl_Position = gl_Vertex;
+}