[Piglit] [PATCH 2/3] GLSL 1.50: Test that differently specified input/output layouts results in link error

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


---
 ...ax-vertices-multiple-shader-objects.shader_test | 64 ++++++++++++++++++++++
 ...output-type-multiple-shader-objects.shader_test | 64 ++++++++++++++++++++++
 2 files changed, 128 insertions(+)
 create mode 100644 tests/spec/glsl-1.50/linker/gs-same-max-vertices-multiple-shader-objects.shader_test
 create mode 100644 tests/spec/glsl-1.50/linker/gs-same-output-type-multiple-shader-objects.shader_test

diff --git a/tests/spec/glsl-1.50/linker/gs-same-max-vertices-multiple-shader-objects.shader_test b/tests/spec/glsl-1.50/linker/gs-same-max-vertices-multiple-shader-objects.shader_test
new file mode 100644
index 0000000..414629f
--- /dev/null
+++ b/tests/spec/glsl-1.50/linker/gs-same-max-vertices-multiple-shader-objects.shader_test
@@ -0,0 +1,64 @@
+# 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(triangle_strip, max_vertices = 3) out;
+
+void do_vertex(int i);
+
+void main()
+{
+  for (int i = 0; i < 2; i++)
+    do_vertex(i);
+}
+
+[geometry shader]
+#version 150
+
+layout(max_vertices = 2) out;
+
+in vec4 vertex_to_gs[2];
+
+void do_vertex(int 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-same-output-type-multiple-shader-objects.shader_test b/tests/spec/glsl-1.50/linker/gs-same-output-type-multiple-shader-objects.shader_test
new file mode 100644
index 0000000..4a35770
--- /dev/null
+++ b/tests/spec/glsl-1.50/linker/gs-same-output-type-multiple-shader-objects.shader_test
@@ -0,0 +1,64 @@
+# 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(triangle_strip, max_vertices = 3) out;
+
+void do_vertex(int i);
+
+void main()
+{
+  for (int i = 0; i < 2; i++)
+    do_vertex(i);
+}
+
+[geometry shader]
+#version 150
+
+layout(points) out;
+
+in vec4 vertex_to_gs[1];
+
+void do_vertex(int 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