[Piglit] [PATCH 3/3] glsl-1.20: Add a bunch of outerProduct execution tests

Ian Romanick idr at freedesktop.org
Thu Apr 28 14:55:45 PDT 2011


From: Ian Romanick <ian.d.romanick at intel.com>

---
 .../execution/fs-outerProduct-mat2.shader_test     |   45 +++++++
 .../execution/fs-outerProduct-mat2x2.shader_test   |   45 +++++++
 .../execution/fs-outerProduct-mat2x3.shader_test   |   45 +++++++
 .../execution/fs-outerProduct-mat2x4.shader_test   |   45 +++++++
 .../execution/fs-outerProduct-mat3.shader_test     |   45 +++++++
 .../execution/fs-outerProduct-mat3x2.shader_test   |   45 +++++++
 .../execution/fs-outerProduct-mat3x3.shader_test   |   45 +++++++
 .../execution/fs-outerProduct-mat3x4.shader_test   |   45 +++++++
 .../execution/fs-outerProduct-mat4.shader_test     |   45 +++++++
 .../execution/fs-outerProduct-mat4x2.shader_test   |   45 +++++++
 .../execution/fs-outerProduct-mat4x3.shader_test   |   45 +++++++
 .../execution/fs-outerProduct-mat4x4.shader_test   |   45 +++++++
 tests/spec/glsl-1.20/execution/outerProduct.sh     |  126 ++++++++++++++++++++
 .../execution/vs-outerProduct-mat2.shader_test     |   48 ++++++++
 .../execution/vs-outerProduct-mat2x2.shader_test   |   48 ++++++++
 .../execution/vs-outerProduct-mat2x3.shader_test   |   48 ++++++++
 .../execution/vs-outerProduct-mat2x4.shader_test   |   48 ++++++++
 .../execution/vs-outerProduct-mat3.shader_test     |   48 ++++++++
 .../execution/vs-outerProduct-mat3x2.shader_test   |   48 ++++++++
 .../execution/vs-outerProduct-mat3x3.shader_test   |   48 ++++++++
 .../execution/vs-outerProduct-mat3x4.shader_test   |   48 ++++++++
 .../execution/vs-outerProduct-mat4.shader_test     |   48 ++++++++
 .../execution/vs-outerProduct-mat4x2.shader_test   |   48 ++++++++
 .../execution/vs-outerProduct-mat4x3.shader_test   |   48 ++++++++
 .../execution/vs-outerProduct-mat4x4.shader_test   |   48 ++++++++
 25 files changed, 1242 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-mat2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-mat2x2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-mat2x3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-mat2x4.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-mat3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-mat3x2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-mat3x3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-mat3x4.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-mat4.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-mat4x2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-mat4x3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-mat4x4.shader_test
 create mode 100755 tests/spec/glsl-1.20/execution/outerProduct.sh
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-mat2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-mat2x2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-mat2x3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-mat2x4.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-mat3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-mat3x2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-mat3x3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-mat3x4.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-mat4.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-mat4x2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-mat4x3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-mat4x4.shader_test

diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-mat2.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat2.shader_test
new file mode 100644
index 0000000..2002143
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat2.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+uniform vec2 c, r;
+uniform mat2 expected;
+
+void main() {
+  mat2 result = outerProduct(c, r);
+  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec2 c  2 3
+uniform vec2 r  4 5
+uniform mat2x2 expected  8 12 10 15
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec2 c  3 4
+uniform vec2 r  5 6
+uniform mat2x2 expected  15 20 18 24
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec2 c  4 5
+uniform vec2 r  6 7
+uniform mat2x2 expected  24 30 28 35
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec2 c  5 6
+uniform vec2 r  7 8
+uniform mat2x2 expected  35 42 40 48
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-mat2x2.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat2x2.shader_test
new file mode 100644
index 0000000..57b66cb
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat2x2.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+uniform vec2 c, r;
+uniform mat2x2 expected;
+
+void main() {
+  mat2x2 result = outerProduct(c, r);
+  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec2 c  2 3
+uniform vec2 r  4 5
+uniform mat2x2 expected  8 12 10 15
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec2 c  3 4
+uniform vec2 r  5 6
+uniform mat2x2 expected  15 20 18 24
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec2 c  4 5
+uniform vec2 r  6 7
+uniform mat2x2 expected  24 30 28 35
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec2 c  5 6
+uniform vec2 r  7 8
+uniform mat2x2 expected  35 42 40 48
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-mat2x3.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat2x3.shader_test
new file mode 100644
index 0000000..7e3b770
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat2x3.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+uniform vec3 c, r;
+uniform mat2x3 expected;
+
+void main() {
+  mat2x3 result = outerProduct(c, r);
+  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec3 c  2 3 4
+uniform vec2 r  5 6
+uniform mat2x3 expected  10 15 20 12 18 24
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec3 c  3 4 5
+uniform vec2 r  6 7
+uniform mat2x3 expected  18 24 30 21 28 35
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec3 c  4 5 6
+uniform vec2 r  7 8
+uniform mat2x3 expected  28 35 42 32 40 48
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec3 c  5 6 7
+uniform vec2 r  8 9
+uniform mat2x3 expected  40 48 56 45 54 63
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-mat2x4.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat2x4.shader_test
new file mode 100644
index 0000000..7cbf7c2
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat2x4.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+uniform vec4 c, r;
+uniform mat2x4 expected;
+
+void main() {
+  mat2x4 result = outerProduct(c, r);
+  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec4 c  2 3 4 5
+uniform vec2 r  6 7
+uniform mat2x4 expected  12 18 24 30 14 21 28 35
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec4 c  3 4 5 6
+uniform vec2 r  7 8
+uniform mat2x4 expected  21 28 35 42 24 32 40 48
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec4 c  4 5 6 7
+uniform vec2 r  8 9
+uniform mat2x4 expected  32 40 48 56 36 45 54 63
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec4 c  5 6 7 8
+uniform vec2 r  9 10
+uniform mat2x4 expected  45 54 63 72 50 60 70 80
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-mat3.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat3.shader_test
new file mode 100644
index 0000000..5121c55
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat3.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+uniform vec3 c, r;
+uniform mat3 expected;
+
+void main() {
+  mat3 result = outerProduct(c, r);
+  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec3 c  2 3 4
+uniform vec3 r  5 6 7
+uniform mat3x3 expected  10 15 20 12 18 24 14 21 28
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec3 c  3 4 5
+uniform vec3 r  6 7 8
+uniform mat3x3 expected  18 24 30 21 28 35 24 32 40
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec3 c  4 5 6
+uniform vec3 r  7 8 9
+uniform mat3x3 expected  28 35 42 32 40 48 36 45 54
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec3 c  5 6 7
+uniform vec3 r  8 9 10
+uniform mat3x3 expected  40 48 56 45 54 63 50 60 70
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-mat3x2.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat3x2.shader_test
new file mode 100644
index 0000000..dde6d9d
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat3x2.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+uniform vec2 c, r;
+uniform mat3x2 expected;
+
+void main() {
+  mat3x2 result = outerProduct(c, r);
+  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec2 c  2 3
+uniform vec3 r  4 5 6
+uniform mat3x2 expected  8 12 10 15 12 18
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec2 c  3 4
+uniform vec3 r  5 6 7
+uniform mat3x2 expected  15 20 18 24 21 28
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec2 c  4 5
+uniform vec3 r  6 7 8
+uniform mat3x2 expected  24 30 28 35 32 40
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec2 c  5 6
+uniform vec3 r  7 8 9
+uniform mat3x2 expected  35 42 40 48 45 54
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-mat3x3.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat3x3.shader_test
new file mode 100644
index 0000000..99dcb99
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat3x3.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+uniform vec3 c, r;
+uniform mat3x3 expected;
+
+void main() {
+  mat3x3 result = outerProduct(c, r);
+  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec3 c  2 3 4
+uniform vec3 r  5 6 7
+uniform mat3x3 expected  10 15 20 12 18 24 14 21 28
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec3 c  3 4 5
+uniform vec3 r  6 7 8
+uniform mat3x3 expected  18 24 30 21 28 35 24 32 40
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec3 c  4 5 6
+uniform vec3 r  7 8 9
+uniform mat3x3 expected  28 35 42 32 40 48 36 45 54
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec3 c  5 6 7
+uniform vec3 r  8 9 10
+uniform mat3x3 expected  40 48 56 45 54 63 50 60 70
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-mat3x4.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat3x4.shader_test
new file mode 100644
index 0000000..66c1457
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat3x4.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+uniform vec4 c, r;
+uniform mat3x4 expected;
+
+void main() {
+  mat3x4 result = outerProduct(c, r);
+  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec4 c  2 3 4 5
+uniform vec3 r  6 7 8
+uniform mat3x4 expected  12 18 24 30 14 21 28 35 16 24 32 40
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec4 c  3 4 5 6
+uniform vec3 r  7 8 9
+uniform mat3x4 expected  21 28 35 42 24 32 40 48 27 36 45 54
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec4 c  4 5 6 7
+uniform vec3 r  8 9 10
+uniform mat3x4 expected  32 40 48 56 36 45 54 63 40 50 60 70
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec4 c  5 6 7 8
+uniform vec3 r  9 10 11
+uniform mat3x4 expected  45 54 63 72 50 60 70 80 55 66 77 88
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-mat4.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat4.shader_test
new file mode 100644
index 0000000..ac19ec8
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat4.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+uniform vec4 c, r;
+uniform mat4 expected;
+
+void main() {
+  mat4 result = outerProduct(c, r);
+  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec4 c  2 3 4 5
+uniform vec4 r  6 7 8 9
+uniform mat4x4 expected  12 18 24 30 14 21 28 35 16 24 32 40 18 27 36 45
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec4 c  3 4 5 6
+uniform vec4 r  7 8 9 10
+uniform mat4x4 expected  21 28 35 42 24 32 40 48 27 36 45 54 30 40 50 60
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec4 c  4 5 6 7
+uniform vec4 r  8 9 10 11
+uniform mat4x4 expected  32 40 48 56 36 45 54 63 40 50 60 70 44 55 66 77
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec4 c  5 6 7 8
+uniform vec4 r  9 10 11 12
+uniform mat4x4 expected  45 54 63 72 50 60 70 80 55 66 77 88 60 72 84 96
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-mat4x2.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat4x2.shader_test
new file mode 100644
index 0000000..06ec528
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat4x2.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+uniform vec2 c, r;
+uniform mat4x2 expected;
+
+void main() {
+  mat4x2 result = outerProduct(c, r);
+  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec2 c  2 3
+uniform vec4 r  4 5 6 7
+uniform mat4x2 expected  8 12 10 15 12 18 14 21
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec2 c  3 4
+uniform vec4 r  5 6 7 8
+uniform mat4x2 expected  15 20 18 24 21 28 24 32
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec2 c  4 5
+uniform vec4 r  6 7 8 9
+uniform mat4x2 expected  24 30 28 35 32 40 36 45
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec2 c  5 6
+uniform vec4 r  7 8 9 10
+uniform mat4x2 expected  35 42 40 48 45 54 50 60
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-mat4x3.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat4x3.shader_test
new file mode 100644
index 0000000..7de1e9d
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat4x3.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+uniform vec3 c, r;
+uniform mat4x3 expected;
+
+void main() {
+  mat4x3 result = outerProduct(c, r);
+  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec3 c  2 3 4
+uniform vec4 r  5 6 7 8
+uniform mat4x3 expected  10 15 20 12 18 24 14 21 28 16 24 32
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec3 c  3 4 5
+uniform vec4 r  6 7 8 9
+uniform mat4x3 expected  18 24 30 21 28 35 24 32 40 27 36 45
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec3 c  4 5 6
+uniform vec4 r  7 8 9 10
+uniform mat4x3 expected  28 35 42 32 40 48 36 45 54 40 50 60
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec3 c  5 6 7
+uniform vec4 r  8 9 10 11
+uniform mat4x3 expected  40 48 56 45 54 63 50 60 70 55 66 77
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-mat4x4.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat4x4.shader_test
new file mode 100644
index 0000000..c8dd6c5
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-mat4x4.shader_test
@@ -0,0 +1,45 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+uniform vec4 c, r;
+uniform mat4x4 expected;
+
+void main() {
+  mat4x4 result = outerProduct(c, r);
+  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec4 c  2 3 4 5
+uniform vec4 r  6 7 8 9
+uniform mat4x4 expected  12 18 24 30 14 21 28 35 16 24 32 40 18 27 36 45
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec4 c  3 4 5 6
+uniform vec4 r  7 8 9 10
+uniform mat4x4 expected  21 28 35 42 24 32 40 48 27 36 45 54 30 40 50 60
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec4 c  4 5 6 7
+uniform vec4 r  8 9 10 11
+uniform mat4x4 expected  32 40 48 56 36 45 54 63 40 50 60 70 44 55 66 77
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec4 c  5 6 7 8
+uniform vec4 r  9 10 11 12
+uniform mat4x4 expected  45 54 63 72 50 60 70 80 55 66 77 88 60 72 84 96
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/outerProduct.sh b/tests/spec/glsl-1.20/execution/outerProduct.sh
new file mode 100755
index 0000000..aa12965
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/outerProduct.sh
@@ -0,0 +1,126 @@
+#!/bin/sh
+
+function emit_outerProduct_data
+{
+    c=$1
+    r=$2
+
+    cbase=$3
+    cvec=""
+    for i in $(seq $c); do
+	v=$(($i + $cbase))
+	cvec="${cvec} ${v}"
+    done
+
+    rbase=$(($3 + $c))
+    rvec=""
+    for i in $(seq $r); do
+	v=$(($i + $rbase))
+	rvec="${rvec} ${v}"
+    done
+
+    mat=""
+    for i in $(seq $r); do
+	for j in $(seq $c); do
+	    m=$((($i + $rbase) * ($j + $cbase)))
+	    mat="${mat} ${m}"
+	done
+    done
+
+    echo
+    echo "uniform vec${c} c ${cvec}"
+    echo "uniform vec${r} r ${rvec}"
+    echo "uniform mat${r}x${c} expected ${mat}"
+
+    x=$((20 * $3 - 10))
+    echo "draw rect $x 10 10 10"
+    echo "probe rgb $(($x + 5)) 15 0.0 1.0 0.0"
+}
+
+function emit_vs_test
+{
+    c=$1
+    r=$2
+    mat=$3
+
+    name="vs-outerProduct-${mat}.shader_test"
+    cat > $name <<EOF
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+uniform vec${c} c, r;
+uniform ${mat} expected;
+varying vec4 color;
+
+void main() {
+  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+  ${mat} result = outerProduct(c, r);
+  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[fragment shader]
+#version 120
+varying vec4 color;
+void main() { gl_FragColor = color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+EOF
+
+    emit_outerProduct_data $c $r 1 >> $name
+    emit_outerProduct_data $c $r 2 >> $name
+    emit_outerProduct_data $c $r 3 >> $name
+    emit_outerProduct_data $c $r 4 >> $name
+}
+
+function emit_fs_test
+{
+    c=$1
+    r=$2
+    mat=$3
+
+    name="fs-outerProduct-${mat}.shader_test"
+    cat > $name <<EOF
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+uniform vec${c} c, r;
+uniform ${mat} expected;
+
+void main() {
+  ${mat} result = outerProduct(c, r);
+  gl_FragColor = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+EOF
+
+    emit_outerProduct_data $c $r 1 >> $name
+    emit_outerProduct_data $c $r 2 >> $name
+    emit_outerProduct_data $c $r 3 >> $name
+    emit_outerProduct_data $c $r 4 >> $name
+}
+
+for c in 2 3 4; do
+    for r in 2 3 4; do
+	emit_vs_test $c $r "mat${r}x${c}"
+	emit_fs_test $c $r "mat${r}x${c}"
+	if [ $c -eq $r ]; then
+	    emit_vs_test $c $r "mat${r}"
+	    emit_fs_test $c $r "mat${r}"
+	fi
+    done
+done
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-mat2.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat2.shader_test
new file mode 100644
index 0000000..41a0a26
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat2.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+uniform vec2 c, r;
+uniform mat2 expected;
+varying vec4 color;
+
+void main() {
+  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+  mat2 result = outerProduct(c, r);
+  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[fragment shader]
+#version 120
+varying vec4 color;
+void main() { gl_FragColor = color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec2 c  2 3
+uniform vec2 r  4 5
+uniform mat2x2 expected  8 12 10 15
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec2 c  3 4
+uniform vec2 r  5 6
+uniform mat2x2 expected  15 20 18 24
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec2 c  4 5
+uniform vec2 r  6 7
+uniform mat2x2 expected  24 30 28 35
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec2 c  5 6
+uniform vec2 r  7 8
+uniform mat2x2 expected  35 42 40 48
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-mat2x2.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat2x2.shader_test
new file mode 100644
index 0000000..238e3a1
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat2x2.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+uniform vec2 c, r;
+uniform mat2x2 expected;
+varying vec4 color;
+
+void main() {
+  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+  mat2x2 result = outerProduct(c, r);
+  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[fragment shader]
+#version 120
+varying vec4 color;
+void main() { gl_FragColor = color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec2 c  2 3
+uniform vec2 r  4 5
+uniform mat2x2 expected  8 12 10 15
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec2 c  3 4
+uniform vec2 r  5 6
+uniform mat2x2 expected  15 20 18 24
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec2 c  4 5
+uniform vec2 r  6 7
+uniform mat2x2 expected  24 30 28 35
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec2 c  5 6
+uniform vec2 r  7 8
+uniform mat2x2 expected  35 42 40 48
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-mat2x3.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat2x3.shader_test
new file mode 100644
index 0000000..c8b4ff5
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat2x3.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+uniform vec3 c, r;
+uniform mat2x3 expected;
+varying vec4 color;
+
+void main() {
+  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+  mat2x3 result = outerProduct(c, r);
+  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[fragment shader]
+#version 120
+varying vec4 color;
+void main() { gl_FragColor = color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec3 c  2 3 4
+uniform vec2 r  5 6
+uniform mat2x3 expected  10 15 20 12 18 24
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec3 c  3 4 5
+uniform vec2 r  6 7
+uniform mat2x3 expected  18 24 30 21 28 35
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec3 c  4 5 6
+uniform vec2 r  7 8
+uniform mat2x3 expected  28 35 42 32 40 48
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec3 c  5 6 7
+uniform vec2 r  8 9
+uniform mat2x3 expected  40 48 56 45 54 63
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-mat2x4.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat2x4.shader_test
new file mode 100644
index 0000000..848e15e
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat2x4.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+uniform vec4 c, r;
+uniform mat2x4 expected;
+varying vec4 color;
+
+void main() {
+  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+  mat2x4 result = outerProduct(c, r);
+  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[fragment shader]
+#version 120
+varying vec4 color;
+void main() { gl_FragColor = color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec4 c  2 3 4 5
+uniform vec2 r  6 7
+uniform mat2x4 expected  12 18 24 30 14 21 28 35
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec4 c  3 4 5 6
+uniform vec2 r  7 8
+uniform mat2x4 expected  21 28 35 42 24 32 40 48
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec4 c  4 5 6 7
+uniform vec2 r  8 9
+uniform mat2x4 expected  32 40 48 56 36 45 54 63
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec4 c  5 6 7 8
+uniform vec2 r  9 10
+uniform mat2x4 expected  45 54 63 72 50 60 70 80
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-mat3.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat3.shader_test
new file mode 100644
index 0000000..a64c3a0
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat3.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+uniform vec3 c, r;
+uniform mat3 expected;
+varying vec4 color;
+
+void main() {
+  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+  mat3 result = outerProduct(c, r);
+  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[fragment shader]
+#version 120
+varying vec4 color;
+void main() { gl_FragColor = color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec3 c  2 3 4
+uniform vec3 r  5 6 7
+uniform mat3x3 expected  10 15 20 12 18 24 14 21 28
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec3 c  3 4 5
+uniform vec3 r  6 7 8
+uniform mat3x3 expected  18 24 30 21 28 35 24 32 40
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec3 c  4 5 6
+uniform vec3 r  7 8 9
+uniform mat3x3 expected  28 35 42 32 40 48 36 45 54
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec3 c  5 6 7
+uniform vec3 r  8 9 10
+uniform mat3x3 expected  40 48 56 45 54 63 50 60 70
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-mat3x2.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat3x2.shader_test
new file mode 100644
index 0000000..ea67742
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat3x2.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+uniform vec2 c, r;
+uniform mat3x2 expected;
+varying vec4 color;
+
+void main() {
+  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+  mat3x2 result = outerProduct(c, r);
+  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[fragment shader]
+#version 120
+varying vec4 color;
+void main() { gl_FragColor = color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec2 c  2 3
+uniform vec3 r  4 5 6
+uniform mat3x2 expected  8 12 10 15 12 18
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec2 c  3 4
+uniform vec3 r  5 6 7
+uniform mat3x2 expected  15 20 18 24 21 28
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec2 c  4 5
+uniform vec3 r  6 7 8
+uniform mat3x2 expected  24 30 28 35 32 40
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec2 c  5 6
+uniform vec3 r  7 8 9
+uniform mat3x2 expected  35 42 40 48 45 54
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-mat3x3.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat3x3.shader_test
new file mode 100644
index 0000000..15c3bd1
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat3x3.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+uniform vec3 c, r;
+uniform mat3x3 expected;
+varying vec4 color;
+
+void main() {
+  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+  mat3x3 result = outerProduct(c, r);
+  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[fragment shader]
+#version 120
+varying vec4 color;
+void main() { gl_FragColor = color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec3 c  2 3 4
+uniform vec3 r  5 6 7
+uniform mat3x3 expected  10 15 20 12 18 24 14 21 28
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec3 c  3 4 5
+uniform vec3 r  6 7 8
+uniform mat3x3 expected  18 24 30 21 28 35 24 32 40
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec3 c  4 5 6
+uniform vec3 r  7 8 9
+uniform mat3x3 expected  28 35 42 32 40 48 36 45 54
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec3 c  5 6 7
+uniform vec3 r  8 9 10
+uniform mat3x3 expected  40 48 56 45 54 63 50 60 70
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-mat3x4.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat3x4.shader_test
new file mode 100644
index 0000000..b86c2de
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat3x4.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+uniform vec4 c, r;
+uniform mat3x4 expected;
+varying vec4 color;
+
+void main() {
+  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+  mat3x4 result = outerProduct(c, r);
+  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[fragment shader]
+#version 120
+varying vec4 color;
+void main() { gl_FragColor = color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec4 c  2 3 4 5
+uniform vec3 r  6 7 8
+uniform mat3x4 expected  12 18 24 30 14 21 28 35 16 24 32 40
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec4 c  3 4 5 6
+uniform vec3 r  7 8 9
+uniform mat3x4 expected  21 28 35 42 24 32 40 48 27 36 45 54
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec4 c  4 5 6 7
+uniform vec3 r  8 9 10
+uniform mat3x4 expected  32 40 48 56 36 45 54 63 40 50 60 70
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec4 c  5 6 7 8
+uniform vec3 r  9 10 11
+uniform mat3x4 expected  45 54 63 72 50 60 70 80 55 66 77 88
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-mat4.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat4.shader_test
new file mode 100644
index 0000000..92957c1
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat4.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+uniform vec4 c, r;
+uniform mat4 expected;
+varying vec4 color;
+
+void main() {
+  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+  mat4 result = outerProduct(c, r);
+  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[fragment shader]
+#version 120
+varying vec4 color;
+void main() { gl_FragColor = color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec4 c  2 3 4 5
+uniform vec4 r  6 7 8 9
+uniform mat4x4 expected  12 18 24 30 14 21 28 35 16 24 32 40 18 27 36 45
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec4 c  3 4 5 6
+uniform vec4 r  7 8 9 10
+uniform mat4x4 expected  21 28 35 42 24 32 40 48 27 36 45 54 30 40 50 60
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec4 c  4 5 6 7
+uniform vec4 r  8 9 10 11
+uniform mat4x4 expected  32 40 48 56 36 45 54 63 40 50 60 70 44 55 66 77
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec4 c  5 6 7 8
+uniform vec4 r  9 10 11 12
+uniform mat4x4 expected  45 54 63 72 50 60 70 80 55 66 77 88 60 72 84 96
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-mat4x2.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat4x2.shader_test
new file mode 100644
index 0000000..d452292
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat4x2.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+uniform vec2 c, r;
+uniform mat4x2 expected;
+varying vec4 color;
+
+void main() {
+  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+  mat4x2 result = outerProduct(c, r);
+  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[fragment shader]
+#version 120
+varying vec4 color;
+void main() { gl_FragColor = color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec2 c  2 3
+uniform vec4 r  4 5 6 7
+uniform mat4x2 expected  8 12 10 15 12 18 14 21
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec2 c  3 4
+uniform vec4 r  5 6 7 8
+uniform mat4x2 expected  15 20 18 24 21 28 24 32
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec2 c  4 5
+uniform vec4 r  6 7 8 9
+uniform mat4x2 expected  24 30 28 35 32 40 36 45
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec2 c  5 6
+uniform vec4 r  7 8 9 10
+uniform mat4x2 expected  35 42 40 48 45 54 50 60
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-mat4x3.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat4x3.shader_test
new file mode 100644
index 0000000..f3333a7
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat4x3.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+uniform vec3 c, r;
+uniform mat4x3 expected;
+varying vec4 color;
+
+void main() {
+  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+  mat4x3 result = outerProduct(c, r);
+  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[fragment shader]
+#version 120
+varying vec4 color;
+void main() { gl_FragColor = color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec3 c  2 3 4
+uniform vec4 r  5 6 7 8
+uniform mat4x3 expected  10 15 20 12 18 24 14 21 28 16 24 32
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec3 c  3 4 5
+uniform vec4 r  6 7 8 9
+uniform mat4x3 expected  18 24 30 21 28 35 24 32 40 27 36 45
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec3 c  4 5 6
+uniform vec4 r  7 8 9 10
+uniform mat4x3 expected  28 35 42 32 40 48 36 45 54 40 50 60
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec3 c  5 6 7
+uniform vec4 r  8 9 10 11
+uniform mat4x3 expected  40 48 56 45 54 63 50 60 70 55 66 77
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-mat4x4.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat4x4.shader_test
new file mode 100644
index 0000000..a428c07
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-mat4x4.shader_test
@@ -0,0 +1,48 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+uniform vec4 c, r;
+uniform mat4x4 expected;
+varying vec4 color;
+
+void main() {
+  gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
+  mat4x4 result = outerProduct(c, r);
+  color = (result == expected) ? vec4(0, 1, 0, 1) : vec4(1, 0, 0, 1);
+}
+
+[fragment shader]
+#version 120
+varying vec4 color;
+void main() { gl_FragColor = color; }
+
+[test]
+clear color 0.5 0.5 0.5 0.0
+clear
+ortho
+
+uniform vec4 c  2 3 4 5
+uniform vec4 r  6 7 8 9
+uniform mat4x4 expected  12 18 24 30 14 21 28 35 16 24 32 40 18 27 36 45
+draw rect 10 10 10 10
+probe rgb 15 15 0.0 1.0 0.0
+
+uniform vec4 c  3 4 5 6
+uniform vec4 r  7 8 9 10
+uniform mat4x4 expected  21 28 35 42 24 32 40 48 27 36 45 54 30 40 50 60
+draw rect 30 10 10 10
+probe rgb 35 15 0.0 1.0 0.0
+
+uniform vec4 c  4 5 6 7
+uniform vec4 r  8 9 10 11
+uniform mat4x4 expected  32 40 48 56 36 45 54 63 40 50 60 70 44 55 66 77
+draw rect 50 10 10 10
+probe rgb 55 15 0.0 1.0 0.0
+
+uniform vec4 c  5 6 7 8
+uniform vec4 r  9 10 11 12
+uniform mat4x4 expected  45 54 63 72 50 60 70 80 55 66 77 88 60 72 84 96
+draw rect 70 10 10 10
+probe rgb 75 15 0.0 1.0 0.0
-- 
1.7.4



More information about the Piglit mailing list