[Piglit] [PATCH] Skip testing textures with depth-stencil formats in glGenerateMipmap

Eric Anholt eric at anholt.net
Tue Nov 6 11:00:22 PST 2012


Anuj Phogat <anuj.phogat at gmail.com> writes:

> depth-stencil formats are disallowed in glGenerateMipmap because the
> stencil component is not filterable.
>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
> ---
>  tests/fbo/fbo-generatemipmap-formats.c |   41 +++++++++++++++++++++++++++----
>  1 files changed, 35 insertions(+), 6 deletions(-)
>
> diff --git a/tests/fbo/fbo-generatemipmap-formats.c b/tests/fbo/fbo-generatemipmap-formats.c
> index a83a266..821e607 100644
> --- a/tests/fbo/fbo-generatemipmap-formats.c
> +++ b/tests/fbo/fbo-generatemipmap-formats.c
> @@ -450,6 +450,7 @@ test_format(const struct format_desc *format, GLenum basetype)
>  enum piglit_result
>  piglit_display(void)
>  {
> +	struct format_desc format;
>  	GLboolean pass = GL_TRUE;
>  	int i;
>  	(void)fbo_formats_display;
> @@ -459,20 +460,48 @@ piglit_display(void)
>  
>  	if (piglit_automatic) {
>  		for (i = 0; i < test_sets[test_index].num_formats; i++) {
> -			pass = test_format(&test_sets[test_index].format[i],
> -					   test_sets[test_index].basetype) && pass;
> +			format = test_sets[test_index].format[i];
> +			if (format.base_internal_format != GL_DEPTH_STENCIL)
> +			{
> +				pass =
> +				test_format(&test_sets[test_index].format[i],
> +					    test_sets[test_index].basetype)
> +					    && pass;
> +			}
> +			else
> +				/* Textures with depth-stencil internal format
> +				 * are not allowed in glGenerateMipmap.
> +				 */
> +				printf("Skipped testing %s\n",
> +				piglit_get_gl_enum_name(format.internalformat));

Instead of indenting even more (and forgetting to indent the
continuation line with test_format()), you can just:

/* mipmap generation with stencil index is unsupported. */
if (format.base_internal_format == GL_DEPTH_STENCIL)
        continue;
-------------- 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/20121106/a070a38e/attachment.pgp>


More information about the Piglit mailing list