<div class="gmail_quote">On 9 November 2011 17:38, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net">eric@anholt.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, 8 Nov 2011 16:03:39 -0800, Paul Berry <<a href="mailto:stereotype441@gmail.com">stereotype441@gmail.com</a>> wrote:<br>
> According to the OpenGL 3.0 spec (section 2.15: Transform Feedback):<br>
><br>
> "When quads and polygons are provided to transform feedback with a<br>
> primitive mode of TRIANGLES, they will be tessellated and recorded<br>
> as triangles (the order of tessellation within a primitive is<br>
> undefined). Individual lines or triangles of a strip or fan<br>
> primitive will be extracted and recorded separately."<br>
><br>
> This test verifies the correctness of the tessellation and extraction<br>
> from strips and fans. It does so by feeding the output of transform<br>
> feedback back into the GL pipeline and verifying that the rendered<br>
> image is the same.<br>
><br>
> Verified using the nVidia proprietary driver for Linux. The nVidia<br>
> driver passes all tests except "tessellation polygon flat_last",<br>
> "tessellation quad_strip flat_last", and "tessellation quads<br>
> flat_last". These tests fail because the order in which the driver<br>
> tessellates polygons and quads fails to preserve the correct provoking<br>
> vertex, leading to different results from flatshading.<br>
<br>
</div>Ensuring that provoking vertex is respected seems like a reasonable<br>
requirement, and at least our hardware is built to support it it looks<br>
like.<br>
<br>
I like the test idea, and have just a few little style comments. I find<br>
the vertex transformations a bit unintuitive compared to most of our<br>
tests, but I'm not really worried.<br>
<div class="im"><br>
> +#include "piglit-util.h"<br>
> +<br>
> +#ifndef M_PI<br>
> +#define M_PI 3.141592653589793<br>
> +#endif<br>
<br>
</div>M_PI?<br>
<div class="im"><br></div></blockquote><div><br></div><div>I'm afraid I don't understand the question. Can you elaborate?</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">
> +#define BUFFER_SIZE 20<br>
> +<br>
> +#define Elements(array) (sizeof(array)/sizeof(array[0]))<br>
<br>
</div>There's ARRAY_SIZE available so you don't have to redefine this.<br></blockquote><div><br></div><div>Ah, ok. Thanks.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
> +/**<br>
> + * Check that two strips of the window match. Strips are numbered<br>
> + * from the top from 0 to 3.<br>
> + */<br>
> +static GLboolean<br>
> +match_strips(int reference, int compare)<br>
> +{<br>
> + int reference_offset = (3 - reference) * (piglit_height / 4);<br>
> + int compare_offset = (3 - compare) * (piglit_height / 4);<br>
> + int x, y;<br>
> + for (x = 0; x < piglit_width; ++x) {<br>
> + for (y = 0; y < piglit_height/4; ++y) {<br>
> + float probed[4];<br>
> + glReadPixels(x, y + reference_offset, 1, 1,<br>
> + GL_RGBA, GL_FLOAT, &probed);<br>
> + if (!piglit_probe_pixel_rgba(x, y + compare_offset,<br>
> + probed))<br>
> + return GL_FALSE;<br>
> + }<br>
> + }<br>
> + return GL_TRUE;<br>
> +}<br>
<br>
</div>It would be nice if you could use piglit_probe_rect_halves_equal_rgba()<br>
or a derivative here. glReadPixels()ing each pixel one by one sucks for<br>
performance.<br>
<div class="im"><br></div></blockquote><div><br></div><div>Yeah, that makes sense. I'll rework the test to use a single glReadPixels() call to read the reference image, and then piglit_probe_image_rgba() to check the other two images.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
> + printf("Test requires GL_EXT_provoking_vertex "<br>
> + "or GL_ARB_provoking_vertex\n");<br>
> + piglit_report_result(PIGLIT_SKIP);<br>
> + exit(1);<br>
<br>
</div>piglit_report_result() implies exit()<br>
</blockquote></div><br><div>Ok, thanks.</div>