summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2010-03-26 16:41:43 -0700
committerIan Romanick <ian.d.romanick@intel.com>2010-03-26 16:47:06 -0700
commit8343550b42d3a1de59fa15b86053d576382c11fd (patch)
treeb5e42d3c5315167ef371baba1049a21b9a8faf18 /tests
parent6c86ea8adc095abeef7b3cd63d3321185542bf36 (diff)
Add some simple constructor tests
Diffstat (limited to 'tests')
-rw-r--r--tests/constructor-03.glsl12
-rw-r--r--tests/constructor-04.glsl14
-rw-r--r--tests/constructor-05.glsl13
-rw-r--r--tests/constructor-06.glsl13
-rw-r--r--tests/constructor-07.glsl13
-rw-r--r--tests/constructor-08.glsl13
-rw-r--r--tests/constructor-09.glsl26
7 files changed, 104 insertions, 0 deletions
diff --git a/tests/constructor-03.glsl b/tests/constructor-03.glsl
new file mode 100644
index 0000000..07ec225
--- /dev/null
+++ b/tests/constructor-03.glsl
@@ -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
index 0000000..19d5e01
--- /dev/null
+++ b/tests/constructor-04.glsl
@@ -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
index 0000000..9c74f75
--- /dev/null
+++ b/tests/constructor-05.glsl
@@ -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
index 0000000..d77a5f9
--- /dev/null
+++ b/tests/constructor-06.glsl
@@ -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
index 0000000..9232250
--- /dev/null
+++ b/tests/constructor-07.glsl
@@ -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
index 0000000..27153f0
--- /dev/null
+++ b/tests/constructor-08.glsl
@@ -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
index 0000000..1985699
--- /dev/null
+++ b/tests/constructor-09.glsl
@@ -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;
+}