[Piglit] [PATCH 2/7] arb_texture_view: Test valid and invalid formats

Brian Paul brianp at vmware.com
Fri Oct 25 01:56:34 CEST 2013


One minor formattting thing below.


On 10/24/2013 03:48 PM, Jon Ashburn wrote:
> When calling glTextureView() only certain formats are valid based on the format
> of the original texture. This tests valid/invalid combinations.
>
> Tested on Nvidia Quadro 600, all tests pass.
> ---
>   tests/all.tests                               |   1 +
>   tests/spec/arb_texture_view/CMakeLists.gl.txt |   1 +
>   tests/spec/arb_texture_view/common.c          |  60 +++++
>   tests/spec/arb_texture_view/common.h          |  28 +++
>   tests/spec/arb_texture_view/formats.c         | 311 ++++++++++++++++++++++++++
>   5 files changed, 401 insertions(+)
>   create mode 100644 tests/spec/arb_texture_view/common.c
>   create mode 100644 tests/spec/arb_texture_view/common.h
>   create mode 100644 tests/spec/arb_texture_view/formats.c
>
> diff --git a/tests/all.tests b/tests/all.tests
> index 2bb6aed..4d089b4 100644
> --- a/tests/all.tests
> +++ b/tests/all.tests
> @@ -1473,6 +1473,7 @@ arb_texture_view = Group()
>   spec['ARB_texture_view'] = arb_texture_view
>   arb_texture_view['immutable_levels'] = concurrent_test('arb_texture_view-texture-immutable-levels')
>   arb_texture_view['params'] = concurrent_test('arb_texture_view-params')
> +arb_texture_view['formats'] = concurrent_test('arb_texture_view-formats')
>
>   tdfx_texture_compression_fxt1 = Group()
>   spec['3DFX_texture_compression_FXT1'] = tdfx_texture_compression_fxt1
> diff --git a/tests/spec/arb_texture_view/CMakeLists.gl.txt b/tests/spec/arb_texture_view/CMakeLists.gl.txt
> index 4f2b1ef..44b6a64 100644
> --- a/tests/spec/arb_texture_view/CMakeLists.gl.txt
> +++ b/tests/spec/arb_texture_view/CMakeLists.gl.txt
> @@ -11,5 +11,6 @@ link_libraries(
>
>   piglit_add_executable(arb_texture_view-texture-immutable-levels texture-immutable-levels.c)
>   piglit_add_executable(arb_texture_view-params params.c)
> +piglit_add_executable(arb_texture_view-formats formats.c common.c)
>
>   # vim: ft=cmake:
> diff --git a/tests/spec/arb_texture_view/common.c b/tests/spec/arb_texture_view/common.c
> new file mode 100644
> index 0000000..f8ecb9e
> --- /dev/null
> +++ b/tests/spec/arb_texture_view/common.c
> @@ -0,0 +1,60 @@
> +/*
> + * Copyright © 2013 LunarG, Inc.
> + *
> + * 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.
> + *
> + * Author: Jon Ashburn <jon at lunarg.com>
> + */
> +
> +#include "piglit-util-gl-common.h"
> +#include <stdarg.h>
> +
> +/**
> + * This function takes an array of valid and invalid GLenums.  The invalid
> + * enums array starts fully populated and the valid  array is empty.
> + * It adds the varargs GLenum values to the valid array and removes  them
> + * from the invalid array.
> + * @param numInvalid  the size of array invalid
> + * An variable argument equal to zero will signal the end of
> + * the variable parameters.
> + */
> +
> +unsigned int update_valid_arrays(GLenum *valid, GLenum *invalid,
> +			 unsigned int numInvalid, ... )

unsigned int
update_valid_arrays(GLenum *valid, GLenum *invalid,
		    unsigned int numInvalid, ... )


Same thing in header file.

OK otherwise.
Reviewed-by: Brian Paul <brianp at vmware.com>



More information about the Piglit mailing list