[Piglit] [PATCH 10/18] arb_geometry_shader4: Test input overrun.

Fabian Bieler fabianbieler at fastmail.fm
Mon Jun 10 15:26:50 PDT 2013


Test that linking fails if the geometry shader accesses more components than
are available.

ARB_geometry_shader4 spec 2.16.1:
"However, a program object, containing a shader object that access more input
vertices than are available for the input primitive type of the program
object, will not link."
---
 .../input-overrun-lines-adjacency.shader_test      | 40 ++++++++++++++++++++++
 .../linker/input-overrun-lines.shader_test         | 40 ++++++++++++++++++++++
 .../linker/input-overrun-points.shader_test        | 40 ++++++++++++++++++++++
 .../input-overrun-triangles-adjacency.shader_test  | 40 ++++++++++++++++++++++
 .../linker/input-overrun-triangles.shader_test     | 40 ++++++++++++++++++++++
 5 files changed, 200 insertions(+)
 create mode 100644 tests/spec/arb_geometry_shader4/linker/input-overrun-lines-adjacency.shader_test
 create mode 100644 tests/spec/arb_geometry_shader4/linker/input-overrun-lines.shader_test
 create mode 100644 tests/spec/arb_geometry_shader4/linker/input-overrun-points.shader_test
 create mode 100644 tests/spec/arb_geometry_shader4/linker/input-overrun-triangles-adjacency.shader_test
 create mode 100644 tests/spec/arb_geometry_shader4/linker/input-overrun-triangles.shader_test

diff --git a/tests/spec/arb_geometry_shader4/linker/input-overrun-lines-adjacency.shader_test b/tests/spec/arb_geometry_shader4/linker/input-overrun-lines-adjacency.shader_test
new file mode 100644
index 0000000..8508928
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/linker/input-overrun-lines-adjacency.shader_test
@@ -0,0 +1,40 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+GL_ARB_geometry_shader4
+
+[vertex shader]
+#version 110
+
+attribute vec4 vertex;
+
+void main()
+{
+	gl_Position = vertex;
+}
+
+[geometry shader]
+#version 110
+#extension GL_ARB_geometry_shader4: enable
+
+void main()
+{
+	gl_Position = gl_PositionIn[4];
+	EmitVertex();
+}
+
+[geometry layout]
+input type GL_LINES_ADJACENCY
+output type GL_POINTS
+vertices out 1
+
+[fragment shader]
+#version 110
+
+void main()
+{
+	gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_geometry_shader4/linker/input-overrun-lines.shader_test b/tests/spec/arb_geometry_shader4/linker/input-overrun-lines.shader_test
new file mode 100644
index 0000000..352c0c8
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/linker/input-overrun-lines.shader_test
@@ -0,0 +1,40 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+GL_ARB_geometry_shader4
+
+[vertex shader]
+#version 110
+
+attribute vec4 vertex;
+
+void main()
+{
+	gl_Position = vertex;
+}
+
+[geometry shader]
+#version 110
+#extension GL_ARB_geometry_shader4: enable
+
+void main()
+{
+	gl_Position = gl_PositionIn[2];
+	EmitVertex();
+}
+
+[geometry layout]
+input type GL_LINES
+output type GL_POINTS
+vertices out 1
+
+[fragment shader]
+#version 110
+
+void main()
+{
+	gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_geometry_shader4/linker/input-overrun-points.shader_test b/tests/spec/arb_geometry_shader4/linker/input-overrun-points.shader_test
new file mode 100644
index 0000000..6ac788b
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/linker/input-overrun-points.shader_test
@@ -0,0 +1,40 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+GL_ARB_geometry_shader4
+
+[vertex shader]
+#version 110
+
+attribute vec4 vertex;
+
+void main()
+{
+	gl_Position = vertex;
+}
+
+[geometry shader]
+#version 110
+#extension GL_ARB_geometry_shader4: enable
+
+void main()
+{
+	gl_Position = gl_PositionIn[1];
+	EmitVertex();
+}
+
+[geometry layout]
+input type GL_POINTS
+output type GL_POINTS
+vertices out 1
+
+[fragment shader]
+#version 110
+
+void main()
+{
+	gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_geometry_shader4/linker/input-overrun-triangles-adjacency.shader_test b/tests/spec/arb_geometry_shader4/linker/input-overrun-triangles-adjacency.shader_test
new file mode 100644
index 0000000..809947b
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/linker/input-overrun-triangles-adjacency.shader_test
@@ -0,0 +1,40 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+GL_ARB_geometry_shader4
+
+[vertex shader]
+#version 110
+
+attribute vec4 vertex;
+
+void main()
+{
+	gl_Position = vertex;
+}
+
+[geometry shader]
+#version 110
+#extension GL_ARB_geometry_shader4: enable
+
+void main()
+{
+	gl_Position = gl_PositionIn[6];
+	EmitVertex();
+}
+
+[geometry layout]
+input type GL_TRIANGLES_ADJACENCY
+output type GL_POINTS
+vertices out 1
+
+[fragment shader]
+#version 110
+
+void main()
+{
+	gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_geometry_shader4/linker/input-overrun-triangles.shader_test b/tests/spec/arb_geometry_shader4/linker/input-overrun-triangles.shader_test
new file mode 100644
index 0000000..01e2e0e
--- /dev/null
+++ b/tests/spec/arb_geometry_shader4/linker/input-overrun-triangles.shader_test
@@ -0,0 +1,40 @@
+[require]
+GL >= 2.0
+GLSL >= 1.10
+GL_ARB_geometry_shader4
+
+[vertex shader]
+#version 110
+
+attribute vec4 vertex;
+
+void main()
+{
+	gl_Position = vertex;
+}
+
+[geometry shader]
+#version 110
+#extension GL_ARB_geometry_shader4: enable
+
+void main()
+{
+	gl_Position = gl_PositionIn[3];
+	EmitVertex();
+}
+
+[geometry layout]
+input type GL_TRIANGLES
+output type GL_POINTS
+vertices out 1
+
+[fragment shader]
+#version 110
+
+void main()
+{
+	gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
+}
+
+[test]
+link error
-- 
1.8.1.2



More information about the Piglit mailing list