Add some simple constructor tests
authorIan Romanick <ian.d.romanick@intel.com>
Fri, 26 Mar 2010 23:41:43 +0000 (16:41 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Fri, 26 Mar 2010 23:47:06 +0000 (16:47 -0700)
tests/constructor-03.glsl [new file with mode: 0644]
tests/constructor-04.glsl [new file with mode: 0644]
tests/constructor-05.glsl [new file with mode: 0644]
tests/constructor-06.glsl [new file with mode: 0644]
tests/constructor-07.glsl [new file with mode: 0644]
tests/constructor-08.glsl [new file with mode: 0644]
tests/constructor-09.glsl [new file with mode: 0644]

diff --git a/tests/constructor-03.glsl b/tests/constructor-03.glsl
new file mode 100644 (file)
index 0000000..07ec225
--- /dev/null
@@ -0,0 +1,12 @@
+/* FAIL - cannot construct a matrix from a matrix in GLSL 1.10 */
+
+uniform mat2 a;
+
+void main()
+{
+  mat2 b;
+
+  b = mat2(a);
+
+  gl_Position = gl_Vertex;
+}
diff --git a/tests/constructor-04.glsl b/tests/constructor-04.glsl
new file mode 100644 (file)
index 0000000..19d5e01
--- /dev/null
@@ -0,0 +1,14 @@
+#version 120
+/* FAIL - matrix must be only parameter to matrix constructor */
+
+uniform mat2 a;
+uniform float x;
+
+void main()
+{
+  mat2 b;
+
+  b = mat2(a, x);
+
+  gl_Position = gl_Vertex;
+}
diff --git a/tests/constructor-05.glsl b/tests/constructor-05.glsl
new file mode 100644 (file)
index 0000000..9c74f75
--- /dev/null
@@ -0,0 +1,13 @@
+/* FAIL - too few components supplied to constructor */
+
+uniform vec2 a;
+uniform float x;
+
+void main()
+{
+  mat2 b;
+
+  b = mat2(a, x);
+
+  gl_Position = gl_Vertex;
+}
diff --git a/tests/constructor-06.glsl b/tests/constructor-06.glsl
new file mode 100644 (file)
index 0000000..d77a5f9
--- /dev/null
@@ -0,0 +1,13 @@
+#version 120
+/* PASS */
+
+uniform mat2 a;
+
+void main()
+{
+  mat2 b;
+
+  b = mat2(a);
+
+  gl_Position = gl_Vertex;
+}
diff --git a/tests/constructor-07.glsl b/tests/constructor-07.glsl
new file mode 100644 (file)
index 0000000..9232250
--- /dev/null
@@ -0,0 +1,13 @@
+/* PASS */
+
+uniform ivec2 a;
+uniform ivec2 b;
+
+void main()
+{
+  mat2 c;
+
+  c = mat2(a, b);
+
+  gl_Position = gl_Vertex;
+}
diff --git a/tests/constructor-08.glsl b/tests/constructor-08.glsl
new file mode 100644 (file)
index 0000000..27153f0
--- /dev/null
@@ -0,0 +1,13 @@
+/* PASS */
+
+uniform float a;
+uniform float b;
+
+void main()
+{
+  ivec2 c;
+
+  c = ivec2(a, b);
+
+  gl_Position = gl_Vertex;
+}
diff --git a/tests/constructor-09.glsl b/tests/constructor-09.glsl
new file mode 100644 (file)
index 0000000..1985699
--- /dev/null
@@ -0,0 +1,26 @@
+/* PASS */
+
+uniform int a;
+uniform float b;
+uniform bool c;
+
+void main()
+{
+  float x;
+  int y;
+  bool z;
+
+  x = float(a);
+  x = float(b);
+  x = float(c);
+
+  y = int(a);
+  y = int(b);
+  y = int(c);
+
+  z = bool(a);
+  z = bool(b);
+  z = bool(c);
+
+  gl_Position = gl_Vertex;
+}