[Piglit] [PATCH] built-in-constants: don't try to create GS with version < 150.

Ian Romanick idr at freedesktop.org
Mon Oct 14 21:44:28 CEST 2013


On 10/12/2013 10:11 AM, Paul Berry wrote:
> Previously, built-in-constants looked at required_glsl_version to
> determine what to include in the "#version" directive, but it looked
> at glsl_version (the maximum version supported by the implementation)
> to decide whether to test geometry shaders.  As a result, it when
> testing a built-in constant whose required_glsl_version was less than
> 150, it would try to create a geometry shader using a "#version"
> directive less than 150, leading to GL errors.
> 
> This patch prevents the problem by only testing geometry shaders when
> required_glsl_version >= 150.

It's actually even more broken than that. :(  Sorry about that.

If required_glsl_version or glsl_version is 300 (for OpenGL ES 3.0), it
will also try to create a geometry shader.

How about

    if (required_glsl_version >= 150 && required_glsl_version != 300)

instead?

> ---
>  tests/shaders/built-in-constants.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/tests/shaders/built-in-constants.c b/tests/shaders/built-in-constants.c
> index 06850b5..3a2a784 100644
> --- a/tests/shaders/built-in-constants.c
> +++ b/tests/shaders/built-in-constants.c
> @@ -350,7 +350,7 @@ piglit_init(int argc, char **argv)
>  	test_vs = glCreateShader(GL_VERTEX_SHADER);
>  	test_fs = glCreateShader(GL_FRAGMENT_SHADER);
>  
> -	if (glsl_version >= 150)
> +	if (required_glsl_version >= 150)
>  		test_gs = glCreateShader(GL_GEOMETRY_SHADER);
>  
>  	for (i = 0; i < num_tests; i++) {
> 



More information about the Piglit mailing list