[Piglit] [PATCH] arb_viewport_array: Clear with many scissor rectangles set

Eric Anholt eric at anholt.net
Thu Jan 23 14:43:16 PST 2014


Ian Romanick <idr at freedesktop.org> writes:

> From: Ian Romanick <ian.d.romanick at intel.com>
>
> Set the scissor rectangle for all of the possible viewports to different
> values, and verify that only the scissor rectangle for viewport 0
> affects the clear.
>
> Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
> ---
>  tests/all.py                                    |  1 +
>  tests/spec/arb_viewport_array/CMakeLists.gl.txt |  1 +
>  tests/spec/arb_viewport_array/clear.c           | 84 +++++++++++++++++++++++++
>  3 files changed, 86 insertions(+)
>  create mode 100644 tests/spec/arb_viewport_array/clear.c
>
> diff --git a/tests/all.py b/tests/all.py
> index f81765c..abadb1f 100644
> --- a/tests/all.py
> +++ b/tests/all.py
> @@ -2140,6 +2140,7 @@ arb_viewport_array['minmax'] = concurrent_test('arb_viewport_array-minmax')
>  arb_viewport_array['render-viewport'] = concurrent_test('arb_viewport_array-render-viewport')
>  arb_viewport_array['render-depthrange'] = concurrent_test('arb_viewport_array-render-depthrange')
>  arb_viewport_array['render-scissor'] = concurrent_test('arb_viewport_array-render-scissor')
> +arb_viewport_array['clear'] =  PlainExecTest(['ab_viewport_array-clear', '-auto', '-fbo'])

s/ab/arb/.  Also, -fbo but not concurrent_test seems weird.

> +enum piglit_result
> +piglit_display(void)
> +{
> +	static const float expected[] = {
> +		0.f, 1.f, 0.f, 1.f
> +	};

"0.f" and "0." read weird to me (I write "0" or "0.0", but usually just
"0"), but I don't feel strongly about it.

> +	glDisable(GL_SCISSOR_TEST);
> +	glClearColor(0., 0., 0., 0.);
> +	glClear(GL_COLOR_BUFFER_BIT);
> +
> +	glScissorIndexed(0, 0, 0, piglit_width, piglit_height);
> +	glEnablei(GL_SCISSOR_TEST, 0);
> +
> +	for (i = 1; i < num_viewports; i++) {
> +		glEnablei(GL_SCISSOR_TEST, i);
> +		glScissorIndexed(i,
> +				 0, i * slice_height,
> +				 piglit_width, slice_height);
> +	}
> +
> +	glClearColor(0., 1., 0., 1.);
> +	glClear(GL_COLOR_BUFFER_BIT);

The other one I wonder about is what if the scissor rect for 0 is set to
something small, and 0 is disabled but 1..n are enabled.

But this test itself, with the all.py fixed, is:

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20140123/7cb1b6d0/attachment.pgp>


More information about the Piglit mailing list