[Piglit] [PATCH 1/2] Test that VertexAttribDivisor() generates INVALID_VALUE if index is greater than or equal to MAX_VERTEX_ATTRIBS.

Anuj Phogat anuj.phogat at gmail.com
Tue Nov 26 11:36:38 PST 2013


On Mon, Nov 18, 2013 at 3:59 PM, Nicholas Mack <nichmack at gmail.com> wrote:
> ---
>  tests/all.tests                                    |  1 +
>  tests/spec/arb_instanced_arrays/CMakeLists.gl.txt  |  1 +
>  .../vertex-attrib-divisor-index-error.c            | 59 ++++++++++++++++++++++
>  3 files changed, 61 insertions(+)
>  create mode 100644 tests/spec/arb_instanced_arrays/vertex-attrib-divisor-index-error.c
>
> diff --git a/tests/all.tests b/tests/all.tests
> index e9a579c..b2b380c 100644
> --- a/tests/all.tests
> +++ b/tests/all.tests
> @@ -2545,6 +2545,7 @@ add_plain_test(ati_envmap_bumpmap, 'ati_envmap_bumpmap-bump')
>
>  arb_instanced_arrays = Group()
>  spec['ARB_instanced_arrays'] = arb_instanced_arrays
> +add_plain_test(arb_instanced_arrays, 'vertex-attrib-divisor-index-error')
>  add_plain_test(arb_instanced_arrays, 'instanced_arrays')
>  add_single_param_test_set(arb_instanced_arrays, 'instanced_arrays', 'vbo')
>
> diff --git a/tests/spec/arb_instanced_arrays/CMakeLists.gl.txt b/tests/spec/arb_instanced_arrays/CMakeLists.gl.txt
> index cb6c03d..8f7498e 100644
> --- a/tests/spec/arb_instanced_arrays/CMakeLists.gl.txt
> +++ b/tests/spec/arb_instanced_arrays/CMakeLists.gl.txt
> @@ -10,5 +10,6 @@ link_libraries (
>  )
>
>  piglit_add_executable (instanced_arrays instanced_arrays.c)
> +piglit_add_executable (vertex-attrib-divisor-index-error vertex-attrib-divisor-index-error.c)
>
>  # vim: ft=cmake:
> diff --git a/tests/spec/arb_instanced_arrays/vertex-attrib-divisor-index-error.c b/tests/spec/arb_instanced_arrays/vertex-attrib-divisor-index-error.c
> new file mode 100644
> index 0000000..062b14c
> --- /dev/null
> +++ b/tests/spec/arb_instanced_arrays/vertex-attrib-divisor-index-error.c
> @@ -0,0 +1,59 @@
> +/**
> + * 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
> + * Test that VertexAttribDivisor() generates INVALID_VALUE if index is greater
> + * than or equal to MAX_VERTEX_ATTRIBS.
> + *
> + * GL 3.3 core spec, section 2.8 (Vertex Arrays) says:
> + * "An INVALID_VALUE error is generated if index is greater than or equal to the
> + *  value of MAX_VERTEX_ATTRIBS."
> + */
> +
> +#include "piglit-util-gl-common.h"
> +
> +PIGLIT_GL_TEST_CONFIG_BEGIN
> +
> +       config.supports_gl_core_version = 33;
> +       config.supports_gl_compat_version = 33;
> +
> +PIGLIT_GL_TEST_CONFIG_END
> +
> +void
> +piglit_init(int argc, char **argv)
> +{
> +       bool pass = true;
> +
> +       glVertexAttribDivisor(GL_MAX_VERTEX_ATTRIBS, 0);
> +       pass = piglit_check_gl_error(GL_INVALID_VALUE) && pass;
> +
> +       piglit_report_result(pass ? PIGLIT_PASS : PIGLIT_FAIL);
> +}
> +
> +enum piglit_result
> +piglit_display(void)
> +{
> +       /* UNREACHED */
> +       return PIGLIT_FAIL;
> +}
> --
> 1.8.3.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit

Use shorter subject line for commit.
With this change:
Reviewed-by: Anuj Phogat <anuj.phogat at gmail.com>


More information about the Piglit mailing list