[Piglit] [PATCH] Add test to verify GL errors in glGenerateMipmap

Eric Anholt eric at anholt.net
Mon Nov 12 16:33:37 PST 2012


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

> It does error checking for glGenerateMipmap() with various texture internal
> formats.
>
> Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>


> +PIGLIT_GL_TEST_CONFIG_END
> +
> +/**
> + * Test textures having integer internalFormat with glGenerateMipmap to
> + * verify that GL_INVALID_OPERATION is thrown by the implementation.
> + */

"integer or depth/stencil"?

> +		/* Packed depth / stencil formats */
> +		{ GL_DEPTH24_STENCIL8, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8,
> +		  {NULL, NULL} }

GL_DEPTH32F_STENCIL8 from ARB_depth_buffer_float too?

> +	glGenTextures(1, &tex);
> +	glBindTexture(GL_TEXTURE_2D, tex);
> +
> +	for (i = 0; i < ARRAY_SIZE(formats); i++) {
> +
> +		bool is_ext_supported = true;
> +		for(j = 0; j < ARRAY_SIZE(formats[i].extension); j++) {
> +			if((formats[i].extension[j] != NULL) &&
> +			   !piglit_is_extension_supported(formats[i].extension[j]))
> +			{
> +				printf("Skipping %s\n",
> +				piglit_get_gl_enum_name(formats[i].intFormat));
> +				is_ext_supported = false;
> +			}
> +		}
> +		if (!is_ext_supported)
> +			continue;
> +
> +		while (glGetError() != GL_NO_ERROR)
> +			;

This is also known as piglit_reset_gl_error(), but I don't see there
being any need for it, since the only previous GL call is either
glBindTexture or piglit_check_gl_error().

> +		glTexImage2D(GL_TEXTURE_2D, 0, formats[i].intFormat,
> +			     16, 16, 0,
> +			     formats[i].srcFormat, formats[i].srcType, NULL);
> +
> +		pass = piglit_check_gl_error(GL_NO_ERROR) && pass;
> +		glGenerateMipmap(GL_TEXTURE_2D);
> +		pass = piglit_check_gl_error(GL_INVALID_OPERATION) && pass;
> +	}


> +/**
> + * Test textures having non-integer / non-depth-stencil internalFormat with
> + * glGenerateMipmap to verify that no error is thrown by the implementation.
> + */

Given that we have a ton of other tests hitting these cases, I don't see
a need for that in this testcase.

-------------- 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/20121112/112e4caa/attachment.pgp>


More information about the Piglit mailing list