[Piglit] [PATCH] ARB_texture_view: Add multisample texture target testing

Brian Paul brianp at vmware.com
Mon Nov 11 09:16:10 PST 2013


On 11/08/2013 01:40 PM, Jon Ashburn wrote:
> The "targets"  test is extended to include testing of
> GL_TEXTURE_2D_MULTISAMPLE and GL_TEXTURE_2D_MULTISAMPLE_ARRAY.
> This will test making valid and invalid texture views of these two
> multisample targets and ensuring the correct GL error is set.
> ---
>   tests/spec/arb_texture_view/targets.c | 28 +++++++++++++++++++++++++---
>   1 file changed, 25 insertions(+), 3 deletions(-)
>
> diff --git a/tests/spec/arb_texture_view/targets.c b/tests/spec/arb_texture_view/targets.c
> index 2c2e5c5..18ea5aa 100644
> --- a/tests/spec/arb_texture_view/targets.c
> +++ b/tests/spec/arb_texture_view/targets.c
> @@ -96,7 +96,6 @@ test_target_errors(GLenum target)
>   	GLenum legalTargets[4];
>   	unsigned int numTargets;
>   	GLenum illegalTargets[] = {
> -		/* skip multisample */
>   		GL_TEXTURE_1D,
>   		GL_TEXTURE_2D,
>   		GL_TEXTURE_3D,
> @@ -105,6 +104,8 @@ test_target_errors(GLenum target)
>   		GL_TEXTURE_1D_ARRAY,
>   		GL_TEXTURE_2D_ARRAY,
>   		GL_TEXTURE_CUBE_MAP_ARRAY,
> +		GL_TEXTURE_2D_MULTISAMPLE,
> +		GL_TEXTURE_2D_MULTISAMPLE_ARRAY
>   	};
>
>   	glGenTextures(1, &tex);   /* orig tex */
> @@ -113,8 +114,7 @@ test_target_errors(GLenum target)
>   	switch (target) {
>   	case GL_TEXTURE_1D:
>   		glTexStorage1D(target, levels, GL_RGBA8, width);
> -		numTargets = 2;
> -		update_valid_arrays(legalTargets, illegalTargets,
> +		numTargets = update_valid_arrays(legalTargets, illegalTargets,
>   				    ARRAY_SIZE(illegalTargets),
>   				    GL_TEXTURE_1D, GL_TEXTURE_1D_ARRAY, 0);
>   		break;
> @@ -161,6 +161,22 @@ test_target_errors(GLenum target)
>   				    GL_TEXTURE_2D_ARRAY,
>   				    GL_TEXTURE_CUBE_MAP_ARRAY, 0);
>   		break;
> +	case GL_TEXTURE_2D_MULTISAMPLE:
> +		glTexStorage2DMultisample(target, 2, GL_RGBA8, width, height,
> +					  GL_TRUE);
> +		numTargets = update_valid_arrays(legalTargets, illegalTargets,
> +				    ARRAY_SIZE(illegalTargets),
> +				    GL_TEXTURE_2D_MULTISAMPLE,
> +				    GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 0);
> +		break;
> +	case GL_TEXTURE_2D_MULTISAMPLE_ARRAY:
> +		glTexStorage3DMultisample(target, 4, GL_RGBA8, width, height,
> +					  depth, GL_TRUE);
> +		numTargets = update_valid_arrays(legalTargets, illegalTargets,
> +				    ARRAY_SIZE(illegalTargets),
> +				    GL_TEXTURE_2D_MULTISAMPLE,
> +				    GL_TEXTURE_2D_MULTISAMPLE_ARRAY, 0);
> +		break;
>   	default:
>   		assert(0);
>   		break;
> @@ -212,6 +228,8 @@ piglit_init(int argc, char **argv)
>   	piglit_require_extension("GL_ARB_texture_cube_map_array");
>   	piglit_require_extension("GL_EXT_texture_array");
>   	piglit_require_extension("GL_ARB_texture_rectangle");
> +	piglit_require_extension("GL_ARB_texture_storage_multisample");

Could you make the dependency optional?

In update_valid_arrays() could you disable the multisample texture 
targets if GL_ARB_texture_storage_multisample isn't supported.

I have a feeling we'll have ARB_texture_view before we have 
ARB_texture_storage_multisample in the gallium drivers.

-Brian



More information about the Piglit mailing list