[Piglit] [PATCH 1/4] Test intrastage interface block array matching rules.

Ian Romanick idr at freedesktop.org
Wed Nov 6 14:32:22 PST 2013


Patches 1 and 2 are:

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

I'm sending some comments about the other two.

On 10/30/2013 02:27 PM, Paul Berry wrote:
> Note: as of Mesa 5cb80f0, test "intrastage-interface-unnamed-array" is
> known to fail.
> ---
>  ...ge-interface-arrays-unmatched-sizes.shader_test | 42 +++++++++++++++++++
>  .../intrastage-interface-named-array.shader_test   | 47 ++++++++++++++++++++++
>  .../intrastage-interface-unnamed-array.shader_test | 47 ++++++++++++++++++++++
>  3 files changed, 136 insertions(+)
>  create mode 100644 tests/spec/glsl-1.50/linker/intrastage-interface-arrays-unmatched-sizes.shader_test
>  create mode 100644 tests/spec/glsl-1.50/linker/intrastage-interface-named-array.shader_test
>  create mode 100644 tests/spec/glsl-1.50/linker/intrastage-interface-unnamed-array.shader_test
> 
> diff --git a/tests/spec/glsl-1.50/linker/intrastage-interface-arrays-unmatched-sizes.shader_test b/tests/spec/glsl-1.50/linker/intrastage-interface-arrays-unmatched-sizes.shader_test
> new file mode 100644
> index 0000000..b1f60fc
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/intrastage-interface-arrays-unmatched-sizes.shader_test
> @@ -0,0 +1,42 @@
> +# From the GLSL 1.50 spec, section 4.3.7 (Interface Blocks):
> +#
> +#     Matched block names within an interface (as defined above) must
> +#     match in terms of having the same number of declarations with
> +#     the same sequence of types and the same sequence of member
> +#     names, as well as having the same member-wise layout
> +#     qualification (see next section). Furthermore, if a matching
> +#     block is declared as an array, then the array sizes must also
> +#     match (or follow array matching rules for the interface between
> +#     a vertex and a geometry shader).
> +#
> +# This test verifies that a link error is generated if intrastage
> +# array sizes don't match.
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +out blk {
> +  vec4 foo;
> +} inst[2];
> +
> +void f()
> +{
> +  inst[1].foo = vec4(1.0);
> +}
> +
> +[vertex shader]
> +out blk {
> +  vec4 foo;
> +} inst[3];
> +
> +void f();
> +
> +void main()
> +{
> +  f();
> +  inst[2].foo = vec4(1.0);
> +}
> +
> +[test]
> +link error
> diff --git a/tests/spec/glsl-1.50/linker/intrastage-interface-named-array.shader_test b/tests/spec/glsl-1.50/linker/intrastage-interface-named-array.shader_test
> new file mode 100644
> index 0000000..a8ef627
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/intrastage-interface-named-array.shader_test
> @@ -0,0 +1,47 @@
> +# From the GLSL 1.50 spec, section 4.3.7 (Interface Blocks):
> +#
> +#     Matched block names within an interface (as defined above) must
> +#     match in terms of having the same number of declarations with
> +#     the same sequence of types and the same sequence of member
> +#     names, as well as having the same member-wise layout
> +#     qualification (see next section). Furthermore, if a matching
> +#     block is declared as an array, then the array sizes must also
> +#     match (or follow array matching rules for the interface between
> +#     a vertex and a geometry shader).
> +#
> +# Although it's not explicitly stated, it's clear that when doing
> +# intrastage linking, interface block arrays can only match other
> +# interface block arrays.
> +#
> +# This test verifies that a link error occurs if we try to do
> +# intrastage linking of a named interface block to an interface block
> +# array.
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +out blk {
> +  vec4 foo;
> +} inst;
> +
> +void f()
> +{
> +  inst.foo = vec4(1.0);
> +}
> +
> +[vertex shader]
> +out blk {
> +  vec4 foo;
> +} inst[3];
> +
> +void f();
> +
> +void main()
> +{
> +  f();
> +  inst[2].foo = vec4(1.0);
> +}
> +
> +[test]
> +link error
> diff --git a/tests/spec/glsl-1.50/linker/intrastage-interface-unnamed-array.shader_test b/tests/spec/glsl-1.50/linker/intrastage-interface-unnamed-array.shader_test
> new file mode 100644
> index 0000000..1dee998
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/intrastage-interface-unnamed-array.shader_test
> @@ -0,0 +1,47 @@
> +# From the GLSL 1.50 spec, section 4.3.7 (Interface Blocks):
> +#
> +#     Matched block names within an interface (as defined above) must
> +#     match in terms of having the same number of declarations with
> +#     the same sequence of types and the same sequence of member
> +#     names, as well as having the same member-wise layout
> +#     qualification (see next section). Furthermore, if a matching
> +#     block is declared as an array, then the array sizes must also
> +#     match (or follow array matching rules for the interface between
> +#     a vertex and a geometry shader).
> +#
> +# Although it's not explicitly stated, it's clear that when doing
> +# intrastage linking, interface block arrays can only match other
> +# interface block arrays.
> +#
> +# This test verifies that a link error occurs if we try to do
> +# intrastage linking of an unnamed interface block to an interface
> +# block array.
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +out blk {
> +  vec4 foo;
> +};
> +
> +void f()
> +{
> +  foo = vec4(1.0);
> +}
> +
> +[vertex shader]
> +out blk {
> +  vec4 foo;
> +} inst[3];
> +
> +void f();
> +
> +void main()
> +{
> +  f();
> +  inst[2].foo = vec4(1.0);
> +}
> +
> +[test]
> +link error
> 



More information about the Piglit mailing list