[Piglit] [PATCH] clear-accum: New test for i965 driver bug

Brian Paul brianp at vmware.com
Tue Jan 3 07:20:51 PST 2012


On 01/02/2012 08:08 PM, Shuang He wrote:
> v2: Verify result of clearing accum buffer (Brian Paul's suggestion)
>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=43783
> Signed-off-by: Shuang He<shuang.he at intel.com>
> ---
>   tests/general/CMakeLists.gl.txt |    1 +
>   tests/general/clear-accum.c     |   60 +++++++++++++++++++++++++++++++++++++++
>   2 files changed, 61 insertions(+), 0 deletions(-)
>   create mode 100644 tests/general/clear-accum.c
>
> diff --git a/tests/general/CMakeLists.gl.txt b/tests/general/CMakeLists.gl.txt
> index f8c5ddf..90711c6 100644
> --- a/tests/general/CMakeLists.gl.txt
> +++ b/tests/general/CMakeLists.gl.txt
> @@ -124,5 +124,6 @@ add_executable (object_purgeable-api-vbo object_purgeable-api-vbo.c object_purge
>   add_executable (occlusion_query occlusion_query.c)
>   add_executable (occlusion-query-discard occlusion-query-discard.c)
>   add_executable (quad-invariance quad-invariance.c)
> +add_executable (clear-accum clear-accum.c)
>
>   # vim: ft=cmake:
> diff --git a/tests/general/clear-accum.c b/tests/general/clear-accum.c
> new file mode 100644
> index 0000000..03be115
> --- /dev/null
> +++ b/tests/general/clear-accum.c
> @@ -0,0 +1,60 @@
> +/*
> + * Copyright © 2011 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + * Authors:
> + *    Shuang He<shuang.he at intel.com>
> + *
> + */
> +
> +/** @file clear_accum.c
> + *
> + * Tests that clear accum buffer
> + */
> +
> +#include "piglit-util.h"
> +
> +int piglit_width = 400;
> +int piglit_height = 200;
> +int piglit_window_mode = GLUT_RGB | GLUT_DOUBLE | GLUT_ACCUM;
> +
> +enum piglit_result
> +piglit_display(void)
> +{
> +	return PIGLIT_PASS;
> +}
> +
> +void
> +piglit_init(int argc, char **argv)
> +{
> +	GLboolean pass = GL_TRUE;
> +	static float green[] = {0.0, 1.0, 0.0, 0.0};
> +
> +	glClearAccum(0, 1, 0, 0);
> +	glClear(GL_ACCUM_BUFFER_BIT | GL_COLOR_BUFFER_BIT);
> +	glAccum(GL_RETURN, 1.0);
> +	pass&= piglit_probe_rect_rgb(0, 0, piglit_width, piglit_height / 2, green);

Are you intentionally only probing the bottom-half of the window?

-Brian

> +
> +	if (pass)
> +		piglit_report_result(PIGLIT_PASS);
> +	else
> +		piglit_report_result(PIGLIT_FAIL);
> +}
>
>
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit



More information about the Piglit mailing list