[Piglit] [PATCH 2/2] Remove duplicate ARB_vertex_array_bgra test.
Ian Romanick
idr at freedesktop.org
Fri Aug 16 10:30:44 PDT 2013
On 08/15/2013 09:43 PM, Kenneth Graunke wrote:
> vertex-array-bgra.c and api-errors.c (in the same directory) test the
> same thing.
Oof. Mostly the same things, but not completely. This test tries a lot
more invalid values for <type>, but the other test checks glColorPointer
and glSecondaryColorPointer.
I think deleting this test is fine, but we should have Jacob:
- Add code to the existing test that checks the invalid <type> cases.
It should be table-driven instead of code-driven.
static const GLenum bad_types[] = {
GL_BYTE,
GL_SHORT,
...
};
for (i = 0; i < ARRAY_SIZE(bad_types); i++) {
glVertexAttribPointer(0, GL_BGRA, bad_types[i], GL_TRUE, 0, 0);
pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
}
- Have the modified test have three subtests: one for
glVertexAttribPointer, one for glColorPointer, and one of
glSecondaryColorPointer.
- Neither test checks that an error is generated when GL_BGRA is
passed to one of the other pointer functions (e.g., glNormalPointer).
- Neither test checks that the COLOR_ARRAY_SIZE,
SECONDARY_COLOR_ARRAY_SIZE, or VERTEX_ATTRIB_ARRAY_SIZE queries return
the correct thing when GL_BGRA was used.
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
> Cc: Ian Romanick <idr at freedesktop.org>
> Cc: Fredrik Höglund <fredrik at kde.org>
> Cc: Corey Richardson <corey at octayn.net>
> ---
> tests/spec/arb_vertex_array_bgra/CMakeLists.gl.txt | 1 -
> .../spec/arb_vertex_array_bgra/vertex-array-bgra.c | 101 ---------------------
> 2 files changed, 102 deletions(-)
> delete mode 100644 tests/spec/arb_vertex_array_bgra/vertex-array-bgra.c
>
> diff --git a/tests/spec/arb_vertex_array_bgra/CMakeLists.gl.txt b/tests/spec/arb_vertex_array_bgra/CMakeLists.gl.txt
> index f411587..3f3579b 100644
> --- a/tests/spec/arb_vertex_array_bgra/CMakeLists.gl.txt
> +++ b/tests/spec/arb_vertex_array_bgra/CMakeLists.gl.txt
> @@ -10,6 +10,5 @@ link_libraries (
> )
>
> piglit_add_executable (arb_vertex_array_bgra-api-errors api-errors.c)
> -piglit_add_executable (arb_vertex_array_bgra vertex-array-bgra.c)
>
> # vim: ft=cmake:
> diff --git a/tests/spec/arb_vertex_array_bgra/vertex-array-bgra.c b/tests/spec/arb_vertex_array_bgra/vertex-array-bgra.c
> deleted file mode 100644
> index 81b293c..0000000
> --- a/tests/spec/arb_vertex_array_bgra/vertex-array-bgra.c
> +++ /dev/null
> @@ -1,101 +0,0 @@
> -/* Copyright © 2013 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.
> - */
> -
> -/** @file vertex-array-bgra.c
> - *
> - * Section 2.8(Vertex Arrays) From GL spec 3.2 core (GL_ARB_vertex_array_bgra):
> - *
> - * The error INVALID_VALUE is generated if size is specified with a value other
> - * than that indicated in the table(GL 3.2 2.8), if size is BGRA and type is not
> - * UNSIGNED_BYTE, or by VertexAttribPointer if size is BGRA and normalized is
> - * FALSE.
> - */
> -
> -#include "piglit-util-gl-common.h"
> -
> -PIGLIT_GL_TEST_CONFIG_BEGIN
> -
> - config.supports_gl_compat_version = 10;
> -
> -PIGLIT_GL_TEST_CONFIG_END
> -
> -enum piglit_result
> -piglit_display(void)
> -{
> - /* UNREACHED */
> - return PIGLIT_FAIL;
> -}
> -
> -void
> -piglit_init(int argc, char **argv)
> -{
> - bool pass = true;
> - piglit_require_extension("GL_ARB_vertex_array_bgra");
> -
> - glEnableVertexAttribArray(0);
> -
> - /* Test when size == GL_BGRA && normalized == GL_TRUE;
> - * should generate GL_NO_ERROR
> - */
> - glVertexAttribPointer(0, GL_BGRA, GL_UNSIGNED_BYTE, GL_TRUE, 0, 0);
> - pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
> -
> - /* Test when size == GL_BGRA && normalized == GL_FALSE;
> - * should generate GL_INVALID_VALUE
> - */
> - glVertexAttribPointer(0, GL_BGRA, GL_UNSIGNED_BYTE, GL_FALSE, 0, 0);
> - pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -
> -
> - /* Test when size == GL_BGRA && type != GL_UNSIGNED_BYTE;
> - * should generate GL_INVALID_VALUE
> - */
> - glVertexAttribPointer(0, GL_BGRA, GL_BYTE, GL_TRUE, 0, 0);
> - pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -
> - glVertexAttribPointer(0, GL_BGRA, GL_SHORT, GL_TRUE, 0, 0);
> - pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -
> - glVertexAttribPointer(0, GL_BGRA, GL_UNSIGNED_SHORT, GL_TRUE, 0, 0);
> - pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -
> - glVertexAttribPointer(0, GL_BGRA, GL_INT, GL_TRUE, 0, 0);
> - pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -
> - glVertexAttribPointer(0, GL_BGRA, GL_UNSIGNED_INT, GL_TRUE, 0, 0);
> - pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -
> - glVertexAttribPointer(0, GL_BGRA, GL_HALF_FLOAT, GL_TRUE, 0, 0);
> - pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -
> - glVertexAttribPointer(0, GL_BGRA, GL_FLOAT, GL_TRUE, 0, 0);
> - pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -
> - glVertexAttribPointer(0, GL_BGRA, GL_DOUBLE, GL_TRUE, 0, 0);
> - pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -
> - glVertexAttribPointer(0, GL_BGRA, GL_FIXED, GL_TRUE, 0, 0);
> - pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> -
> - glDisableVertexAttribArray(0);
> - piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
> -}
>
More information about the Piglit
mailing list