[Piglit] [PATCH] glslparsertest: Also call glLinkShader on shaders that compiled.

Ian Romanick idr at freedesktop.org
Thu Jun 16 11:38:05 PDT 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/15/2011 08:51 AM, Eric Anholt wrote:
> This doesn't impact the piglit results (since the shaders are not
> categorized according to whether they're expected to link, and many
> aren't), unless glLinkShader happens to cause a crash.  However, doing
> this increases coverage of the shader linking code, and also means
> that glslparsertest can be used in analysis using shader-db.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

> ---
>  tests/glslparsertest/glslparsertest.c |   17 +++++++++++++++++
>  1 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/tests/glslparsertest/glslparsertest.c b/tests/glslparsertest/glslparsertest.c
> index 6a20a0d..a1c3913 100644
> --- a/tests/glslparsertest/glslparsertest.c
> +++ b/tests/glslparsertest/glslparsertest.c
> @@ -173,6 +173,23 @@ test(void)
>  		}
>  	}
>  
> +	/* Try linking the shader if it compiled.  We don't care about
> +	 * the success or failure of linking for the purposes of
> +	 * parser tests, we're just trying to increase coverage of
> +	 * that code.  It also means that drivers that do a compile at
> +	 * link time (to determine limits) get a chance to expose
> +	 * their codegen to the parser tests, even if we don't ever
> +	 * execute it.
> +	 */
> +	if (ok) {
> +		GLuint shader_prog;
> +
> +		shader_prog = piglit_CreateProgram();
> +		piglit_AttachShader(shader_prog, prog);
> +		piglit_LinkProgram(shader_prog);
> +		piglit_DeleteProgram(shader_prog);
> +	}
> +
>  	if (size != 0)
>  		free(info);
>  	free(prog_string);

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org/

iEYEARECAAYFAk36TY0ACgkQX1gOwKyEAw89vwCgg/tVqs5gJ+RiDuZ6g+GPhxUu
l+oAoItuRkKXGS7lcN/NvdCK7G1RoMLb
=ts+F
-----END PGP SIGNATURE-----


More information about the Piglit mailing list