[Piglit] [PATCH] glsl-1.20: Add a bunch of outerProduct execution tests for constant data

Ian Romanick idr at freedesktop.org
Sun May 1 16:58:27 PDT 2011


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

The previous batch tested non-constant parameters to outerProduct.
All of those shaders should execute the outerProduct code on the GPU.
This batch adds the same set of tests but using constant parameters to
outerProduct.  These are likely executed in the compiler on the CPU
during a constant folding pass.

Testing all of the possible paths seems to make sense.
---
 .../fs-outerProduct-const-mat2.shader_test         |   26 ++++
 .../fs-outerProduct-const-mat2x2.shader_test       |   26 ++++
 .../fs-outerProduct-const-mat2x3.shader_test       |   26 ++++
 .../fs-outerProduct-const-mat2x4.shader_test       |   26 ++++
 .../fs-outerProduct-const-mat3.shader_test         |   26 ++++
 .../fs-outerProduct-const-mat3x2.shader_test       |   26 ++++
 .../fs-outerProduct-const-mat3x3.shader_test       |   26 ++++
 .../fs-outerProduct-const-mat3x4.shader_test       |   26 ++++
 .../fs-outerProduct-const-mat4.shader_test         |   26 ++++
 .../fs-outerProduct-const-mat4x2.shader_test       |   26 ++++
 .../fs-outerProduct-const-mat4x3.shader_test       |   26 ++++
 .../fs-outerProduct-const-mat4x4.shader_test       |   26 ++++
 .../spec/glsl-1.20/execution/outerProduct-const.sh |  138 ++++++++++++++++++++
 .../vs-outerProduct-const-mat2.shader_test         |   29 ++++
 .../vs-outerProduct-const-mat2x2.shader_test       |   29 ++++
 .../vs-outerProduct-const-mat2x3.shader_test       |   29 ++++
 .../vs-outerProduct-const-mat2x4.shader_test       |   29 ++++
 .../vs-outerProduct-const-mat3.shader_test         |   29 ++++
 .../vs-outerProduct-const-mat3x2.shader_test       |   29 ++++
 .../vs-outerProduct-const-mat3x3.shader_test       |   29 ++++
 .../vs-outerProduct-const-mat3x4.shader_test       |   29 ++++
 .../vs-outerProduct-const-mat4.shader_test         |   29 ++++
 .../vs-outerProduct-const-mat4x2.shader_test       |   29 ++++
 .../vs-outerProduct-const-mat4x3.shader_test       |   29 ++++
 .../vs-outerProduct-const-mat4x4.shader_test       |   29 ++++
 25 files changed, 798 insertions(+), 0 deletions(-)
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2x2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2x3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2x4.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3x2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3x3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3x4.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4x2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4x3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4x4.shader_test
 create mode 100755 tests/spec/glsl-1.20/execution/outerProduct-const.sh
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2x2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2x3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2x4.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3x2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3x3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3x4.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4x2.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4x3.shader_test
 create mode 100644 tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4x4.shader_test

diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2.shader_test
new file mode 100644
index 0000000..a90ae92
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+
+const vec2 c = vec2(2, 3);
+const vec2 r = vec2(3, 4);
+uniform mat2 expected = mat2(6, 9, 8, 12);
+
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2x2.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2x2.shader_test
new file mode 100644
index 0000000..9bb226a
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2x2.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+
+const vec2 c = vec2(2, 3);
+const vec2 r = vec2(3, 4);
+uniform mat2x2 expected = mat2x2(6, 9, 8, 12);
+
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2x3.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2x3.shader_test
new file mode 100644
index 0000000..30e78a6
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2x3.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+
+const vec3 c = vec3(2, 3, 4);
+const vec2 r = vec2(4, 5);
+uniform mat2x3 expected = mat2x3(8, 12, 16, 10, 15, 20);
+
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2x4.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2x4.shader_test
new file mode 100644
index 0000000..ac9b398
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat2x4.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+
+const vec4 c = vec4(2, 3, 4, 5);
+const vec2 r = vec2(5, 6);
+uniform mat2x4 expected = mat2x4(10, 15, 20, 25, 12, 18, 24, 30);
+
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3.shader_test
new file mode 100644
index 0000000..9116a56
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+
+const vec3 c = vec3(2, 3, 4);
+const vec3 r = vec3(4, 5, 6);
+uniform mat3 expected = mat3(8, 12, 16, 10, 15, 20, 12, 18, 24);
+
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3x2.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3x2.shader_test
new file mode 100644
index 0000000..79b2810
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3x2.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+
+const vec2 c = vec2(2, 3);
+const vec3 r = vec3(3, 4, 5);
+uniform mat3x2 expected = mat3x2(6, 9, 8, 12, 10, 15);
+
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3x3.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3x3.shader_test
new file mode 100644
index 0000000..aca8dfe
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3x3.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+
+const vec3 c = vec3(2, 3, 4);
+const vec3 r = vec3(4, 5, 6);
+uniform mat3x3 expected = mat3x3(8, 12, 16, 10, 15, 20, 12, 18, 24);
+
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3x4.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3x4.shader_test
new file mode 100644
index 0000000..d73d082
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat3x4.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+
+const vec4 c = vec4(2, 3, 4, 5);
+const vec3 r = vec3(5, 6, 7);
+uniform mat3x4 expected = mat3x4(10, 15, 20, 25, 12, 18, 24, 30, 14, 21, 28, 35);
+
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4.shader_test
new file mode 100644
index 0000000..fae4011
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+
+const vec4 c = vec4(2, 3, 4, 5);
+const vec4 r = vec4(5, 6, 7, 8);
+uniform mat4 expected = mat4(10, 15, 20, 25, 12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40);
+
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4x2.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4x2.shader_test
new file mode 100644
index 0000000..e5bcfeb
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4x2.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+
+const vec2 c = vec2(2, 3);
+const vec4 r = vec4(3, 4, 5, 6);
+uniform mat4x2 expected = mat4x2(6, 9, 8, 12, 10, 15, 12, 18);
+
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4x3.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4x3.shader_test
new file mode 100644
index 0000000..d25c412
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4x3.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+
+const vec3 c = vec3(2, 3, 4);
+const vec4 r = vec4(4, 5, 6, 7);
+uniform mat4x3 expected = mat4x3(8, 12, 16, 10, 15, 20, 12, 18, 24, 14, 21, 28);
+
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4x4.shader_test b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4x4.shader_test
new file mode 100644
index 0000000..87035e3
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/fs-outerProduct-const-mat4x4.shader_test
@@ -0,0 +1,26 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; }
+
+[fragment shader]
+#version 120
+
+const vec4 c = vec4(2, 3, 4, 5);
+const vec4 r = vec4(5, 6, 7, 8);
+uniform mat4x4 expected = mat4x4(10, 15, 20, 25, 12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40);
+
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/outerProduct-const.sh b/tests/spec/glsl-1.20/execution/outerProduct-const.sh
new file mode 100755
index 0000000..d0474a4
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/outerProduct-const.sh
@@ -0,0 +1,138 @@
+#!/bin/sh
+
+function emit_outerProduct_const_data
+{
+    c=$1
+    r=$2
+    mtype=$3
+
+    cbase=$4
+    cvec=""
+    for i in $(seq $c); do
+	v=$(($i + $cbase))
+	if [ "x$cvec" == "x" ]; then
+	    cvec="${v}"
+	else
+	    cvec="${cvec}, ${v}"
+	fi
+    done
+
+    rbase=$(($3 + $c))
+    rvec=""
+    for i in $(seq $r); do
+	v=$(($i + $rbase))
+	if [ "x$rvec" == "x" ]; then
+	    rvec="${v}"
+	else
+	    rvec="${rvec}, ${v}"
+	fi
+    done
+
+    expected=""
+    for i in $(seq $r); do
+	for j in $(seq $c); do
+	    m=$((($i + $rbase) * ($j + $cbase)))
+	    if [ "x$expected" == "x" ]; then
+		expected="${m}"
+	    else
+		expected="${expected}, ${m}"
+	    fi
+	done
+    done
+
+    echo
+    echo "const vec${c} c = vec${c}(${cvec});"
+    echo "const vec${r} r = vec${r}(${rvec});"
+    echo "uniform ${mtype} expected = ${mtype}(${expected});"
+
+}
+
+function emit_vs_test
+{
+    c=$1
+    r=$2
+    mat=$3
+
+    name="vs-outerProduct-const-${mat}.shader_test"
+    cat > $name <<EOF
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+EOF
+
+    emit_outerProduct_const_data $c $r $mat 1 >> $name
+
+    cat >> $name <<EOF
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
+EOF
+}
+
+function emit_fs_test
+{
+    c=$1
+    r=$2
+    mat=$3
+
+    name="fs-outerProduct-const-${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
+EOF
+
+    emit_outerProduct_const_data $c $r $mat 1 >> $name
+
+    cat >> $name <<EOF
+
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
+EOF
+}
+
+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-const-mat2.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2.shader_test
new file mode 100644
index 0000000..0c22710
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const vec2 c = vec2(2, 3);
+const vec2 r = vec2(3, 4);
+uniform mat2 expected = mat2(6, 9, 8, 12);
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2x2.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2x2.shader_test
new file mode 100644
index 0000000..d8a4839
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2x2.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const vec2 c = vec2(2, 3);
+const vec2 r = vec2(3, 4);
+uniform mat2x2 expected = mat2x2(6, 9, 8, 12);
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2x3.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2x3.shader_test
new file mode 100644
index 0000000..42af36c
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2x3.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const vec3 c = vec3(2, 3, 4);
+const vec2 r = vec2(4, 5);
+uniform mat2x3 expected = mat2x3(8, 12, 16, 10, 15, 20);
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2x4.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2x4.shader_test
new file mode 100644
index 0000000..32a62ec
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat2x4.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const vec4 c = vec4(2, 3, 4, 5);
+const vec2 r = vec2(5, 6);
+uniform mat2x4 expected = mat2x4(10, 15, 20, 25, 12, 18, 24, 30);
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3.shader_test
new file mode 100644
index 0000000..d24b59f
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const vec3 c = vec3(2, 3, 4);
+const vec3 r = vec3(4, 5, 6);
+uniform mat3 expected = mat3(8, 12, 16, 10, 15, 20, 12, 18, 24);
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3x2.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3x2.shader_test
new file mode 100644
index 0000000..21d61c4
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3x2.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const vec2 c = vec2(2, 3);
+const vec3 r = vec3(3, 4, 5);
+uniform mat3x2 expected = mat3x2(6, 9, 8, 12, 10, 15);
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3x3.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3x3.shader_test
new file mode 100644
index 0000000..57a98b9
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3x3.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const vec3 c = vec3(2, 3, 4);
+const vec3 r = vec3(4, 5, 6);
+uniform mat3x3 expected = mat3x3(8, 12, 16, 10, 15, 20, 12, 18, 24);
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3x4.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3x4.shader_test
new file mode 100644
index 0000000..0426830
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat3x4.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const vec4 c = vec4(2, 3, 4, 5);
+const vec3 r = vec3(5, 6, 7);
+uniform mat3x4 expected = mat3x4(10, 15, 20, 25, 12, 18, 24, 30, 14, 21, 28, 35);
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4.shader_test
new file mode 100644
index 0000000..6159b0e
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const vec4 c = vec4(2, 3, 4, 5);
+const vec4 r = vec4(5, 6, 7, 8);
+uniform mat4 expected = mat4(10, 15, 20, 25, 12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40);
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4x2.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4x2.shader_test
new file mode 100644
index 0000000..38685b7
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4x2.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const vec2 c = vec2(2, 3);
+const vec4 r = vec4(3, 4, 5, 6);
+uniform mat4x2 expected = mat4x2(6, 9, 8, 12, 10, 15, 12, 18);
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4x3.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4x3.shader_test
new file mode 100644
index 0000000..9fec52e
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4x3.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const vec3 c = vec3(2, 3, 4);
+const vec4 r = vec4(4, 5, 6, 7);
+uniform mat4x3 expected = mat4x3(8, 12, 16, 10, 15, 20, 12, 18, 24, 14, 21, 28);
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
diff --git a/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4x4.shader_test b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4x4.shader_test
new file mode 100644
index 0000000..2bbdde7
--- /dev/null
+++ b/tests/spec/glsl-1.20/execution/vs-outerProduct-const-mat4x4.shader_test
@@ -0,0 +1,29 @@
+[require]
+GLSL >= 1.20
+
+[vertex shader]
+#version 120
+
+const vec4 c = vec4(2, 3, 4, 5);
+const vec4 r = vec4(5, 6, 7, 8);
+uniform mat4x4 expected = mat4x4(10, 15, 20, 25, 12, 18, 24, 30, 14, 21, 28, 35, 16, 24, 32, 40);
+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
+
+draw rect 10 10 10 10"
+probe rgb 15 15 0.0 1.0 0.0"
-- 
1.7.4



More information about the Piglit mailing list