[Piglit] [PATCH 2/4] GLSL 1.50: Test that vertex cant have input/output layouts and frag shader cant have output layouts

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


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

> Three tests: Vertex input, vertex output, fragment output
>

The commit subject is a little long.  I'd recommend something like "GLSL
1.50: test disallowed layouts in VS and FS".


> ---
>  tests/spec/glsl-1.50/compiler/layout-fs-no-output.frag | 17
> +++++++++++++++++
>  tests/spec/glsl-1.50/compiler/layout-vs-no-input.vert  | 17
> +++++++++++++++++
>  tests/spec/glsl-1.50/compiler/layout-vs-no-output.vert | 17
> +++++++++++++++++
>  3 files changed, 51 insertions(+)
>  create mode 100644 tests/spec/glsl-1.50/compiler/layout-fs-no-output.frag
>  create mode 100644 tests/spec/glsl-1.50/compiler/layout-vs-no-input.vert
>  create mode 100644 tests/spec/glsl-1.50/compiler/layout-vs-no-output.vert
>
> diff --git a/tests/spec/glsl-1.50/compiler/layout-fs-no-output.frag
> b/tests/spec/glsl-1.50/compiler/layout-fs-no-output.frag
> new file mode 100644
> index 0000000..39e0862
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/layout-fs-no-output.frag
> @@ -0,0 +1,17 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// check_link: true
> +// [end config]
> +//
> +// Section 4.3.8.2(Output Layout Qualifiers) of the GLSL 1.50 spec says:
> +// "Vertex and fragment shaders cannot have output layout qualifiers."
> +
> +#version 150
> +
> +layout(origin_upper_left) out vec4 b;
>

This declaration wouldn't be valid in any type of shader.  To make sure
that the implementation is performing the proper check, I'd recommend using
an output layout specifier that would be allowed in a geometry shader, such
as:

layout(points) out;


> +
> +void main()
> +{
> +       gl_FragColor = vec4(0., 1., 0., 1.);
> +}
> diff --git a/tests/spec/glsl-1.50/compiler/layout-vs-no-input.vert
> b/tests/spec/glsl-1.50/compiler/layout-vs-no-input.vert
> new file mode 100644
> index 0000000..bb7958d
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/layout-vs-no-input.vert
> @@ -0,0 +1,17 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// check_link: true
> +// [end config]
> +//
> +// Section 4.3.8.1(Input Layout Qualifiers) of the GLSL 1.50 spec says:
> +// "Vertex shaders do not have any input layout qualifiers."
> +
> +#version 150
> +
> +layout(pixel_center_integer) in vec4 b;
>

Similarly, this should be something like:

layout(points) in;


> +
> +void main()
> +{
> +       gl_Position = b;
> +}
> diff --git a/tests/spec/glsl-1.50/compiler/layout-vs-no-output.vert
> b/tests/spec/glsl-1.50/compiler/layout-vs-no-output.vert
> new file mode 100644
> index 0000000..a98a3b3
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/layout-vs-no-output.vert
> @@ -0,0 +1,17 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// check_link: true
> +// [end config]
> +//
> +// Section 4.3.8.2(Output Layout Qualifiers) of the GLSL 1.50 spec says:
> +// "Vertex and fragment shaders cannot have output layout qualifiers."
> +
> +#version 150
> +
> +layout(origin_upper_left) out vec4 b;
>

And this should be something like

layout(points) out;


> +
> +void main()
> +{
> +       b = vec4(2.);
> +}
> --
> 1.8.3.1
>
>
With those changes, this patch is:

Reviewed-by: Paul Berry <stereotype441 at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/piglit/attachments/20130808/70c1d432/attachment.html>


More information about the Piglit mailing list