<div dir="ltr">Sorry for the delay--I've been travelling.<br><div><div class="gmail_extra"><br>On 7 June 2013 21:15, Fabian Bieler <span dir="ltr"><<a href="mailto:fabianbieler@fastmail.fm" target="_blank">fabianbieler@fastmail.fm</a>></span> wrote:<br>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Test that glProgramParameter() triggers the required errors.<br>
<br>
The geometry shader output primitive type is limited to a subset<br>
of OpenGL primitive types.<br>
<br>
>From the ARB_geometry_shader4 spec (section Errors):<br>
"The error INVALID_VALUE is generated by ProgramParameteriARB if <pname> is<br>
GEOMETRY_OUTPUT_TYPE_ARB and <value> is not one of POINTS, LINE_STRIP or<br>
TRIANGLE_STRIP."<br>
---<br>
tests/all.tests | 1 +<br>
.../execution/program-parameter/CMakeLists.gl.txt | 1 +<br>
.../execution/program-parameter/output-type.c | 87 ++++++++++++++++++++++<br>
3 files changed, 89 insertions(+)<br>
create mode 100644 tests/spec/arb_geometry_shader4/execution/program-parameter/output-type.c<br>
<br>
diff --git a/tests/all.tests b/tests/all.tests<br>
index 897542e..f21666a 100644<br>
--- a/tests/all.tests<br>
+++ b/tests/all.tests<br>
@@ -2298,6 +2298,7 @@ add_plain_test(arb_map_buffer_alignment, 'arb_map_buffer_alignment-sanity_test')<br>
<br>
arb_geometry_shader4 = Group()<br>
add_concurrent_test(arb_geometry_shader4, 'program-parameter-input-type')<br>
+add_concurrent_test(arb_geometry_shader4, 'program-parameter-output-type')<br>
spec['ARB_geometry_shader4'] = arb_geometry_shader4<br>
add_shader_test_dir(spec['ARB_geometry_shader4'],<br>
os.path.join(testsDir, 'spec', 'arb_geometry_shader4'),<br>
diff --git a/tests/spec/arb_geometry_shader4/execution/program-parameter/CMakeLists.gl.txt b/tests/spec/arb_geometry_shader4/execution/program-parameter/CMakeLists.gl.txt<br>
index 786eb31..aee7a98 100644<br>
--- a/tests/spec/arb_geometry_shader4/execution/program-parameter/CMakeLists.gl.txt<br>
+++ b/tests/spec/arb_geometry_shader4/execution/program-parameter/CMakeLists.gl.txt<br>
@@ -11,3 +11,4 @@ link_libraries (<br>
)<br>
<br>
piglit_add_executable (program-parameter-input-type input-type.c)<br>
+piglit_add_executable (program-parameter-output-type output-type.c)<br>
diff --git a/tests/spec/arb_geometry_shader4/execution/program-parameter/output-type.c b/tests/spec/arb_geometry_shader4/execution/program-parameter/output-type.c<br>
new file mode 100644<br>
index 0000000..66d57ab<br>
--- /dev/null<br>
+++ b/tests/spec/arb_geometry_shader4/execution/program-parameter/output-type.c<br>
@@ -0,0 +1,87 @@<br>
+/*<br>
+ * Copyright © 2013 The Piglit project<br>
+ *<br>
+ * Permission is hereby granted, free of charge, to any person obtaining a<br>
+ * copy of this software and associated documentation files (the "Software"),<br>
+ * to deal in the Software without restriction, including without limitation<br>
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,<br>
+ * and/or sell copies of the Software, and to permit persons to whom the<br>
+ * Software is furnished to do so, subject to the following conditions:<br>
+ *<br>
+ * The above copyright notice and this permission notice (including the next<br>
+ * paragraph) shall be included in all copies or substantial portions of the<br>
+ * Software.<br>
+ *<br>
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br>
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br>
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL<br>
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br>
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING<br>
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER<br>
+ * DEALINGS IN THE SOFTWARE.<br>
+ */<br>
+<br>
+/**<br>
+ * \file output-type.c<br>
+ *<br>
+ * Test required errors for wrong GL_GEOMETRY_OUTPUT_TYPE parameters.<br>
+ */<br>
+<br>
+#include "common.h"<br>
+<br>
+<br>
+static const struct primitive_geom_info primitives_out[] = {<br>
+ {GL_POINTS, GL_NO_ERROR},<br>
+<br>
+ {GL_LINES, GL_INVALID_VALUE},<br>
+ {GL_LINE_STRIP, GL_NO_ERROR},<br>
+ {GL_LINE_LOOP, GL_INVALID_VALUE},<br>
+<br>
+ {GL_TRIANGLES, GL_INVALID_VALUE},<br>
+ {GL_TRIANGLE_STRIP, GL_NO_ERROR},<br>
+ {GL_TRIANGLE_FAN, GL_INVALID_VALUE},<br>
+<br>
+ {GL_LINES_ADJACENCY, GL_INVALID_VALUE},<br>
+ {GL_LINE_STRIP_ADJACENCY, GL_INVALID_VALUE},<br>
+<br>
+ {GL_TRIANGLES_ADJACENCY, GL_INVALID_VALUE},<br>
+ {GL_TRIANGLE_STRIP_ADJACENCY, GL_INVALID_VALUE},<br>
+<br>
+ {GL_QUADS, GL_INVALID_VALUE},<br>
+ {GL_QUAD_STRIP, GL_INVALID_VALUE},<br>
+ {GL_POLYGON, GL_INVALID_VALUE},<br>
+};<br>
+<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_BEGIN<br>
+ config.supports_gl_compat_version = 20;<br>
+ config.window_visual = PIGLIT_GL_VISUAL_DOUBLE | PIGLIT_GL_VISUAL_RGBA;<br>
+PIGLIT_GL_TEST_CONFIG_END<br>
+<br>
+<br>
+void<br>
+piglit_init(int argc, char **argv)<br>
+{<br>
+ bool pass = true;<br>
+ GLuint prog;<br>
+ int i;<br></blockquote><div><br></div><div>This test needs<br><br>piglit_require_extension("GL_ARB_geometry_shader4");<br><br></div><div>With that change, 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+<br>
+ /* Create shader. */<br>
+ prog = create_shader(vs_text, gs_text4, fs_text4);<br>
+<br>
+ for (i = 0; i < ARRAY_SIZE(primitives_out); i++) {<br>
+ const struct primitive_geom_info p = primitives_out[i];<br>
+ printf("Testing %s.\n", piglit_get_prim_name(p.type));<br>
+ glProgramParameteri(prog, GL_GEOMETRY_OUTPUT_TYPE_ARB, p.type);<br>
+ pass = piglit_check_gl_error(p.error) && pass;<br>
+ }<br>
+<br>
+ piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);<br>
+}<br>
+<br>
+enum piglit_result<br>
+piglit_display(void)<br>
+{<br>
+ /* Should never be reached */<br>
+ return PIGLIT_FAIL;<br>
+}<br>
<span class=""><font color="#888888">--<br>
1.8.1.2<br>
<br>
</font></span><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>
<br></blockquote></div><br></div></div></div>