On 6 August 2013 10:29, Nicholas Mack <[email protected]> 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 <[email protected]>
_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit