<div dir="ltr">On 20 August 2013 10:56, 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>
tests/spec/CMakeLists.txt | 1 +<br>
tests/spec/arb_provoking_vertex/CMakeLists.gl.txt | 14 ++++<br>
tests/spec/arb_provoking_vertex/CMakeLists.txt | 1 +<br>
.../provoking-vertex-control.c | 77 ++++++++++++++++++++++<br>
4 files changed, 93 insertions(+)<br>
create mode 100644 tests/spec/arb_provoking_vertex/CMakeLists.gl.txt<br>
create mode 100644 tests/spec/arb_provoking_vertex/CMakeLists.txt<br>
create mode 100644 tests/spec/arb_provoking_vertex/provoking-vertex-control.c<br></blockquote><div><br></div><div>Can we rename this commit to "Test ProvokingVertex() state", just so that it's clear from the commit subject that this test is verifying that the GL state is stored and retrieved correctly, and not actually testing the functionality?<br>
<br></div><div>Also, we usually add don't wait until the end of the patch series to add tests to all.tests. We add them in each patch as the tests appear (much as we do for CMakeLists.txt). That way it's easier for reviewers to verify that the correct thing has been added to all.tests. It also simplifies things if we wind up deciding to revert a patch in the future.<br>
<br>With those fixes, 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>
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt<br>
index 327780f..17c991a 100644<br>
--- a/tests/spec/CMakeLists.txt<br>
+++ b/tests/spec/CMakeLists.txt<br>
@@ -14,6 +14,7 @@ add_subdirectory (arb_map_buffer_range)<br>
add_subdirectory (arb_multisample)<br>
add_subdirectory (arb_occlusion_query)<br>
add_subdirectory (arb_occlusion_query2)<br>
+add_subdirectory (arb_provoking_vertex)<br>
add_subdirectory (arb_robustness)<br>
add_subdirectory (arb_sampler_objects)<br>
add_subdirectory (arb_seamless_cube_map)<br>
diff --git a/tests/spec/arb_provoking_vertex/CMakeLists.gl.txt b/tests/spec/arb_provoking_vertex/CMakeLists.gl.txt<br>
new file mode 100644<br>
index 0000000..e952392<br>
--- /dev/null<br>
+++ b/tests/spec/arb_provoking_vertex/CMakeLists.gl.txt<br>
@@ -0,0 +1,14 @@<br>
+include_directories(<br>
+ ${GLEXT_INCLUDE_DIR}<br>
+ ${OPENGL_INCLUDE_PATH}<br>
+)<br>
+<br>
+link_libraries (<br>
+ piglitutil_${piglit_target_api}<br>
+ ${OPENGL_gl_LIBRARY}<br>
+ ${OPENGL_glu_LIBRARY}<br>
+)<br>
+<br>
+piglit_add_executable (arb-provoking-vertex-control provoking-vertex-control.c)<br>
+<br>
+# vim: ft=cmake:<br>
diff --git a/tests/spec/arb_provoking_vertex/CMakeLists.txt b/tests/spec/arb_provoking_vertex/CMakeLists.txt<br>
new file mode 100644<br>
index 0000000..4a012b9<br>
--- /dev/null<br>
+++ b/tests/spec/arb_provoking_vertex/CMakeLists.txt<br>
@@ -0,0 +1 @@<br>
+piglit_include_target_api()<br>
\ No newline at end of file<br>
diff --git a/tests/spec/arb_provoking_vertex/provoking-vertex-control.c b/tests/spec/arb_provoking_vertex/provoking-vertex-control.c<br>
new file mode 100644<br>
index 0000000..302fdc4<br>
--- /dev/null<br>
+++ b/tests/spec/arb_provoking_vertex/provoking-vertex-control.c<br>
@@ -0,0 +1,77 @@<br>
+/**<br>
+ * Copyright © 2013 Intel Corporation<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 DEALINGS<br>
+ * IN THE SOFTWARE.<br>
+ */<br>
+<br>
+/**<br>
+ * Test that ProvokingVertex() controls the provoking vertex convention<br>
+ *<br>
+ * Section 2.18(Flatshading) of OpenGL 3.2 Core says:<br>
+ * "The provoking vertex is controlled with the command<br>
+ * void ProvokingVertex( enum provokeMode );<br>
+ * provokeMode must be either FIRST_VERTEX_CONVENTION or<br>
+ * LAST_VERTEX_CONVENTION"<br>
+ *<br>
+ */<br>
+<br>
+#include "piglit-util-gl-common.h"<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_BEGIN<br>
+<br>
+ config.supports_gl_compat_version = 32;<br>
+ config.supports_gl_core_version = 32;<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_END<br>
+<br>
+void<br>
+piglit_init(int argc, char **argv)<br>
+{<br>
+ bool pass = true;<br>
+ int ret = 0;<br>
+<br>
+ glProvokingVertex(GL_FIRST_VERTEX_CONVENTION);<br>
+ glGetIntegerv(GL_PROVOKING_VERTEX, &ret);<br>
+ if(ret != GL_FIRST_VERTEX_CONVENTION) {<br>
+ printf("GL_PROVOKING_VERTEX was expected to be GL_FIRST_VERTEX"<br>
+ "_CONVENTION, but %s was returned.\n",<br>
+ piglit_get_gl_enum_name(ret));<br>
+ pass = false;<br>
+ }<br>
+ pass = piglit_check_gl_error(GL_NO_ERROR) && pass;<br>
+<br>
+ glProvokingVertex(GL_LAST_VERTEX_CONVENTION);<br>
+ glGetIntegerv(GL_PROVOKING_VERTEX, &ret);<br>
+ if(ret != GL_LAST_VERTEX_CONVENTION) {<br>
+ printf("GL_PROVOKING_VERTEX was expected to be GL_LAST_VERTEX"<br>
+ "_CONVENTION, but %s was returned.\n",<br>
+ piglit_get_gl_enum_name(ret));<br>
+ pass = false;<br>
+ }<br>
+ pass = piglit_check_gl_error(GL_NO_ERROR) && pass;<br>
+<br>
+ piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);<br>
+}<br>
+<br>
+enum piglit_result<br>
+piglit_display(void)<br>
+{<br>
+ return PIGLIT_FAIL;<br>
+}<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>