<div dir="ltr">This looks good to me.<div><span style="font-size:12.8px">Reviewed-by: Plamena Manolova <</span><a href="mailto:lionel.g.landwerlin@intel.com" target="_blank" style="font-size:12.8px"><span class="gmail-il">plamena,manolova@intel.com</span></a><wbr style="font-size:12.8px"><span style="font-size:12.8px">></span><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 8, 2016 at 10:55 AM, Lionel Landwerlin <span dir="ltr"><<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">This extension is a subset of GL_NV_conservative_raster, applying only<br>
to polygons.<br>
<br>
v2: Drop wrongly added files from Plamena's work (Lionel)<br>
<br>
</span>v3: Enable tests on GLES (Lionel)<br>
<span class=""><br>
Signed-off-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com">lionel.g.landwerlin@intel.com</a><wbr>><br>
---<br>
</span> tests/all.py                                       |  12 ++<br>
 tests/spec/CMakeLists.txt                          |   1 +<br>
<span class=""> .../CMakeLists.gl.txt                              |  16 ++<br>
 .../CMakeLists.txt                                 |   1 +<br>
</span> .../depthcoverage.c                                |  75 +++++++++<br>
 .../innercoverage.c                                | 173 +++++++++++++++++++++<br>
 .../intel_conservative_<wbr>rasterization/invalid.c     | 114 ++++++++++++++<br>
 tests/spec/intel_conservative_<wbr>rasterization/tri.c  | 135 ++++++++++++++++<br>
 8 files changed, 527 insertions(+)<br>
<span class=""> create mode 100644 tests/spec/intel_conservative_<wbr>rasterization/CMakeLists.gl.<wbr>txt<br>
 create mode 100644 tests/spec/intel_conservative_<wbr>rasterization/CMakeLists.txt<br>
 create mode 100644 tests/spec/intel_conservative_<wbr>rasterization/depthcoverage.c<br>
 create mode 100644 tests/spec/intel_conservative_<wbr>rasterization/innercoverage.c<br>
 create mode 100644 tests/spec/intel_conservative_<wbr>rasterization/invalid.c<br>
 create mode 100644 tests/spec/intel_conservative_<wbr>rasterization/tri.c<br>
<br>
diff --git a/tests/all.py b/tests/all.py<br>
</span>index 03cf0c8..852ceae 100644<br>
--- a/tests/all.py<br>
+++ b/tests/all.py<br>
@@ -4898,5 +4898,17 @@ with profile.test_list.group_<wbr>manager(<br>
<span class="">     g(['arb_compute_variable_<wbr>group_size-local-size'], 'local-size')<br>
     g(['arb_compute_variable_<wbr>group_size-minmax'], 'minmax')<br>
<br>
</span>+# Group INTEL_conservative_<wbr>rasterization<br>
+with profile.test_list.group_<wbr>manager(<br>
+        PiglitGLTest,<br>
+        grouptools.join('spec', 'INTEL_conservative_<wbr>rasterization')) as g:<br>
<span class="">+    g(['intel_conservative_<wbr>rasterization-depthcoverage'])<br>
+    g(['intel_conservative_<wbr>rasterization-innercoverage'])<br>
+    g(['intel_conservative_<wbr>rasterization-invalid'])<br>
+    g(['intel_conservative_<wbr>rasterization-tri'])<br>
</span>+    g(['intel_conservative_<wbr>rasterization-depthcoverage_<wbr>gles3'])<br>
+    g(['intel_conservative_<wbr>rasterization-innercoverage_<wbr>gles3'])<br>
+    g(['intel_conservative_<wbr>rasterization-tri_gles3'])<br>
<div><div class="h5">+<br>
 if platform.system() is 'Windows':<br>
     profile.filters.append(lambda p, _: not p.startswith('glx'))<br>
diff --git a/tests/spec/CMakeLists.txt b/tests/spec/CMakeLists.txt<br>
index 4ac1a53..548515d 100644<br>
--- a/tests/spec/CMakeLists.txt<br>
+++ b/tests/spec/CMakeLists.txt<br>
@@ -153,3 +153,4 @@ add_subdirectory (arb_query_buffer_object)<br>
 add_subdirectory (ext_window_rectangles)<br>
 add_subdirectory (arb_shader_texture_image_<wbr>samples)<br>
 add_subdirectory (arb_texture_barrier)<br>
+add_subdirectory (intel_conservative_<wbr>rasterization)<br>
diff --git a/tests/spec/intel_<wbr>conservative_rasterization/<wbr>CMakeLists.gl.txt b/tests/spec/intel_<wbr>conservative_rasterization/<wbr>CMakeLists.gl.txt<br>
new file mode 100644<br>
index 0000000..6e0ab44<br>
--- /dev/null<br>
+++ b/tests/spec/intel_<wbr>conservative_rasterization/<wbr>CMakeLists.gl.txt<br>
@@ -0,0 +1,16 @@<br>
+include_directories(<br>
+       ${GLEXT_INCLUDE_DIR}<br>
+       ${OPENGL_INCLUDE_PATH}<br>
+)<br>
+<br>
+link_libraries (<br>
+       piglitutil_${piglit_target_<wbr>api}<br>
+       ${OPENGL_gl_LIBRARY}<br>
+)<br>
+<br>
+piglit_add_executable (intel_conservative_<wbr>rasterization-depthcoverage depthcoverage.c)<br>
+piglit_add_executable (intel_conservative_<wbr>rasterization-innercoverage innercoverage.c)<br>
+piglit_add_executable (intel_conservative_<wbr>rasterization-invalid invalid.c)<br>
+piglit_add_executable (intel_conservative_<wbr>rasterization-tri tri.c)<br>
+<br>
+# vim: ft=cmake:<br>
diff --git a/tests/spec/intel_<wbr>conservative_rasterization/<wbr>CMakeLists.txt b/tests/spec/intel_<wbr>conservative_rasterization/<wbr>CMakeLists.txt<br>
new file mode 100644<br>
index 0000000..144a306<br>
--- /dev/null<br>
+++ b/tests/spec/intel_<wbr>conservative_rasterization/<wbr>CMakeLists.txt<br>
@@ -0,0 +1 @@<br>
+piglit_include_target_api()<br>
diff --git a/tests/spec/intel_<wbr>conservative_rasterization/<wbr>depthcoverage.c b/tests/spec/intel_<wbr>conservative_rasterization/<wbr>depthcoverage.c<br>
new file mode 100644<br>
</div></div>index 0000000..0d8eb24<br>
--- /dev/null<br>
+++ b/tests/spec/intel_<wbr>conservative_rasterization/<wbr>depthcoverage.c<br>
@@ -0,0 +1,75 @@<br>
<div><div class="h5">+/*<br>
+ * Copyright © 2016 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>
+/** @file depthcoverage.c<br>
+ *<br>
+ * Verifies that post_depth_coverage & inner_coverage layout<br>
+ * qualifiers are mutually exclusives.<br>
+ */<br>
+<br>
+#include "piglit-util-gl.h"<br>
+#include "piglit-shader.h"<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_BEGIN<br>
+<br>
</div></div>+#if defined(PIGLIT_USE_OPENGL)<br>
+       config.supports_gl_core_<wbr>version = 42;<br>
+#elif defined(PIGLIT_USE_OPENGL_ES3)<br>
+       config.supports_gl_es_version = 31;<br>
+#endif<br>
<span class="">+<br>
+PIGLIT_GL_TEST_CONFIG_END<br>
+<br>
+enum piglit_result<br>
+piglit_display(void)<br>
+{<br>
+       return PIGLIT_FAIL;<br>
+}<br>
+<br>
+void piglit_init(int argc, char **argv)<br>
+{<br>
+       piglit_require_extension("GL_<wbr>INTEL_conservative_<wbr>rasterization");<br>
+       piglit_require_extension("GL_<wbr>ARB_post_depth_coverage");<br>
+<br>
+       GLuint invalid_prog = piglit_compile_shader_text_<wbr>nothrow(<br>
+               GL_FRAGMENT_SHADER,<br>
</span>+#if defined(PIGLIT_USE_OPENGL)<br>
+               "#version 430\n"<br>
+#elif defined(PIGLIT_USE_OPENGL_ES3)<br>
+               "#version 310 es\n"<br>
+#endif<br>
<span class="">+               "#extension GL_ARB_post_depth_coverage: enable\n"<br>
+               "#extension GL_INTEL_conservative_<wbr>rasterization: enable\n"<br>
+               "layout(inner_coverage) in;\n"<br>
+               "layout(post_depth_coverage) in;\n"<br>
+               "out vec4 color;\n"<br>
+               "void main()\n"<br>
+               "{\n"<br>
+               "  color = vec4(1.0, 0.0, 0.0, 1.0);\n"<br>
+               "}\n");<br>
+       if (invalid_prog)<br>
+               piglit_report_result(PIGLIT_<wbr>FAIL);<br>
+<br>
+       piglit_report_result(PIGLIT_<wbr>PASS);<br>
+}<br>
diff --git a/tests/spec/intel_<wbr>conservative_rasterization/<wbr>innercoverage.c b/tests/spec/intel_<wbr>conservative_rasterization/<wbr>innercoverage.c<br>
new file mode 100644<br>
</span>index 0000000..8524fb9<br>
--- /dev/null<br>
+++ b/tests/spec/intel_<wbr>conservative_rasterization/<wbr>innercoverage.c<br>
@@ -0,0 +1,173 @@<br>
<div><div class="h5">+/*<br>
+ * Copyright © 2016 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>
+/** @file innercoverage.c<br>
+ *<br>
+ * Verifies that the inner_coverage layout qualifier works when<br>
+ * GL_INTEL_conservative_<wbr>rasterization is enabled.<br>
+ */<br>
+<br>
+#include "piglit-util-gl.h"<br>
+#include "piglit-matrix.h"<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_BEGIN<br>
+<br>
</div></div>+#if defined(PIGLIT_USE_OPENGL)<br>
+       config.supports_gl_core_<wbr>version = 42;<br>
+#elif defined(PIGLIT_USE_OPENGL_ES3)<br>
+       config.supports_gl_es_version = 31;<br>
+#endif<br>
<span class="">+<br>
+       config.window_width = 400;<br>
+       config.window_height = 400;<br>
+       config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_END<br>
+<br>
+enum piglit_result<br>
+piglit_display(void)<br>
+{<br>
+       enum piglit_result result = PIGLIT_PASS;<br>
+<br>
+       /* The following fragment programs render the opaque red color<br>
+        * only when dispatched with a gl_SampleMaskIn empty. It<br>
+        * should therefore expose the effect of the inner_coverage<br>
+        * (i.e. no color with this qualifier and a triangle outline<br>
+        * without it). */<br>
+       GLuint inner_prog = piglit_build_simple_program(<br>
</span>+#if defined(PIGLIT_USE_OPENGL)<br>
+               "#version 420\n"<br>
+#elif defined(PIGLIT_USE_OPENGL_ES3)<br>
+               "#version 310 es\n"<br>
+#endif<br>
<span class="">+               "in vec4 piglit_vertex;\n"<br>
+               "void main()\n"<br>
+               "{\n"<br>
+               "  gl_Position = piglit_vertex;\n"<br>
+               "}\n",<br>
</span>+#if defined(PIGLIT_USE_OPENGL)<br>
+               "#version 420\n"<br>
<span class="">+               "#extension GL_INTEL_conservative_<wbr>rasterization: enable\n"<br>
</span>+#elif defined(PIGLIT_USE_OPENGL_ES3)<br>
+               "#version 310 es\n"<br>
+               "#extension GL_OES_sample_variables: enable\n"<br>
<span class="">+               "#extension GL_INTEL_conservative_<wbr>rasterization: enable\n"<br>
</span>+               "precision highp float;\n"<br>
+#endif<br>
<span class="">+               "layout(inner_coverage) in;\n"<br>
+               "out vec4 color;\n"<br>
+               "void main()\n"<br>
+               "{\n"<br>
+               "  float one = 1.0 - float(gl_SampleMaskIn[0]);\n"<br>
+               "  color = vec4(one, 0.0, 0.0, one);\n"<br>
+               "}\n");<br>
+       if (!inner_prog)<br>
+               piglit_report_result(PIGLIT_<wbr>FAIL);<br>
+<br>
+       GLuint conservative_prog = piglit_build_simple_program(<br>
</span>+#if defined(PIGLIT_USE_OPENGL)<br>
+               "#version 420\n"<br>
+#elif defined(PIGLIT_USE_OPENGL_ES3)<br>
+               "#version 310 es\n"<br>
+#endif<br>
<span class="">+               "in vec4 piglit_vertex;\n"<br>
+               "void main()\n"<br>
+               "{\n"<br>
+               "  gl_Position = piglit_vertex;\n"<br>
+               "}\n",<br>
</span>+#if defined(PIGLIT_USE_OPENGL)<br>
+               "#version 420\n"<br>
<span class="">+               "#extension GL_INTEL_conservative_<wbr>rasterization: enable\n"<br>
</span>+#elif defined(PIGLIT_USE_OPENGL_ES3)<br>
+               "#version 310 es\n"<br>
+               "#extension GL_OES_sample_variables: enable\n"<br>
<span class="">+               "#extension GL_INTEL_conservative_<wbr>rasterization: enable\n"<br>
</span>+               "precision highp float;\n"<br>
+#endif<br>
<div><div class="h5">+               "out vec4 color;\n"<br>
+               "void main()\n"<br>
+               "{\n"<br>
+               "  float one = 1.0 - float(gl_SampleMaskIn[0]);\n"<br>
+               "  color = vec4(one, 0.0, 0.0, one);\n"<br>
+               "}\n");<br>
+       if (!conservative_prog)<br>
+               piglit_report_result(PIGLIT_<wbr>FAIL);<br>
+<br>
+       glBindFramebuffer(GL_DRAW_<wbr>FRAMEBUFFER, piglit_winsys_fbo);<br>
+       glViewport(0, 0, piglit_width, piglit_height);<br>
+<br>
+       glClearColor(0.0, 0.0, 0.0, 0.0);<br>
+<br>
+       GLuint vao;<br>
+       glGenVertexArrays(1, &vao);<br>
+       glBindVertexArray(vao);<br>
+<br>
+       GLuint vbo;<br>
+       float delta = 1.01 / piglit_width;<br>
+       float vertices[3][2] = {<br>
+               { -0.5, -1 + delta, },<br>
+               { 0, 0.8, },<br>
+               { 0.5, -1 + delta, },<br>
+       };<br>
+       glGenBuffers(1, &vbo);<br>
+       glBindBuffer(GL_ARRAY_BUFFER, vbo);<br>
+       glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);<br>
+       glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(GLfloat), NULL);<br>
+       glEnableVertexAttribArray(0);<br>
+<br>
+       glEnable(GL_CONSERVATIVE_<wbr>RASTERIZATION_INTEL);<br>
+<br>
+       glUseProgram(conservative_<wbr>prog);<br>
+       glClear(GL_COLOR_BUFFER_BIT);<br>
+       glDrawArrays(GL_TRIANGLES, 0, 3);<br>
+<br>
+       if(!piglit_check_gl_error(GL_<wbr>NO_ERROR))<br>
+               return PIGLIT_FAIL;<br>
+<br>
+       piglit_present_results();<br>
+<br>
+       const float conservative_expected[] = { 0.0, 0.0, 0.0, 0.0 };<br>
+       if (!piglit_probe_pixel_rgba(<wbr>piglit_width / 2, 0, conservative_expected))<br>
+               result = PIGLIT_FAIL;<br>
+<br>
+       glUseProgram(inner_prog);<br>
+       glClear(GL_COLOR_BUFFER_BIT);<br>
+       glDrawArrays(GL_TRIANGLES, 0, 3);<br>
+<br>
+       if(!piglit_check_gl_error(GL_<wbr>NO_ERROR))<br>
+               result = PIGLIT_FAIL;<br>
+<br>
+       piglit_present_results();<br>
+<br>
+       const float inner_expected[] = { 1.0, 0.0, 0.0, 1.0 };<br>
+       if (!piglit_probe_pixel_rgba(<wbr>piglit_width / 2, 0, inner_expected))<br>
+               result = PIGLIT_FAIL;<br>
+<br>
+       return result;<br>
+}<br>
+<br>
+void piglit_init(int argc, char **argv)<br>
+{<br>
+       piglit_require_extension("GL_<wbr>INTEL_conservative_<wbr>rasterization");<br>
+}<br>
diff --git a/tests/spec/intel_<wbr>conservative_rasterization/<wbr>invalid.c b/tests/spec/intel_<wbr>conservative_rasterization/<wbr>invalid.c<br>
new file mode 100644<br>
</div></div>index 0000000..1e71816<br>
--- /dev/null<br>
+++ b/tests/spec/intel_<wbr>conservative_rasterization/<wbr>invalid.c<br>
@@ -0,0 +1,114 @@<br>
<div><div class="h5">+/*<br>
+ * Copyright © 2016 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>
+/** @file invalid.c<br>
+ *<br>
+ * Verifies that with GL_INTEL_conservative_<wbr>rasterization enabled, we<br>
+ * get specified errors when using invalid modes for that extension.<br>
+ */<br>
+<br>
+#include "piglit-util-gl.h"<br>
+#include "piglit-matrix.h"<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_BEGIN<br>
+<br>
</div></div>+#if defined(PIGLIT_USE_OPENGL)<br>
+       config.supports_gl_core_<wbr>version = 42;<br>
+#endif<br>
<span class="">+<br>
+PIGLIT_GL_TEST_CONFIG_END<br>
+<br>
+enum piglit_result<br>
+piglit_display(void)<br>
+{<br>
+       return PIGLIT_FAIL;<br>
+}<br>
+<br>
+void piglit_init(int argc, char **argv)<br>
+{<br>
+       piglit_require_extension("GL_<wbr>INTEL_conservative_<wbr>rasterization");<br>
+<br>
+       GLuint prog = piglit_build_simple_program(<br>
</span>+#if defined(PIGLIT_USE_OPENGL)<br>
+               "#version 330\n"<br>
+#endif<br>
<span class="">+               "in vec4 piglit_vertex;\n"<br>
+               "void main()\n"<br>
+               "{\n"<br>
+               "  gl_Position = piglit_vertex;\n"<br>
+               "}\n",<br>
</span>+#if defined(PIGLIT_USE_OPENGL)<br>
+               "#version 330\n"<br>
<span class="">+               "out vec4 color;\n"<br>
</span>+#endif<br>
<span class="">+               "void main()\n"<br>
+               "{\n"<br>
+               "  color = vec4(1.0, 0.0, 0.0, 1.0);\n"<br>
+               "}\n");<br>
</span><div><div class="h5">+       if (!prog)<br>
+               piglit_report_result(PIGLIT_<wbr>FAIL);<br>
+<br>
+       glBindFramebuffer(GL_DRAW_<wbr>FRAMEBUFFER, piglit_winsys_fbo);<br>
+       glUseProgram(prog);<br>
+<br>
+       GLuint vao;<br>
+       glGenVertexArrays(1, &vao);<br>
+       glBindVertexArray(vao);<br>
+<br>
+       GLuint vbo;<br>
+       float vertices[3][2] = {<br>
+               { -0.5, -1, },<br>
+               { 0, 0.8, },<br>
+               { 0.5, -1, },<br>
+       };<br>
+       glGenBuffers(1, &vbo);<br>
+       glBindBuffer(GL_ARRAY_BUFFER, vbo);<br>
+       glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);<br>
+       glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(GLfloat), NULL);<br>
+       glEnableVertexAttribArray(0);<br>
+<br>
+       glEnable(GL_CONSERVATIVE_<wbr>RASTERIZATION_INTEL);<br>
+       glPolygonMode(GL_FRONT_AND_<wbr>BACK, GL_FILL);<br>
+       glClear(GL_COLOR_BUFFER_BIT);<br>
+<br>
+       glDrawArrays(GL_POINTS, 0, 3);<br>
+       if (!piglit_check_gl_error(GL_<wbr>INVALID_OPERATION))<br>
+               piglit_report_result(PIGLIT_<wbr>FAIL);<br>
+<br>
+       glDrawArrays(GL_LINES, 0, 3);<br>
+       if (!piglit_check_gl_error(GL_<wbr>INVALID_OPERATION))<br>
+               piglit_report_result(PIGLIT_<wbr>FAIL);<br>
+<br>
+       glPolygonMode(GL_FRONT_AND_<wbr>BACK, GL_POINT);<br>
+       glDrawArrays(GL_LINES, 0, 3);<br>
+       if (!piglit_check_gl_error(GL_<wbr>INVALID_OPERATION))<br>
+               piglit_report_result(PIGLIT_<wbr>FAIL);<br>
+<br>
+       glPolygonMode(GL_FRONT_AND_<wbr>BACK, GL_LINE);<br>
+       glDrawArrays(GL_LINES, 0, 3);<br>
+       if (!piglit_check_gl_error(GL_<wbr>INVALID_OPERATION))<br>
+               piglit_report_result(PIGLIT_<wbr>FAIL);<br>
+<br>
+       piglit_report_result(PIGLIT_<wbr>PASS);<br>
+}<br>
diff --git a/tests/spec/intel_<wbr>conservative_rasterization/<wbr>tri.c b/tests/spec/intel_<wbr>conservative_rasterization/<wbr>tri.c<br>
new file mode 100644<br>
</div></div>index 0000000..5662445<br>
--- /dev/null<br>
+++ b/tests/spec/intel_<wbr>conservative_rasterization/<wbr>tri.c<br>
@@ -0,0 +1,135 @@<br>
<div><div class="h5">+/*<br>
+ * Copyright © 2016 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>
+/** @file tri.c<br>
+ *<br>
+ * Verifies that with GL_INTEL_conservative_<wbr>rasterization enabled,<br>
+ * partially covered pixels are rasterized.<br>
+ */<br>
+<br>
+#include "piglit-util-gl.h"<br>
+#include "piglit-matrix.h"<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_BEGIN<br>
+<br>
</div></div>+#if defined(PIGLIT_USE_OPENGL)<br>
+       config.supports_gl_core_<wbr>version = 42;<br>
+#elif defined(PIGLIT_USE_OPENGL_ES3)<br>
+       config.supports_gl_es_version = 31;<br>
+#endif<br>
<span class="">+<br>
+       config.window_width = 400;<br>
+       config.window_height = 400;<br>
+       config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;<br>
+<br>
+PIGLIT_GL_TEST_CONFIG_END<br>
+<br>
+enum piglit_result<br>
+piglit_display(void)<br>
+{<br>
+       float delta = 1.01 / piglit_width;<br>
+       GLuint prog;<br>
+       enum piglit_result result = PIGLIT_PASS;<br>
+<br>
+       prog = piglit_build_simple_program(<br>
</span>+#if defined(PIGLIT_USE_OPENGL)<br>
+               "#version 330\n"<br>
+#elif defined(PIGLIT_USE_OPENGL_ES3)<br>
+               "#version 300 es\n"<br>
+#endif<br>
<span class="">+               "in vec4 piglit_vertex;\n"<br>
+               "void main()\n"<br>
+               "{\n"<br>
+               "  gl_Position = piglit_vertex;\n"<br>
+               "}\n",<br>
</span>+#if defined(PIGLIT_USE_OPENGL)<br>
+               "#version 330\n"<br>
<span class="">+               "out vec4 color;\n"<br>
</span>+#elif defined(PIGLIT_USE_OPENGL_ES3)<br>
+               "#version 300 es\n"<br>
+               "out highp vec4 color;\n"<br>
+#endif<br>
<span class="im HOEnZb">+               "void main()\n"<br>
+               "{\n"<br>
+               "  color = vec4(1.0, 0.0, 0.0, 1.0);\n"<br>
+               "}\n");<br>
</span><div class="HOEnZb"><div class="h5">+       if (!prog)<br>
+               piglit_report_result(PIGLIT_<wbr>FAIL);<br>
+<br>
+       glBindFramebuffer(GL_DRAW_<wbr>FRAMEBUFFER, piglit_winsys_fbo);<br>
+       glViewport(0, 0, piglit_width, piglit_height);<br>
+<br>
+       glClearColor(0.0, 0.0, 0.0, 0.0);<br>
+<br>
+       glUseProgram(prog);<br>
+<br>
+       GLuint vao;<br>
+       glGenVertexArrays(1, &vao);<br>
+       glBindVertexArray(vao);<br>
+<br>
+       GLuint vbo;<br>
+       float vertices[3][2] = {<br>
+               { -0.5, -1 + delta, },<br>
+               { 0, 0.8, },<br>
+               { 0.5, -1 + delta, },<br>
+       };<br>
+       glGenBuffers(1, &vbo);<br>
+       glBindBuffer(GL_ARRAY_BUFFER, vbo);<br>
+       glBufferData(GL_ARRAY_BUFFER, sizeof(vertices), vertices, GL_STATIC_DRAW);<br>
+       glVertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(GLfloat), NULL);<br>
+       glEnableVertexAttribArray(0);<br>
+<br>
+       glEnable(GL_CONSERVATIVE_<wbr>RASTERIZATION_INTEL);<br>
+       glClear(GL_COLOR_BUFFER_BIT);<br>
+       glDrawArrays(GL_TRIANGLES, 0, 3);<br>
+<br>
+       if(!piglit_check_gl_error(GL_<wbr>NO_ERROR))<br>
+               return PIGLIT_FAIL;<br>
+<br>
+       piglit_present_results();<br>
+<br>
+       const float conservative_expected[] = { 1.0, 0.0, 0.0, 1.0 };<br>
+       if (!piglit_probe_pixel_rgba(<wbr>piglit_width / 2, 0, conservative_expected))<br>
+               result = PIGLIT_FAIL;<br>
+<br>
+       glDisable(GL_CONSERVATIVE_<wbr>RASTERIZATION_INTEL);<br>
+       glClear(GL_COLOR_BUFFER_BIT);<br>
+       glDrawArrays(GL_TRIANGLES, 0, 3);<br>
+<br>
+       if(!piglit_check_gl_error(GL_<wbr>NO_ERROR))<br>
+               return PIGLIT_FAIL;<br>
+<br>
+       piglit_present_results();<br>
+<br>
+       const float expected[] = { 0.0, 0.0, 0.0, 0.0 };<br>
+       if (!piglit_probe_pixel_rgba(<wbr>piglit_width / 2, 0, expected))<br>
+               result = PIGLIT_FAIL;<br>
+<br>
+       return result;<br>
+}<br>
+<br>
+void piglit_init(int argc, char **argv)<br>
+{<br>
+       piglit_require_extension("GL_<wbr>INTEL_conservative_<wbr>rasterization");<br>
+}<br>
--<br>
2.10.2<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>
</div></div></blockquote></div><br></div>