[Piglit] [PATCH] Add a test for viewport triangle clipping.

Eric Anholt eric at anholt.net
Mon Nov 12 16:42:59 PST 2012


Stuart Abercrombie <sabercrombie at chromium.org> writes:

> Triangles should be clipped to the clip volume and therefore shouldn't end up being rasterized outside the viewport.
>
> This was failing on Sandy Bridge with guard band clipping enabled.
>
> v2 with a new name, more comments and addition to all.tests.

I was about to push this, but I'd like to get a copyright notice on it.
The preferred license is at /COPYING.  A couple of nitpicks below.

> diff --git a/tests/all.tests b/tests/all.tests
> index 0a8a5aa..954a96c 100644
> --- a/tests/all.tests
> +++ b/tests/all.tests
> @@ -556,6 +556,7 @@ add_plain_test(gl11, 'streaming-texture-leak')
>  add_plain_test(gl11, 'texredefine')
>  add_plain_test(gl11, 'texsubimage')
>  add_plain_test(gl11, 'texture-al')
> +add_plain_test(gl11, 'triangle-guardband-viewport')

This can be add_concurrent_test so it runs in parallel and doesn't spam
a window on the screen.

> +	GLboolean pass = GL_TRUE;

We're trying to move to using just "bool" instead of the ridiculous GL
type.

> +	/* draw blue rect extending beyond the right edge of the
> +	   frustrum, notionally across the whole window */

Generally our comment style is:

	/* draw blue rect extending beyond the right edge of the
	 * frustrum, notionally across the whole window */
	 */
> +	pass &= piglit_probe_rect_rgb(piglit_width/2, 0,
> +				piglit_width/2, piglit_height, green);

funny indentation.

> +void
> +piglit_init(int argc, char **argv)
> +{
> +	glMatrixMode(GL_PROJECTION);
> +	glLoadIdentity();
> +
> +	glMatrixMode(GL_MODELVIEW);
> +	glLoadIdentity();

That's the default, so you don't need to bother.

> +}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20121112/815c2934/attachment.pgp>


More information about the Piglit mailing list