[Mesa-dev] [Piglit] [PATCH] Add a simple testcase to test that GL_ELEMENT_ARRAY_BUFFER is per vao

Eric Anholt eric at anholt.net
Wed Nov 23 11:12:19 PST 2011


On Wed, 23 Nov 2011 17:34:30 +0800, Yuanhan Liu <yuanhan.liu at linux.intel.com> wrote:
> From 9a1da8748f0faa23f34398213ff7ee45fda6bf36 Mon Sep 17 00:00:00 2001
> From: Yuanhan Liu <yuanhan.liu at linux.intel.com>
> Date: Wed, 23 Nov 2011 17:37:33 +0800
> Subject: [PATCH] Add a simple testcase to test that GL_ELEMENT_ARRAY_BUFFER
>  is per vao
> 
> According opengl spec 4.2.pdf table 6.12 (Vertex Array Object State) at
> page 515: the element buffer object is listed in vertex array object.
> 
> Add a testcase to test that.
> 
> v2: fix n careless 'always-return-PIGLIT_PASS' fault.
> 
> Signed-off-by: Yuanhan Liu <yuanhan.liu at linux.intel.com>

> diff --git a/tests/general/vao-element-array-buffer.c b/tests/general/vao-element-array-buffer.c
> new file mode 100644
> index 0000000..8803bff
> --- /dev/null
> +++ b/tests/general/vao-element-array-buffer.c
> @@ -0,0 +1,94 @@
> +/*
> + * Copyright (C) 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:
> + *    Yuanhan Liu <yuanhan.liu at linux.intel.com>
> + */

Generally, the style I advocate is to not include the Authors line in
copyright messages.  git records who the author was already, and will
provide a more accurate view of who wrote the current code if someone
wants to know some time down the line.  I don't know how many times, 5
years later, I've had emails from someone asking about some code I'd
"written" that just had my name in the header and nothing else really of
mine, from back when we were including Authors lines in the CVS days.

> +	glutSwapBuffers();

If you switched this to piglit_present_results, this test could be an
add_concurrent_test() instead.
> +	GLfloat vertics[] = {
> +		-1, -1, 0,
> +		 1, -1, 0,
> +		 1,  1, 0,
> +		-1,  1, 0,
> +	};
> +	GLubyte indics[] = {0, 1, 2, 3};

"vertices" and "indices"

Other than these silly nitpicks,

Reviewed-by: Eric Anholt <eric at anholt.net>

Thanks!
-------------- 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/mesa-dev/attachments/20111123/37adbf74/attachment.pgp>


More information about the mesa-dev mailing list