[Piglit] [RFC 2/3] arb_gpu_shader5: add shader tests with multiple streams but emitting strips
Topi Pohjolainen
topi.pohjolainen at intel.com
Tue Oct 15 13:49:36 CEST 2013
There is also a test that just declares two vertex streams but emits
vertices into stream zero only. This should technically pass if one
reads the spec very carefully:
"Geometry shaders that emit vertices to multiple vertex streams are
currently limited to using only the "points" output primitive type.
A program will fail to link if it includes a geometry shader that
calls the EmitStreamVertex() built-in function and has any other
output primitive type parameter."
All three tests pass on NVIDIA (304.88 on GTX 660).
Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
---
...vertex-streams-emitting-line-strips.shader_test | 43 ++++++++++++++++++++++
...ex-streams-emitting-triangle-strips.shader_test | 43 ++++++++++++++++++++++
...-streams-only-one-emits-line-strips.shader_test | 40 ++++++++++++++++++++
3 files changed, 126 insertions(+)
create mode 100644 tests/spec/arb_gpu_shader5/linker/gs-multiple-vertex-streams-emitting-line-strips.shader_test
create mode 100644 tests/spec/arb_gpu_shader5/linker/gs-multiple-vertex-streams-emitting-triangle-strips.shader_test
create mode 100644 tests/spec/arb_gpu_shader5/linker/gs-multiple-vertex-streams-only-one-emits-line-strips.shader_test
diff --git a/tests/spec/arb_gpu_shader5/linker/gs-multiple-vertex-streams-emitting-line-strips.shader_test b/tests/spec/arb_gpu_shader5/linker/gs-multiple-vertex-streams-emitting-line-strips.shader_test
new file mode 100644
index 0000000..77af9e7
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/linker/gs-multiple-vertex-streams-emitting-line-strips.shader_test
@@ -0,0 +1,43 @@
+# [description]
+#
+# Test that multiple vertex streams cannot output line strips.
+#
+# Section Geometry Shader Vertex Streams of ARB_gpu_shader5 says:
+#
+# "Geometry shaders that emit vertices to multiple vertex streams are
+# currently limited to using only the "points" output primitive type. A
+# program will fail to link if it includes a geometry shader that calls the
+# EmitStreamVertex() built-in function and has any other output primitive
+# type parameter."
+#
+
+[require]
+GLSL >= 1.50
+ARB_gpu_shader5
+
+[vertex shader]
+#version 150
+
+void main()
+{
+ gl_Position = vec4(0);
+}
+
+[geometry shader]
+#version 150
+#extension GL_ARB_gpu_shader5 : enable
+
+layout(line_strip, max_vertices = 1, stream = 0) out;
+layout(line_strip, max_vertices = 1, stream = 1) out;
+
+void main()
+{
+ gl_Position = vec4(0.0);
+ EmitStreamVertex(0);
+
+ gl_Position = vec4(0.0);
+ EmitStreamVertex(1);
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_gpu_shader5/linker/gs-multiple-vertex-streams-emitting-triangle-strips.shader_test b/tests/spec/arb_gpu_shader5/linker/gs-multiple-vertex-streams-emitting-triangle-strips.shader_test
new file mode 100644
index 0000000..59ef7db
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/linker/gs-multiple-vertex-streams-emitting-triangle-strips.shader_test
@@ -0,0 +1,43 @@
+# [description]
+#
+# Test that multiple vertex streams cannot output triangle strips.
+#
+# Section Geometry Shader Vertex Streams of ARB_gpu_shader5 says:
+#
+# "Geometry shaders that emit vertices to multiple vertex streams are
+# currently limited to using only the "points" output primitive type. A
+# program will fail to link if it includes a geometry shader that calls the
+# EmitStreamVertex() built-in function and has any other output primitive
+# type parameter."
+#
+
+[require]
+GLSL >= 1.50
+ARB_gpu_shader5
+
+[vertex shader]
+#version 150
+
+void main()
+{
+ gl_Position = vec4(0);
+}
+
+[geometry shader]
+#version 150
+#extension GL_ARB_gpu_shader5 : enable
+
+layout(triangle_strip, max_vertices = 1, stream = 0) out;
+layout(triangle_strip, max_vertices = 1, stream = 1) out;
+
+void main()
+{
+ gl_Position = vec4(0.0);
+ EmitStreamVertex(0);
+
+ gl_Position = vec4(0.0);
+ EmitStreamVertex(1);
+}
+
+[test]
+link error
diff --git a/tests/spec/arb_gpu_shader5/linker/gs-multiple-vertex-streams-only-one-emits-line-strips.shader_test b/tests/spec/arb_gpu_shader5/linker/gs-multiple-vertex-streams-only-one-emits-line-strips.shader_test
new file mode 100644
index 0000000..29d1117
--- /dev/null
+++ b/tests/spec/arb_gpu_shader5/linker/gs-multiple-vertex-streams-only-one-emits-line-strips.shader_test
@@ -0,0 +1,40 @@
+# [description]
+#
+# Test that multiple vertex streams can be declared to output line strips as
+# long as the shader just emits into stream zero.
+#
+# Section Geometry Shader Vertex Streams of ARB_gpu_shader5 says:
+#
+# "Geometry shaders that emit vertices to multiple vertex streams are
+# currently limited to using only the "points" output primitive type. A
+# program will fail to link if it includes a geometry shader that calls the
+# EmitStreamVertex() built-in function and has any other output primitive
+# type parameter."
+#
+
+[require]
+GLSL >= 1.50
+ARB_gpu_shader5
+
+[vertex shader]
+#version 150
+
+void main()
+{
+ gl_Position = vec4(0);
+}
+
+[geometry shader]
+#version 150
+#extension GL_ARB_gpu_shader5 : enable
+
+layout(line_strip, max_vertices = 1, stream = 0) out;
+layout(line_strip, max_vertices = 1, stream = 1) out;
+
+void main()
+{
+ gl_Position = vec4(0.0);
+ EmitStreamVertex(0);
+}
+
+[test]
--
1.8.3.1
More information about the Piglit
mailing list