[Piglit] [PATCH 1/3] GLSL 1.50: Test that geometry shader must specify input type, output type and maximum output vertices

Nicholas Mack nichmack at gmail.com
Fri Aug 23 15:13:10 PDT 2013


---
 .../linker/gs-must-specify-input-type.shader_test  | 52 +++++++++++++++++++++
 .../gs-must-specify-max-vertices.shader_test       | 53 ++++++++++++++++++++++
 .../linker/gs-must-specify-output-type.shader_test | 53 ++++++++++++++++++++++
 3 files changed, 158 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/linker/gs-must-specify-input-type.shader_test
 create mode 100644 tests/spec/glsl-1.50/linker/gs-must-specify-max-vertices.shader_test
 create mode 100644 tests/spec/glsl-1.50/linker/gs-must-specify-output-type.shader_test

diff --git a/tests/spec/glsl-1.50/linker/gs-must-specify-input-type.shader_test b/tests/spec/glsl-1.50/linker/gs-must-specify-input-type.shader_test
new file mode 100644
index 0000000..af4967b
--- /dev/null
+++ b/tests/spec/glsl-1.50/linker/gs-must-specify-input-type.shader_test
@@ -0,0 +1,52 @@
+# Section 2.11.2 (Program Objects) of the GLSL 1.50 spec says:
+#
+# "Linking will also fail if the program object contains objects to form a
+#  geometry shader (see section 2.12), and
+#	• the program contains no objects to form a vertex shader;
+#	• the input primitive type, output primitive type, or maximum output
+#	  vertex count is not specified in any compiled geometry shader object;
+#	• the input primitive type, output primitive type, or maximum output
+#	  vertex count is specified differently in multiple geometry shader
+#	  objects."
+
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+	vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles, max_vertices = 3) out;
+
+in vec4 vertex_to_gs[3];
+
+void main()
+{
+	for(int i = 0; i < 3; i++) {
+		gl_Position = vertex_to_gs[i];
+		EmitVertex();
+	}
+}
+
+[fragment shader]
+#version 150
+
+out vec4 color;
+
+void main()
+{
+	color = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+link error
diff --git a/tests/spec/glsl-1.50/linker/gs-must-specify-max-vertices.shader_test b/tests/spec/glsl-1.50/linker/gs-must-specify-max-vertices.shader_test
new file mode 100644
index 0000000..9126fec
--- /dev/null
+++ b/tests/spec/glsl-1.50/linker/gs-must-specify-max-vertices.shader_test
@@ -0,0 +1,53 @@
+# Section 2.11.2 (Program Objects) of the GLSL 1.50 spec says:
+#
+# "Linking will also fail if the program object contains objects to form a
+#  geometry shader (see section 2.12), and
+#	• the program contains no objects to form a vertex shader;
+#	• the input primitive type, output primitive type, or maximum output
+#	  vertex count is not specified in any compiled geometry shader object;
+#	• the input primitive type, output primitive type, or maximum output
+#	  vertex count is specified differently in multiple geometry shader
+#	  objects."
+
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+	vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(triangles) out;
+
+in vec4 vertex_to_gs[];
+
+void main()
+{
+	for(int i = 0; i < 3; i++) {
+		gl_Position = vertex_to_gs[i];
+		EmitVertex();
+	}
+}
+
+[fragment shader]
+#version 150
+
+out vec4 color;
+
+void main()
+{
+	color = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+link error
diff --git a/tests/spec/glsl-1.50/linker/gs-must-specify-output-type.shader_test b/tests/spec/glsl-1.50/linker/gs-must-specify-output-type.shader_test
new file mode 100644
index 0000000..97de5ac
--- /dev/null
+++ b/tests/spec/glsl-1.50/linker/gs-must-specify-output-type.shader_test
@@ -0,0 +1,53 @@
+# Section 2.11.2 (Program Objects) of the GLSL 1.50 spec says:
+#
+# "Linking will also fail if the program object contains objects to form a
+#  geometry shader (see section 2.12), and
+#	• the program contains no objects to form a vertex shader;
+#	• the input primitive type, output primitive type, or maximum output
+#	  vertex count is not specified in any compiled geometry shader object;
+#	• the input primitive type, output primitive type, or maximum output
+#	  vertex count is specified differently in multiple geometry shader
+#	  objects."
+
+[require]
+GLSL >= 1.50
+
+[vertex shader]
+#version 150
+
+in vec4 vertex;
+out vec4 vertex_to_gs;
+
+void main()
+{
+	vertex_to_gs = vertex;
+}
+
+[geometry shader]
+#version 150
+
+layout(triangles) in;
+layout(max_vertices = 3) out;
+
+in vec4 vertex_to_gs[];
+
+void main()
+{
+	for(int i = 0; i < 3; i++) {
+		gl_Position = vertex_to_gs[i];
+		EmitVertex();
+	}
+}
+
+[fragment shader]
+#version 150
+
+out vec4 color;
+
+void main()
+{
+	color = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+link error
-- 
1.8.3.1



More information about the Piglit mailing list