<div dir="ltr">On 23 August 2013 15:13, Nicholas Mack <span dir="ltr"><<a href="mailto:nichmack@gmail.com" target="_blank">nichmack@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
---<br>
...ax-vertices-multiple-shader-objects.shader_test | 64 ++++++++++++++++++++++<br>
...output-type-multiple-shader-objects.shader_test | 64 ++++++++++++++++++++++<br>
2 files changed, 128 insertions(+)<br>
create mode 100644 tests/spec/glsl-1.50/linker/gs-same-max-vertices-multiple-shader-objects.shader_test<br>
create mode 100644 tests/spec/glsl-1.50/linker/gs-same-output-type-multiple-shader-objects.shader_test<br>
<br>
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<br>
new file mode 100644<br>
index 0000000..414629f<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/linker/gs-same-max-vertices-multiple-shader-objects.shader_test<br></blockquote><div><br></div><div>The name is a little surprising since the test exercises two shaders that have *different* values of max_vertices. I'd rename it to "gs-different-max-vertices-multiple-shader-objects.shader_test".<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
@@ -0,0 +1,64 @@<br>
+# Section 2.11.2 (Program Objects) of the GLSL 1.50 spec says:<br>
+#<br>
+# "Linking will also fail if the program object contains objects to form a<br>
+# geometry shader (see section 2.12), and<br>
+# • the program contains no objects to form a vertex shader;<br>
+# • the input primitive type, output primitive type, or maximum output<br>
+# vertex count is not specified in any compiled geometry shader object;<br>
+# • the input primitive type, output primitive type, or maximum output<br>
+# vertex count is specified differently in multiple geometry shader<br>
+# objects."<br>
+<br>
+[require]<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 150<br>
+<br>
+in vec4 vertex;<br>
+out vec4 vertex_to_gs;<br>
+<br>
+void main()<br>
+{<br>
+ vertex_to_gs = vertex;<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+void do_vertex(int i);<br>
+<br>
+void main()<br>
+{<br>
+ for (int i = 0; i < 2; i++)<br>
+ do_vertex(i);<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150<br>
+<br>
+layout(max_vertices = 2) out;<br>
+<br>
+in vec4 vertex_to_gs[2];<br></blockquote><div><br></div><div>This needs to be "in vec4 vertex_to_gs[3];", otherwise the link will fail for a reason unrelated to what you are trying to test.<br></div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+void do_vertex(int i)<br>
+{<br>
+ gl_Position = vertex_to_gs[i];<br>
+ EmitVertex();<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 150<br>
+<br>
+out vec4 color;<br>
+<br>
+void main()<br>
+{<br>
+ color = vec4(0.0, 1.0, 0.0, 1.0);<br>
+}<br>
+<br>
+[test]<br>
+link error<br>
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<br></blockquote><div><br></div><div>Similar comment on the name of tihs test.<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
new file mode 100644<br>
index 0000000..4a35770<br>
--- /dev/null<br>
+++ b/tests/spec/glsl-1.50/linker/gs-same-output-type-multiple-shader-objects.shader_test<br>
@@ -0,0 +1,64 @@<br>
+# Section 2.11.2 (Program Objects) of the GLSL 1.50 spec says:<br>
+#<br>
+# "Linking will also fail if the program object contains objects to form a<br>
+# geometry shader (see section 2.12), and<br>
+# • the program contains no objects to form a vertex shader;<br>
+# • the input primitive type, output primitive type, or maximum output<br>
+# vertex count is not specified in any compiled geometry shader object;<br>
+# • the input primitive type, output primitive type, or maximum output<br>
+# vertex count is specified differently in multiple geometry shader<br>
+# objects."<br>
+<br>
+[require]<br>
+GLSL >= 1.50<br>
+<br>
+[vertex shader]<br>
+#version 150<br>
+<br>
+in vec4 vertex;<br>
+out vec4 vertex_to_gs;<br>
+<br>
+void main()<br>
+{<br>
+ vertex_to_gs = vertex;<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150<br>
+<br>
+layout(triangles) in;<br>
+layout(triangle_strip, max_vertices = 3) out;<br>
+<br>
+void do_vertex(int i);<br>
+<br>
+void main()<br>
+{<br>
+ for (int i = 0; i < 2; i++)<br>
+ do_vertex(i);<br>
+}<br>
+<br>
+[geometry shader]<br>
+#version 150<br>
+<br>
+layout(points) out;<br>
+<br>
+in vec4 vertex_to_gs[1];<br></blockquote><div><br></div><div>As with the other test, this needs to be "in vec4 vertex_to_gs[3];".<br><br></div><div>With those changes, this patch is:<br><br>Reviewed-by: Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>><br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+void do_vertex(int i)<br>
+{<br>
+ gl_Position = vertex_to_gs[i];<br>
+ EmitVertex();<br>
+}<br>
+<br>
+[fragment shader]<br>
+#version 150<br>
+<br>
+out vec4 color;<br>
+<br>
+void main()<br>
+{<br>
+ color = vec4(0.0, 1.0, 0.0, 1.0);<br>
+}<br>
+<br>
+[test]<br>
+link error<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.8.3.1<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div></div>