[Piglit] [PATCH 2/2] Add new FS execution test for textureSize with 2D textures.

Eric Anholt eric at anholt.net
Tue Aug 23 11:30:00 PDT 2011


On Mon, 22 Aug 2011 16:27:42 -0700, Kenneth Graunke <kenneth at whitecape.org> wrote:
> More combinations are obvious: 1D, 3D, Cube, 1DShadow, 2DShadow,
> CubeShadow, 1DArray, 2DArray, 1DArrayShadow, 2DArrayShadow sampler
> types, as well as NPOT textures, compressed textures...and calling
> textureSize in the vertex shader.
> ---
>  tests/all.tests                                    |    1 +
>  tests/spec/glsl-1.30/CMakeLists.txt                |    1 +
>  tests/spec/glsl-1.30/execution/CMakeLists.gl.txt   |   16 +++
>  tests/spec/glsl-1.30/execution/CMakeLists.txt      |    1 +
>  tests/spec/glsl-1.30/execution/fs-textureSize-2D.c |  111 ++++++++++++++++++++
>  5 files changed, 130 insertions(+), 0 deletions(-)
>  create mode 100644 tests/spec/glsl-1.30/execution/CMakeLists.gl.txt
>  create mode 100644 tests/spec/glsl-1.30/execution/CMakeLists.txt
>  create mode 100644 tests/spec/glsl-1.30/execution/fs-textureSize-2D.c
> 
> diff --git a/tests/all.tests b/tests/all.tests
> index a75a728..bf271bd 100644
> --- a/tests/all.tests
> +++ b/tests/all.tests
> @@ -795,6 +795,7 @@ import_glsl_parser_tests(spec['glsl-1.30'],
>  			 os.path.join(generatedTestDir, 'spec', 'glsl-1.30'),
>  			 ['compiler'])
>  spec['glsl-1.30']['execution'] = Group()
> +add_plain_test(spec['glsl-1.30']['execution'], 'fs-textureSize-2D')
>  add_shader_test_dir(spec['glsl-1.30']['execution'],
>  	            os.path.join(os.path.dirname(__file__), 'spec', 'glsl-1.30', 'execution'),
>  		    recursive=True)
> diff --git a/tests/spec/glsl-1.30/CMakeLists.txt b/tests/spec/glsl-1.30/CMakeLists.txt
> index 4d1c267..6a9b5dd 100644
> --- a/tests/spec/glsl-1.30/CMakeLists.txt
> +++ b/tests/spec/glsl-1.30/CMakeLists.txt
> @@ -1 +1,2 @@
>  add_subdirectory (linker)
> +add_subdirectory (execution)
> diff --git a/tests/spec/glsl-1.30/execution/CMakeLists.gl.txt b/tests/spec/glsl-1.30/execution/CMakeLists.gl.txt
> new file mode 100644
> index 0000000..d8b9e1c
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/execution/CMakeLists.gl.txt
> @@ -0,0 +1,16 @@
> +include_directories(
> +	${GLEXT_INCLUDE_DIR}
> +	${OPENGL_INCLUDE_PATH}
> +	${GLUT_INCLUDE_DIR}
> +	${piglit_SOURCE_DIR}/tests/mesa/util
> +	${piglit_SOURCE_DIR}/tests/util
> +)
> +
> +link_libraries (
> +	piglitutil
> +	${OPENGL_gl_LIBRARY}
> +	${OPENGL_glu_LIBRARY}
> +	${GLUT_glut_LIBRARY}
> +)
> +
> +add_executable (fs-textureSize-2D fs-textureSize-2D.c)
> diff --git a/tests/spec/glsl-1.30/execution/CMakeLists.txt b/tests/spec/glsl-1.30/execution/CMakeLists.txt
> new file mode 100644
> index 0000000..144a306
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/execution/CMakeLists.txt
> @@ -0,0 +1 @@
> +piglit_include_target_api()
> diff --git a/tests/spec/glsl-1.30/execution/fs-textureSize-2D.c b/tests/spec/glsl-1.30/execution/fs-textureSize-2D.c
> new file mode 100644
> index 0000000..5082283
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/execution/fs-textureSize-2D.c
> @@ -0,0 +1,111 @@
> +/*
> + * 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.
> + */
> +
> +/**
> + * \file fs-textureSize.c
> + *
> + * Tests the built-in function textureSize() in the fragment shader.
> + *
> + * Creates a mipmapped 64x32 2D texture and draws a series of squares whose
> + * color contains the width (red) and height (green) of each mipmap level.
> + */
> +#include "piglit-util.h"
> +
> +int piglit_width = 150, piglit_height = 30;
> +int piglit_window_mode = GLUT_RGB | GLUT_DOUBLE;

If you're going to probe RGBA, you need to specify alpha.

Other than that, these two are:

Reviewed-by: Eric Anholt <eric at anholt.net>
-------------- 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/piglit/attachments/20110823/03161303/attachment.pgp>


More information about the Piglit mailing list