<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">Thanks for writing a test!<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Wed, Jun 13, 2018 at 3:54 AM,  <span dir="ltr"><<a href="mailto:danylo.piliaiev@gmail.com" target="_blank">danylo.piliaiev@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From: Danylo Piliaiev <<a href="mailto:danylo.piliaiev@globallogic.com">danylo.piliaiev@globallogic.<wbr>com</a>><br>
<br>
Clipper can mess up provoking vertex.<br>
Ref: <a href="https://bugs.freedesktop.org/show_bug.cgi?id=103047" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/<wbr>show_bug.cgi?id=103047</a><br>
<br>
Signed-off-by: Danylo Piliaiev <<a href="mailto:danylo.piliaiev@globallogic.com">danylo.piliaiev@globallogic.<wbr>com</a>><br>
---<br>
 tests/opengl.py                                    |  1 +<br>
 tests/spec/arb_provoking_<wbr>vertex/CMakeLists.gl.txt  |  1 +<br>
 .../clipped-geometry-<wbr>flatshading.c                 | 78 ++++++++++++++++++++++<br>
 3 files changed, 80 insertions(+)<br>
 create mode 100644 tests/spec/arb_provoking_<wbr>vertex/clipped-geometry-<wbr>flatshading.c<br>
<br>
diff --git a/tests/opengl.py b/tests/opengl.py<br>
index 3109a5e..313b22b 100644<br>
--- a/tests/opengl.py<br>
+++ b/tests/opengl.py<br>
@@ -2205,6 +2205,7 @@ with profile.test_list.group_<wbr>manager(<br>
     g(['arb-provoking-vertex-<wbr>control'], run_concurrent=False)<br>
     g(['arb-provoking-vertex-<wbr>initial'], run_concurrent=False)<br>
     g(['arb-provoking-vertex-<wbr>render'], run_concurrent=False)<br>
+    g(['arb-provoking-vertex-<wbr>clipped-geometry-flatshading']<wbr>, run_concurrent=False)<br>
     g(['arb-quads-follow-<wbr>provoking-vertex'], run_concurrent=False)<br>
     g(['arb-xfb-before-<wbr>flatshading'], run_concurrent=False)<br>
<br>
diff --git a/tests/spec/arb_provoking_<wbr>vertex/CMakeLists.gl.txt b/tests/spec/arb_provoking_<wbr>vertex/CMakeLists.gl.txt<br>
index 6dd15bb..3acffc6 100644<br>
--- a/tests/spec/arb_provoking_<wbr>vertex/CMakeLists.gl.txt<br>
+++ b/tests/spec/arb_provoking_<wbr>vertex/CMakeLists.gl.txt<br>
@@ -11,6 +11,7 @@ link_libraries (<br>
 piglit_add_executable (arb-provoking-vertex-control provoking-vertex-control.c)<br>
 piglit_add_executable (arb-provoking-vertex-initial provoking-vertex-initial.c)<br>
 piglit_add_executable (arb-provoking-vertex-render render.c)<br>
+piglit_add_executable (arb-provoking-vertex-clipped-<wbr>geometry-flatshading clipped-geometry-flatshading.<wbr>c)<br>
 piglit_add_executable (arb-quads-follow-provoking-<wbr>vertex quads-follow-provoking-vertex.<wbr>c)<br>
 piglit_add_executable (arb-xfb-before-flatshading xfb-before-flatshading.c)<br>
<br>
diff --git a/tests/spec/arb_provoking_<wbr>vertex/clipped-geometry-<wbr>flatshading.c b/tests/spec/arb_provoking_<wbr>vertex/clipped-geometry-<wbr>flatshading.c<br>
new file mode 100644<br>
index 0000000..97af48b<br>
--- /dev/null<br>
+++ b/tests/spec/arb_provoking_<wbr>vertex/clipped-geometry-<wbr>flatshading.c<br>
@@ -0,0 +1,78 @@<br>
+/*<br>
+ * Copyright © 2018 Danylo Piliaiev<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 provoking vertex works as expected when part of the geometry<br>
+ * is clipped when flat shading is enabled.<br>
+ *<br>
+ * <a href="https://bugs.freedesktop.org/show_bug.cgi?id=103047" rel="noreferrer" target="_blank">https://bugs.freedesktop.org/<wbr>show_bug.cgi?id=103047</a><br>
+ */<br>
+<br>
+#include "piglit-util-gl.h"<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_BEGIN<br>
+       config.supports_gl_compat_<wbr>version = 10;<br>
+       config.khr_no_error_support = PIGLIT_NO_ERRORS;<br>
+PIGLIT_GL_TEST_CONFIG_END<br>
+<br>
+void<br>
+piglit_init(int argc, char **argv)<br>
+{<br>
+       piglit_require_extension("GL_<wbr>EXT_provoking_vertex");<br>
+       piglit_ortho_projection(<wbr>piglit_width, piglit_height, GL_FALSE);<br>
+<br>
+       glShadeModel(GL_FLAT);<br>
+}<br>
+<br>
+enum piglit_result<br>
+piglit_display(void)<br>
+{<br>
+       static const float red[3] = {1, 0, 0};<br>
+       static const float green[3] = {0, 1, 0};<br>
+<br>
+       bool pass = true;<br>
+<br>
+       glClear(GL_COLOR_BUFFER_BIT);<br>
+       glProvokingVertexEXT(GL_LAST_<wbr>VERTEX_CONVENTION_EXT);<br>
+<br>
+       const int y1 = piglit_height / 3;<br>
+<br>
+       glBegin(GL_TRIANGLE_STRIP);<br>
+               glColor3fv(green);<br>
+               glVertex3i(piglit_width + 1, y1, 0);<br>
+               glColor3fv(green);<br>
+               glVertex3i(piglit_width + 2, y1, 0);<br>
+               glColor3fv(green);<br>
+               glVertex3i(piglit_width + 3, y1, 0);<br>
+               glColor3fv(green);<br>
+               glVertex3i(piglit_width / 2, y1 * 2, 0);<br></blockquote><div><br></div><div>When I was experimenting with this yesterday, I found it easier to have 3 colors instead of 3.  It would probably be even better to just have 5 separate colors so you can see exactly what is going on in all cases.</div><div><br></div><div>--Jason<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+               glColor3fv(red);<br>
+               glVertex3i(piglit_width - 1, y1 * 2, 0);<br>
+       glEnd();<br>
+<br>
+       pass = pass && piglit_probe_pixel_rgb(piglit_<wbr>width - 2, y1 * 3 / 2, red);<br>
+<br>
+       piglit_present_results();<br>
+<br>
+       return pass ? PIGLIT_PASS : PIGLIT_FAIL;<br>
+}<br>
<span class="HOEnZb"><font color="#888888">-- <br>
2.7.4<br>
<br>
______________________________<wbr>_________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org">Piglit@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/piglit" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div></div>