[Piglit] [PATCH 3/4] GS: Test geometry output layout qualifier rules

Paul Berry stereotype441 at gmail.com
Mon Sep 30 13:53:36 PDT 2013


On 16 September 2013 09:35, Nicholas Mack <nichmack at gmail.com> wrote:

> ---
>  ...ayout-only-one-out-declaration-per-program.geom | 22
> ++++++++++++++++++++++
>  .../compiler/layout-out-only-output-qualifier.geom | 22
> ++++++++++++++++++++++
>  .../compiler/layout-out-order-irrelevant.geom      | 21
> +++++++++++++++++++++
>  3 files changed, 65 insertions(+)
>  create mode 100644
> tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program.geom
>  create mode 100644
> tests/spec/glsl-1.50/compiler/layout-out-only-output-qualifier.geom
>  create mode 100644
> tests/spec/glsl-1.50/compiler/layout-out-order-irrelevant.geom
>
> diff --git
> a/tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program.geom
> b/tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program.geom
> new file mode 100644
> index 0000000..d7439e1
> --- /dev/null
> +++
> b/tests/spec/glsl-1.50/compiler/layout-only-one-out-declaration-per-program.geom
> @@ -0,0 +1,22 @@
> +// [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:
> +// "All geometry shader output layout declarations in a program must
> declare the
> +//  same layout and same value for max_vertices."
> +
> +#version 150
> +
> +layout(lines) in;
> +layout(line_strip, max_vertices=2) out;
> +
> +in vec4 pos[];
> +
> +layout(triangle_strip, max_vertices=3) out;
>

As written, this test will only fail if the implementation fails to check
for mismatches in both output primitive type *and* max_vertices.  We need
to make two separate tests, one to check that conflicting output primitive
type causes a compiler error, and the other to check that conflicting
max_vertices causes a compile error.


> +
> +void main()
> +{
> +}
> diff --git
> a/tests/spec/glsl-1.50/compiler/layout-out-only-output-qualifier.geom
> b/tests/spec/glsl-1.50/compiler/layout-out-only-output-qualifier.geom
> new file mode 100644
> index 0000000..37533d4
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/layout-out-only-output-qualifier.geom
> @@ -0,0 +1,22 @@
> +// [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:
> +// "Geometry shaders can have output layout qualifiers only on the
> interface
> +//  qualifier out, not on an output block or variable declaration.  The
> layout
> +//  qualifier identifiers for geometry shader outputs are
> +//     points
> +//     line_strip
> +//     triangle_strip
> +//     max_vertices = integer-constant"
> +
> +#version 150
> +
> +layout(lines_adjacency) out;
> +
> +void main()
> +{
> +}
> diff --git
> a/tests/spec/glsl-1.50/compiler/layout-out-order-irrelevant.geom
> b/tests/spec/glsl-1.50/compiler/layout-out-order-irrelevant.geom
> new file mode 100644
> index 0000000..603e175
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/layout-out-order-irrelevant.geom
> @@ -0,0 +1,21 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// check_link: true
> +// [end config]
> +//
> +// Section 4.3.8 (Layout Qualifiers) of the GLSL 1.50 spec says:
> +// "The tokens in any layout-qualifier-id-list are identifiers, not
> keywords.
> +//  Generally, they can be listed in any order."
> +//
> +// Section 4.3.8.2(Output Layout Qualifiers) of the GLSL 1.50 spec says:
> +// "One declaration can declare either a primitive type (points,
> line_strip, or
> +//  triangle_strip), or max_vertices, or both."
> +
> +#version 150
> +
> +layout(max_vertices = 3, triangle_strip) out;
>

This test needs an input layout declaration (e.g. "layout(points) in;")
otherwise it won't link successfully.


> +
> +void main()
> +{
> +}
> --
> 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/20130930/f5858693/attachment.html>


More information about the Piglit mailing list