[Piglit] [PATCH V2 2/2] arb_arrays_of_arrays: geometry shader tests

Chris Forbes chrisf at ijw.co.nz
Tue Nov 18 21:00:23 PST 2014


This patch is:

Reviewed-by: Chris Forbes <chrisf at ijw.co.nz>

On Wed, Nov 19, 2014 at 5:06 PM, Timothy Arceri <t_arceri at yahoo.com.au> wrote:
> V2: Added Nvidia results to commit message
>
> Test results are from the following hardware/driver combination:
>
> AMD Radeon HD 6670 - Catalyst 13.251 OpenGL 4.3
> Nvidia Geforce GTX 570 - 340.24 OpenGL 4.4
>
> The Nvidia results do not always mean what they are intended
> to (e.g. passing for the wrong reason) as the driver doesn't
> allow multi dimensional arrays of interface blocks even
> though the spec says they are allowed. I've indicated these
> tests with a *
>
> gs-input-sizing-consistent-with-prev-length-blocks.geom
> AMD: pass
> Nvidia: fail*
>
> gs-input-sizing-consistent-with-prev-length.geom
> AMD: pass
> Nvidia: pass
>
> gs-input-sizing-implied-length-blocks.geom
> AMD: pass
> Nvidia: fail
>
> gs-input-sizing-implied-length-consistent-with-prev-usage-blocks.geom
> AMD: pass
> Nvidia: fail*
>
> gs-input-sizing-implied-length-consistent-with-prev-usage.geom
> AMD: pass
> Nvidia: pass
>
> gs-input-sizing-implied-length-inconsistent-with-prev-usage-blocks.geom
> AMD: fail
> Nvidia: pass*
>
> gs-input-sizing-implied-length-inconsistent-with-prev-usage.geom
> AMD: fail
> Nvidia: fail
>
> gs-input-sizing-implied-length.geom
> AMD: pass
> Nvidia: fail
>
> gs-input-sizing-inconsistent-blocks-invalid.geom
> AMD: fail
> Nvidia: pass*
>
> gs-input-sizing-inconsistent-blocks-valid.geom
> AMD: pass
> Nvidia: fail*
>
> gs-input-sizing-inconsistent-invalid.geom
> AMD: fail
> Nvidia: pass
>
> gs-input-sizing-inconsistent-valid.geom
> AMD: pass
> Nvidia: pass
>
> gs-output.geom
> AMD: pass
> Nvidia: fail*
>
> gs-redeclares-pervertex-in-as-array-of-arrays.geom
> AMD: fail
> Nvidia: pass*
>
> gs-redeclares-pervertex-in-as-array-of-arrays2.geom
> AMD: fail
> Nvidia: pass*
>
> Signed-off-by: Timothy Arceri <t_arceri at yahoo.com.au>
> ---
>
>  This is a resend of a patch from July
>
>  Can be tested on mesa using this branch:
>  https://github.com/tarceri/Mesa_arrays_of_arrays/tree/linking3
>
>  These geom shader tests are mainly just tests taken from the glsl 1.50
>  compile tests and extended for arrays of arrays. I've made some
>  assumptions where the spec doesn't provide full detail. As
>  you can see from the results the Nvidia and AMD drivers do not always
>  follow the spec even when it does provide full detail.
>
>  ...-sizing-consistent-with-prev-length-blocks.geom | 40 +++++++++++++++++++
>  ...s-input-sizing-consistent-with-prev-length.geom | 33 ++++++++++++++++
>  .../gs-input-sizing-implied-length-blocks.geom     | 31 +++++++++++++++
>  ...d-length-consistent-with-prev-usage-blocks.geom | 41 ++++++++++++++++++++
>  ...-implied-length-consistent-with-prev-usage.geom | 38 ++++++++++++++++++
>  ...length-inconsistent-with-prev-usage-blocks.geom | 41 ++++++++++++++++++++
>  ...mplied-length-inconsistent-with-prev-usage.geom | 38 ++++++++++++++++++
>  .../compiler/gs-input-sizing-implied-length.geom   | 27 +++++++++++++
>  ...s-input-sizing-inconsistent-blocks-invalid.geom | 37 ++++++++++++++++++
>  .../gs-input-sizing-inconsistent-blocks-valid.geom | 21 ++++++++++
>  .../gs-input-sizing-inconsistent-invalid.geom      | 31 +++++++++++++++
>  .../gs-input-sizing-inconsistent-valid.geom        | 16 ++++++++
>  .../arb_arrays_of_arrays/compiler/gs-output.geom   | 28 ++++++++++++++
>  ...redeclares-pervertex-in-as-array-of-arrays.geom | 45 ++++++++++++++++++++++
>  ...edeclares-pervertex-in-as-array-of-arrays2.geom | 45 ++++++++++++++++++++++
>  15 files changed, 512 insertions(+)
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length-blocks.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-blocks.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage-blocks.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage-blocks.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-invalid.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-valid.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-invalid.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-valid.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-output.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays.geom
>  create mode 100644 tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays2.geom
>
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length-blocks.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length-blocks.geom
> new file mode 100644
> index 0000000..fb2fcff
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length-blocks.geom
> @@ -0,0 +1,40 @@
> +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec
> +// includes the following examples of compile-time errors:
> +//
> +//   // code sequence within one shader...
> +//   in vec4 Color1[];    // size unknown
> +//   ...Color1.length()...// illegal, length() unknown
> +//   in vec4 Color2[2];   // size is 2
> +//   ...Color1.length()...// illegal, Color1 still has no size
> +//   in vec4 Color3[3];   // illegal, input sizes are inconsistent
> +//   layout(lines) in;    // legal, input size is 2, matching (*)
> +//   in vec4 Color4[3];   // illegal, contradicts layout
> +//   ...Color1.length()...// legal, length() is 2, Color1 sized by layout()
> +//   layout(lines) in;    // legal, matches other layout() declaration
> +//   layout(triangles) in;// illegal, does not match earlier layout() declaration
> +//
> +// This test verifies the case marked with (*), namely that no error
> +// results from declaring a geometry shader input layout after
> +// declaraing geometry shader inputs that are either unsized or have a
> +// size consistent with the declared layout.  This test verifies the
> +// case for input interface blocks.
> +//
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +in blk1 {
> +  vec4 Color;
> +} inst1[][2];
> +
> +in blk2 {
> +  vec4 Color;
> +} inst2[2][2];
> +
> +layout(lines) in;
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length.geom
> new file mode 100644
> index 0000000..c0e7b65
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-consistent-with-prev-length.geom
> @@ -0,0 +1,33 @@
> +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec
> +// includes the following examples of compile-time errors:
> +//
> +//   // code sequence within one shader...
> +//   in vec4 Color1[];    // size unknown
> +//   ...Color1.length()...// illegal, length() unknown
> +//   in vec4 Color2[2];   // size is 2
> +//   ...Color1.length()...// illegal, Color1 still has no size
> +//   in vec4 Color3[3];   // illegal, input sizes are inconsistent
> +//   layout(lines) in;    // legal, input size is 2, matching (*)
> +//   in vec4 Color4[3];   // illegal, contradicts layout
> +//   ...Color1.length()...// legal, length() is 2, Color1 sized by layout()
> +//   layout(lines) in;    // legal, matches other layout() declaration
> +//   layout(triangles) in;// illegal, does not match earlier layout() declaration
> +//
> +// This test verifies the case marked with (*), namely that no error
> +// results from declaring a geometry shader input layout after
> +// declaraing geometry shader inputs that are either unsized or have a
> +// size consistent with the declared layout.
> +//
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +in vec4 Color1[][4];
> +in vec4 Color2[2][4];
> +layout(lines) in;
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-blocks.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-blocks.geom
> new file mode 100644
> index 0000000..d35a480
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-blocks.geom
> @@ -0,0 +1,31 @@
> +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec says:
> +//
> +//   All geometry shader input unsized array declarations will be
> +//   sized by an earlier input layout qualifier, when present, as per
> +//   the following table.
> +//
> +// Followed by a table mapping each allowed input layout qualifier to
> +// the corresponding input length.
> +//
> +// This test verifies that if an unsized array declaration follows an
> +// input layout qualifier, the size is implied.  This test verifies
> +// the case for input interface blocks.
> +//
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +layout(lines) in;
> +
> +in blk {
> +  vec4 Color;
> +} inst[][3];
> +
> +uniform int foo[inst.length() == 2 ? 1 : -1];
> +uniform int foo2[inst[1].length() == 3 ? 1 : -1];
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage-blocks.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage-blocks.geom
> new file mode 100644
> index 0000000..2f9c578
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage-blocks.geom
> @@ -0,0 +1,41 @@
> +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec
> +// includes the following examples of compile-time errors:
> +//
> +//   // code sequence within one shader...
> +//   in vec4 Color1[];    // size unknown
> +//   ...Color1.length()...// illegal, length() unknown
> +//   in vec4 Color2[2];   // size is 2
> +//   ...Color1.length()...// illegal, Color1 still has no size
> +//   in vec4 Color3[3];   // illegal, input sizes are inconsistent
> +//   layout(lines) in;    // legal, input size is 2, matching
> +//   in vec4 Color4[3];   // illegal, contradicts layout
> +//   ...Color1.length()...// legal, length() is 2, Color1 sized by layout()
> +//   layout(lines) in;    // legal, matches other layout() declaration
> +//   layout(triangles) in;// illegal, does not match earlier layout() declaration
> +//
> +// This test verifies that when a layout declaration causes a
> +// previously unsized geometry shader input array to become sized, if
> +// an intervening usage of that input array was consistent with the
> +// new size, there is no error.  This test verifies the case for input
> +// interface blocks.
> +//
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +in blk {
> +  vec4 Color;
> +} inst[][6];
> +
> +vec4 foo()
> +{
> +  return inst[2][4].Color;
> +}
> +
> +layout(triangles) in;
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage.geom
> new file mode 100644
> index 0000000..76d54dc
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-consistent-with-prev-usage.geom
> @@ -0,0 +1,38 @@
> +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec
> +// includes the following examples of compile-time errors:
> +//
> +//   // code sequence within one shader...
> +//   in vec4 Color1[];    // size unknown
> +//   ...Color1.length()...// illegal, length() unknown
> +//   in vec4 Color2[2];   // size is 2
> +//   ...Color1.length()...// illegal, Color1 still has no size
> +//   in vec4 Color3[3];   // illegal, input sizes are inconsistent
> +//   layout(lines) in;    // legal, input size is 2, matching
> +//   in vec4 Color4[3];   // illegal, contradicts layout
> +//   ...Color1.length()...// legal, length() is 2, Color1 sized by layout()
> +//   layout(lines) in;    // legal, matches other layout() declaration
> +//   layout(triangles) in;// illegal, does not match earlier layout() declaration
> +//
> +// This test verifies that when a layout declaration causes a
> +// previously unsized geometry shader input array to become sized, if
> +// an intervening usage of that input array was consistent with the
> +// new size, there is no error.
> +//
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +in vec4 Color[][4];
> +
> +vec4 foo()
> +{
> +  return Color[2][3];
> +}
> +
> +layout(triangles) in;
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage-blocks.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage-blocks.geom
> new file mode 100644
> index 0000000..9e9cde3
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage-blocks.geom
> @@ -0,0 +1,41 @@
> +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec
> +// includes the following examples of compile-time errors:
> +//
> +//   // code sequence within one shader...
> +//   in vec4 Color1[];    // size unknown
> +//   ...Color1.length()...// illegal, length() unknown
> +//   in vec4 Color2[2];   // size is 2
> +//   ...Color1.length()...// illegal, Color1 still has no size
> +//   in vec4 Color3[3];   // illegal, input sizes are inconsistent
> +//   layout(lines) in;    // legal, input size is 2, matching
> +//   in vec4 Color4[3];   // illegal, contradicts layout
> +//   ...Color1.length()...// legal, length() is 2, Color1 sized by layout()
> +//   layout(lines) in;    // legal, matches other layout() declaration
> +//   layout(triangles) in;// illegal, does not match earlier layout() declaration
> +//
> +// This test verifies that when a layout declaration causes a
> +// previously unsized geometry shader input array to become sized, if
> +// an intervening usage of that input array wasn't consistent with the
> +// new size, there is an error.  This test verifies the case for input
> +// interface blocks.
> +//
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +in blk {
> +  vec4 Color;
> +} inst[][2];
> +
> +vec4 foo()
> +{
> +  return inst[2][1].Color;
> +}
> +
> +layout(lines) in;
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage.geom
> new file mode 100644
> index 0000000..14cb773
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length-inconsistent-with-prev-usage.geom
> @@ -0,0 +1,38 @@
> +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec
> +// includes the following examples of compile-time errors:
> +//
> +//   // code sequence within one shader...
> +//   in vec4 Color1[];    // size unknown
> +//   ...Color1.length()...// illegal, length() unknown
> +//   in vec4 Color2[2];   // size is 2
> +//   ...Color1.length()...// illegal, Color1 still has no size
> +//   in vec4 Color3[3];   // illegal, input sizes are inconsistent
> +//   layout(lines) in;    // legal, input size is 2, matching
> +//   in vec4 Color4[3];   // illegal, contradicts layout
> +//   ...Color1.length()...// legal, length() is 2, Color1 sized by layout()
> +//   layout(lines) in;    // legal, matches other layout() declaration
> +//   layout(triangles) in;// illegal, does not match earlier layout() declaration
> +//
> +// This test verifies that when a layout declaration causes a
> +// previously unsized geometry shader input array to become sized, if
> +// an intervening usage of that input array wasn't consistent with the
> +// new size, there is an error.
> +//
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +in vec4 Color[][2];
> +
> +vec4 foo()
> +{
> +  return Color[2][1];
> +}
> +
> +layout(lines) in;
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length.geom
> new file mode 100644
> index 0000000..cc8c022
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-implied-length.geom
> @@ -0,0 +1,27 @@
> +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec says:
> +//
> +//   All geometry shader input unsized array declarations will be
> +//   sized by an earlier input layout qualifier, when present, as per
> +//   the following table.
> +//
> +// Followed by a table mapping each allowed input layout qualifier to
> +// the corresponding input length.
> +//
> +// This test verifies that if an unsized array declaration follows an
> +// input layout qualifier, the size is implied.
> +//
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +layout(lines) in;
> +in vec4 Color[][3];
> +
> +uniform int foo[Color.length() == 2 ? 1 : -1];
> +uniform int foo2[Color[1].length() == 3 ? 1 : -1];
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-invalid.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-invalid.geom
> new file mode 100644
> index 0000000..4485c4f
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-invalid.geom
> @@ -0,0 +1,37 @@
> +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec
> +// includes the following examples of compile-time errors:
> +//
> +//   // code sequence within one shader...
> +//   in vec4 Color1[];    // size unknown
> +//   ...Color1.length()...// illegal, length() unknown
> +//   in vec4 Color2[2];   // size is 2
> +//   ...Color1.length()...// illegal, Color1 still has no size
> +//   in vec4 Color3[3];   // illegal, input sizes are inconsistent (*)
> +//   layout(lines) in;    // legal, input size is 2, matching
> +//   in vec4 Color4[3];   // illegal, contradicts layout
> +//   ...Color1.length()...// legal, length() is 2, Color1 sized by layout()
> +//   layout(lines) in;    // legal, matches other layout() declaration
> +//   layout(triangles) in;// illegal, does not match earlier layout() declaration
> +//
> +// This test verifies the case marked with (*), namely that declaring
> +// two geometry shader inputs with different array sizes (for the outer most
> +// dimension) causes a compile error.
> +// This test verifies the case for input interface blocks.
> +//
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +in blk1 {
> +  vec4 Color;
> +} inst2[2][6];
> +
> +in blk2 {
> +  vec4 Color;
> +} inst3[3][6];
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-valid.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-valid.geom
> new file mode 100644
> index 0000000..909b347
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-blocks-valid.geom
> @@ -0,0 +1,21 @@
> +// This test verifies that declaring
> +// two geometry shader inputs with different array sizes only causes a
> +// compile error when the outer most dimension differs.
> +//
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +in blk1 {
> +  vec4 Color;
> +} inst2[2][4];
> +
> +in blk2 {
> +  vec4 Color;
> +} inst3[2][5];
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-invalid.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-invalid.geom
> new file mode 100644
> index 0000000..f2a55dc
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-invalid.geom
> @@ -0,0 +1,31 @@
> +// Section 4.3.8.1 (Input Layout Qualifiers) of the GLSL 1.50 spec
> +// includes the following examples of compile-time errors:
> +//
> +//   // code sequence within one shader...
> +//   in vec4 Color1[];    // size unknown
> +//   ...Color1.length()...// illegal, length() unknown
> +//   in vec4 Color2[2];   // size is 2
> +//   ...Color1.length()...// illegal, Color1 still has no size
> +//   in vec4 Color3[3];   // illegal, input sizes are inconsistent (*)
> +//   layout(lines) in;    // legal, input size is 2, matching
> +//   in vec4 Color4[3];   // illegal, contradicts layout
> +//   ...Color1.length()...// legal, length() is 2, Color1 sized by layout()
> +//   layout(lines) in;    // legal, matches other layout() declaration
> +//   layout(triangles) in;// illegal, does not match earlier layout() declaration
> +//
> +// This test verifies the case marked with (*), namely that declaring
> +// two geometry shader inputs with different array sizes (for the outer most
> +// dimension) causes a compile error.
> +//
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +in vec4 Color2[2][5];
> +in vec4 Color3[3][5];
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-valid.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-valid.geom
> new file mode 100644
> index 0000000..2590af3
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-input-sizing-inconsistent-valid.geom
> @@ -0,0 +1,16 @@
> +// This test verifies that declaring
> +// two geometry shader inputs with different array sizes only causes a
> +// compile error when the outer most dimension differs.
> +//
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +in vec4 Color2[2][4];
> +in vec4 Color3[2][3];
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-output.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-output.geom
> new file mode 100644
> index 0000000..3bb74bf
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-output.geom
> @@ -0,0 +1,28 @@
> +// Verify that geometry shader output arrays of arrays can be declared.
> +//
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +layout(triangles) in;
> +
> +in vec4 v1[3];
> +
> +out vec4 v2[2][4];
> +out blk1 {
> +  out vec4 v3[2][1];
> +};
> +out blk2 {
> +  out vec4 v[2][5];
> +} ifc1;
> +out blk3 {
> +  out vec4 v;
> +} ifc2[2][3];
> +out vec4[3] v4[4];
> +out vec4[2][3] v5;
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays.geom
> new file mode 100644
> index 0000000..3b9c2ac
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays.geom
> @@ -0,0 +1,45 @@
> +// From section 7.1.1 (Compatibility Profile Built-In Language
> +// Variables) of the GLSL 4.10 spec:
> +//
> +//     However, when a built-in interface block with an instance name
> +//     is redeclared (e.g., gl_in), the instance name must be included
> +//     in the redeclaration. It is an error to not include the
> +//     built-in instance name or to change its name.  For example,
> +//
> +//     in gl_PerVertex {
> +//         vec4  gl_ClipVertex;
> +//         vec4  gl_FrontColor;
> +//     } gl_in[];  // must be present and must be "gl_in[]"
> +//
> +// Note: although this text appears in a section referring to
> +// compatibility profile variables, it's clear from context that it's
> +// meant to apply to any redeclaration of gl_in, whether it is done in
> +// a compatibility or a core profile.
> +//
> +// This appears to be a clarification to the behaviour established for
> +// gl_PerVertex by GLSL 1.50, therefore we test it using GLSL version
> +// 1.50.
> +//
> +// In this test, we try redeclaraing the gl_PerVertex input as an
> +// array of arrays.
> +//
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +layout(triangles) in;
> +layout(triangle_strip, max_vertices = 3) out;
> +
> +in gl_PerVertex {
> +  vec4 gl_Position;
> +} gl_in[][6];
> +
> +void main()
> +{
> +}
> diff --git a/tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays2.geom b/tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays2.geom
> new file mode 100644
> index 0000000..6e56703
> --- /dev/null
> +++ b/tests/spec/arb_arrays_of_arrays/compiler/gs-redeclares-pervertex-in-as-array-of-arrays2.geom
> @@ -0,0 +1,45 @@
> +// From section 7.1.1 (Compatibility Profile Built-In Language
> +// Variables) of the GLSL 4.10 spec:
> +//
> +//     However, when a built-in interface block with an instance name
> +//     is redeclared (e.g., gl_in), the instance name must be included
> +//     in the redeclaration. It is an error to not include the
> +//     built-in instance name or to change its name.  For example,
> +//
> +//     in gl_PerVertex {
> +//         vec4  gl_ClipVertex;
> +//         vec4  gl_FrontColor;
> +//     } gl_in[];  // must be present and must be "gl_in[]"
> +//
> +// Note: although this text appears in a section referring to
> +// compatibility profile variables, it's clear from context that it's
> +// meant to apply to any redeclaration of gl_in, whether it is done in
> +// a compatibility or a core profile.
> +//
> +// This appears to be a clarification to the behaviour established for
> +// gl_PerVertex by GLSL 1.50, therefore we test it using GLSL version
> +// 1.50.
> +//
> +// In this test, we try redeclaraing the gl_PerVertex input as an
> +// array of arrays.
> +//
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_arrays_of_arrays
> +// check_link: false
> +// [end config]
> +
> +#version 150
> +#extension GL_ARB_arrays_of_arrays: enable
> +
> +layout(triangles) in;
> +layout(triangle_strip, max_vertices = 3) out;
> +
> +in gl_PerVertex {
> +  vec4 gl_Position;
> +} gl_in[3][6];
> +
> +void main()
> +{
> +}
> --
> 1.9.3
>


More information about the Piglit mailing list