[Piglit] [PATCH 4/4] Tests that a struct cannot be defined within a block.

Matt Turner mattst88 at gmail.com
Tue Jul 30 13:53:44 PDT 2013


On Mon, Jul 29, 2013 at 3:25 PM, Nicholas Mack <nichmack at gmail.com> wrote:
> GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> "structure definitions cannot be nested inside a block"
> ---
>  ...erface-blocks-structs-defined-within-block.vert | 27 ++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>  create mode 100644 tests/spec/glsl-1.50/compiler/interface-blocks-structs-defined-within-block.vert
>
> diff --git a/tests/spec/glsl-1.50/compiler/interface-blocks-structs-defined-within-block.vert b/tests/spec/glsl-1.50/compiler/interface-blocks-structs-defined-within-block.vert
> new file mode 100644
> index 0000000..cb1b07c
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/compiler/interface-blocks-structs-defined-within-block.vert
> @@ -0,0 +1,27 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// check_link: true
> +// [end config]
> +//
> +// Tests that a struct cannot be defined within a block.
> +//
> +// GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +// "structure definitions cannot be nested inside a block"
> +
> +#version 150
> +
> +out block {
> +       struct test_struct {
> +               int a;
> +               float b;
> +       } c;
> +       test_struct d;

We're actually testing two different things here. One, that we can
nest a structure definition; and two, that we can declare a structure
type and use that declaration all inside the uniform block.

Since we fail this test currently, it'd probably be good to separate
it into two tests.


More information about the Piglit mailing list