[Piglit] [PATCH] glsl-1.30/sampler-bug: test an existing GLSL or st/mesa compiler bug

Timothy Arceri t_arceri at yahoo.com.au
Mon Oct 19 19:11:53 PDT 2015


On Sat, 2015-10-10 at 14:19 +0200, Marek Olšák wrote:
> From: Marek Olšák <marek.olsak at amd.com>
> 
> ---
>  .../spec/glsl-1.30/linker/sampler-bug.shader_test  | 37
> ++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
>  create mode 100644 tests/spec/glsl-1.30/linker/sampler
> -bug.shader_test
> 
> diff --git a/tests/spec/glsl-1.30/linker/sampler-bug.shader_test
> b/tests/spec/glsl-1.30/linker/sampler-bug.shader_test
> new file mode 100644
> index 0000000..8a88343
> --- /dev/null
> +++ b/tests/spec/glsl-1.30/linker/sampler-bug.shader_test
> @@ -0,0 +1,37 @@
> +# This reproduces a bug in the GLSL compiler or st/mesa.
> +# The shaders can't be simplified more.
> +
> +[require]
> +GLSL >= 1.30
> +
> +[vertex shader]
> +#version 130
> +
> +in vec4 pos;
> +
> +void main()
> +{
> +	gl_Position = pos;
> +}
> +
> +[fragment shader]
> +#version 130
> +
> +struct light
> +{
> +	vec3 diffuse;
> +};
> +
> +uniform light u_DynamicLights[8];
> +uniform sampler2D tex1;
> +uniform sampler2D tex2;
> +uniform sampler2D tex3;

I see this has already been committed. I meant to give some feedback
earlier but a more thorough test for this bug would have been simply.

uniform light u_DynamicLights[GL_MAX_TEXTURE_IMAGE_UNITS];
uniform sampler2D tex1;


void main()
{
	int i = 0;
	gl_FragColor = u_DynamicLights[i].diffuse.xyzz + texture(tex1,
gl_FragCoord.xy);

}

Anyway not sure if you care enough to fix it but just thought I'd point
it out.

> +
> +void main()
> +{
> +	int i = 0;
> +	gl_FragColor = u_DynamicLights[i].diffuse.xyzz +
> +		       texture(tex1, gl_FragCoord.xy) +
> +		       texture(tex2, gl_FragCoord.xy) +
> +		       texture(tex3, gl_FragCoord.xy);
> +}


More information about the Piglit mailing list