[Piglit] [PATCH] glsl-1.50: add linker test for unused in out blocks

Ian Romanick idr at freedesktop.org
Wed May 31 19:42:05 UTC 2017


On 05/30/2017 07:23 AM, Józef Kucia wrote:
> This test exposes a Mesa GLSL linker bug. The test fails with the

Is there a bugzilla for this issue?  Was this encountered in a app or ... ?

> following error message:
> 
>   error: Input block `blk' is not an output of the previous stage
> 
> Section 4.3.4 (Inputs) of the GLSL 1.50 spec says:
> 
>     "Only the input variables that are actually read need to be written
>     by the previous stage; it is allowed to have superfluous
>     declarations of input variables."

There are some additional rules for separate shader objects programs,
and it sounds like we may be applying them too broadly.

> ---
>  .../interstage-multiple-shader-objects.shader_test | 38 ++++++++++++++++++++++
>  1 file changed, 38 insertions(+)
>  create mode 100644 tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test
> 
> diff --git a/tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test b/tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test
> new file mode 100644
> index 0000000..66a46d5
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/interstage-multiple-shader-objects.shader_test
> @@ -0,0 +1,38 @@
> +# Exercises a Mesa GLSL linker bug.
> +#
> +# Note that the output block is not used and it is not declared in the main
> +# shader object.
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +out blk {
> +  vec4 foo;
> +} inst;
> +
> +void set_output(vec4 v)
> +{
> +  gl_Position = v;
> +}
> +
> +[vertex shader]

Are there supposed to be two vertex shaders?  Is that necessary to
reproduce the link failure?

> +void set_output(vec4 v);
> +
> +void main()
> +{
> +  set_output(vec4(1.0));
> +}
> +
> +[fragment shader]
> +in blk {
> +  vec4 foo;
> +} inst;
> +
> +void main()
> +{
> +  gl_FragColor = vec4(1.0);
> +}
> +
> +[test]
> +link success
> 



More information about the Piglit mailing list