summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicholas Mack <nichmack@gmail.com>2013-09-10 15:15:13 -0700
committerNicholas Mack <nichmack@gmail.com>2013-10-07 14:35:50 -0700
commit938d6f22422f40cf9e3186bde1395a5640619782 (patch)
tree1616547984c73f8b6fe2b60e184919b2e662ef0a
parent26b307aa1f814be9d21f9a8db8c7633b87844139 (diff)
GS: Test that varyings of the same name between VS and GS must match types
Reviewed-by: Paul Berry <stereotype441@gmail.com>
-rw-r--r--tests/spec/glsl-1.50/execution/vs-gs-varyings-match-types.shader_test48
1 files changed, 48 insertions, 0 deletions
diff --git a/tests/spec/glsl-1.50/execution/vs-gs-varyings-match-types.shader_test b/tests/spec/glsl-1.50/execution/vs-gs-varyings-match-types.shader_test
new file mode 100644
index 000000000..1659fb8b3
--- /dev/null
+++ b/tests/spec/glsl-1.50/execution/vs-gs-varyings-match-types.shader_test
@@ -0,0 +1,48 @@
+# Test that between VS and GS varyings of the same name must match type.
+#
+# From the GLSL 1.50 specification, section 4.3.4 ("Inputs"):
+#
+# "For the interface between a vertex shader and a geometry shader, vertex
+# shader output variables and geometry shader input variables of the same name
+# must match in type and qualification, except that the vertex shader name
+# cannot be declared as an array while the geometry shader name must be
+# declared as an array. Otherwise, a link error will occur."
+
+[require]
+GL >= 3.2
+GLSL >= 1.50
+
+[vertex shader]
+
+in vec4 piglit_vertex;
+
+out vec4 position;
+
+
+void main()
+{
+ position = piglit_vertex;
+}
+
+[geometry shader]
+
+layout(triangles) in;
+layout(triangle_strip, max_vertices = 3) out;
+
+in vec3 position[];
+
+void main()
+{
+}
+
+[fragment shader]
+
+out vec4 color;
+
+void main()
+{
+ color = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+link error