[Piglit] [PATCH] GLSL 1.50: Test that superfluous declarations of output variables is allowed

Paul Berry stereotype441 at gmail.com
Thu Aug 8 15:44:15 PDT 2013


On 6 August 2013 10:37, Nicholas Mack <nichmack at gmail.com> wrote:

> ---
>  .../glsl-1.50/linker/unused-outputs.shader_test    | 48
> ++++++++++++++++++++++
>  1 file changed, 48 insertions(+)
>  create mode 100644 tests/spec/glsl-1.50/linker/unused-outputs.shader_test
>

Since this test actually performs drawing, it should go in the "execution"
directory.

With that changed, this patch is:

Reviewed-by: Paul Berry <stereotype441 at gmail.com>


>
> diff --git a/tests/spec/glsl-1.50/linker/unused-outputs.shader_test
> b/tests/spec/glsl-1.50/linker/unused-outputs.shader_test
> new file mode 100644
> index 0000000..ed44d60
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/unused-outputs.shader_test
> @@ -0,0 +1,48 @@
> +# Test that superfluous declarations are allowed
> +#
> +# GLSLangSpec.1.50, 4.3.6 ():
> +# "Only output variables that are read by the subsequent pipeline stage
> need
> +#  to be written; it is allowed to have superfluous declarations of output
> +#  variables."
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +#version 150
> +
> +in vec4 vertex;
> +
> +out float a;
> +out float b;
> +out vec2 c;
> +
> +void main()
> +{
> +       a = 3.0;
> +       b = 1.0;
> +       gl_Position = vertex;
> +}
> +
> +[fragment shader]
> +#version 150
> +
> +in float b;
> +in vec2 c;
> +
> +void main()
> +{
> +       gl_FragColor = vec4(0.0, b, 0.0, 1.0);
> +}
> +
> +[vertex data]
> +vertex/float/2
> +-1.0 -1.0
> + 1.0 -1.0
> + 1.0  1.0
> +-1.0  1.0
> +
> +[test]
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgba 0.0 1.0 0.0 1.0
> +
> --
> 1.8.3.1
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130808/00de6d92/attachment.html>


More information about the Piglit mailing list