[5/7] arb_enhanced_layouts: Multiple layout qualifiers in a single declaration tests

Submitted by Andres Gomez on Oct. 22, 2016, 8:42 p.m.

Details

Message ID 20161022204226.31193-6-agomez@igalia.com
State Superseded
Headers show
Series "More duplicated layout-qualifier-names tests" ( rev: 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Andres Gomez Oct. 22, 2016, 8:42 p.m.
We already had tests for a repeated layout-qualifier-name in a single
layout-qualifier. Now, we also add similar tests to check across
multiple layout-qualifiers in the same declaration.

From the ARB_enhanced_layouts spec:

    "More than one layout qualifier may appear in a single declaration.
     Additionally, the same layout-qualifier-name can occur multiple times
     within a layout qualifier or across multiple layout qualifiers in the
     same declaration"

Signed-off-by: Andres Gomez <agomez@igalia.com>
---
 ...-in-single-declaration-no-enhanced-layouts.vert | 22 +++++++++++++++++
 ...location-identifiers-in-single-declaration.vert | 23 ++++++++++++++++++
 ...gle-declaration-global-no-enhanced-layouts.geom | 27 +++++++++++++++++++++
 ...ifiers-in-single-declaration-layout-global.geom | 28 ++++++++++++++++++++++
 ...-in-single-declaration-no-enhanced-layouts.geom | 25 +++++++++++++++++++
 ...e-stream-identifiers-in-single-declaration.geom | 26 ++++++++++++++++++++
 6 files changed, 151 insertions(+)
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-location-identifiers-in-single-declaration-no-enhanced-layouts.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-location-identifiers-in-single-declaration.vert
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration-global-no-enhanced-layouts.geom
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration-layout-global.geom
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration-no-enhanced-layouts.geom
 create mode 100644 tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration.geom

Patch hide | download patch | download mbox

diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-location-identifiers-in-single-declaration-no-enhanced-layouts.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-location-identifiers-in-single-declaration-no-enhanced-layouts.vert
new file mode 100644
index 0000000..3e1827e
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-location-identifiers-in-single-declaration-no-enhanced-layouts.vert
@@ -0,0 +1,22 @@ 
+// [config]
+// expect_result: fail
+// glsl_version: 1.40
+// require_extensions: GL_ARB_separate_shader_objects
+// check_link: false
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration"
+
+#version 140
+#extension GL_ARB_separate_shader_objects : enable
+
+layout(location=2) layout(location=1) out vec3 var;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-location-identifiers-in-single-declaration.vert b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-location-identifiers-in-single-declaration.vert
new file mode 100644
index 0000000..30b6875
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-location-identifiers-in-single-declaration.vert
@@ -0,0 +1,23 @@ 
+// [config]
+// expect_result: pass
+// glsl_version: 1.40
+// require_extensions: GL_ARB_separate_shader_objects GL_ARB_enhanced_layouts
+// check_link: false
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration"
+
+#version 140
+#extension GL_ARB_separate_shader_objects : enable
+#extension GL_ARB_enhanced_layouts: enable
+
+layout(location=2) layout(location=1) out vec3 var;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration-global-no-enhanced-layouts.geom b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration-global-no-enhanced-layouts.geom
new file mode 100644
index 0000000..0bc8eae
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration-global-no-enhanced-layouts.geom
@@ -0,0 +1,27 @@ 
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader5
+// check_link: false
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration"
+
+#version 150
+#extension GL_ARB_gpu_shader5 : enable
+
+layout(points) in;
+layout(points) out;
+
+layout(stream=2) layout(stream=1) out;
+
+out vec3 var;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration-layout-global.geom b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration-layout-global.geom
new file mode 100644
index 0000000..bcbf800
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration-layout-global.geom
@@ -0,0 +1,28 @@ 
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader5 GL_ARB_enhanced_layouts
+// check_link: false
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration"
+
+#version 150
+#extension GL_ARB_gpu_shader5 : enable
+#extension GL_ARB_enhanced_layouts: enable
+
+layout(points) in;
+layout(points) out;
+
+layout(stream=2) layout(stream=1) out;
+
+out vec3 var;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration-no-enhanced-layouts.geom b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration-no-enhanced-layouts.geom
new file mode 100644
index 0000000..965f0c1
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration-no-enhanced-layouts.geom
@@ -0,0 +1,25 @@ 
+// [config]
+// expect_result: fail
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader5
+// check_link: false
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration"
+
+#version 150
+#extension GL_ARB_gpu_shader5 : enable
+
+layout(points) in;
+layout(points) out;
+
+layout(stream=2) layout(stream=1) out vec3 var;
+
+void main()
+{
+}
diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration.geom b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration.geom
new file mode 100644
index 0000000..4490ea6
--- /dev/null
+++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-identifiers/multiple-stream-identifiers-in-single-declaration.geom
@@ -0,0 +1,26 @@ 
+// [config]
+// expect_result: pass
+// glsl_version: 1.50
+// require_extensions: GL_ARB_gpu_shader5 GL_ARB_enhanced_layouts
+// check_link: false
+// [end config]
+//
+// From the ARB_enhanced_layouts spec:
+//
+//    "More than one layout qualifier may appear in a single declaration.
+//     Additionally, the same layout-qualifier-name can occur multiple times
+//     within a layout qualifier or across multiple layout qualifiers in the
+//     same declaration"
+
+#version 150
+#extension GL_ARB_gpu_shader5 : enable
+#extension GL_ARB_enhanced_layouts: enable
+
+layout(points) in;
+layout(points) out;
+
+layout(stream=2) layout(stream=1) out vec3 var;
+
+void main()
+{
+}

Comments

On Sat, 2016-10-22 at 23:42 +0300, Andres Gomez wrote:
> We already had tests for a repeated layout-qualifier-name in a single
> layout-qualifier. Now, we also add similar tests to check across
> multiple layout-qualifiers in the same declaration.
> 
> From the ARB_enhanced_layouts spec:
> 
>     "More than one layout qualifier may appear in a single
> declaration.
>      Additionally, the same layout-qualifier-name can occur multiple
> times
>      within a layout qualifier or across multiple layout qualifiers
> in the
>      same declaration"

I believe this is just because the spec is written against the GLSL
4.30 spec. I'm not so sure that enhanced layouts should add this
support. Did you test the Nvidia and Amd binary drivers to see what
they do?

Also I believe we should already have negative tests for this so some
of these tests are likely duplicates of existing tests,
probably ARB_shading_language_420pack tests.


> 
> Signed-off-by: Andres Gomez <agomez@igalia.com>
> ---
>  ...-in-single-declaration-no-enhanced-layouts.vert | 22
> +++++++++++++++++
>  ...location-identifiers-in-single-declaration.vert | 23
> ++++++++++++++++++
>  ...gle-declaration-global-no-enhanced-layouts.geom | 27
> +++++++++++++++++++++
>  ...ifiers-in-single-declaration-layout-global.geom | 28
> ++++++++++++++++++++++
>  ...-in-single-declaration-no-enhanced-layouts.geom | 25
> +++++++++++++++++++
>  ...e-stream-identifiers-in-single-declaration.geom | 26
> ++++++++++++++++++++
>  6 files changed, 151 insertions(+)
>  create mode 100644
> tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-
> identifiers/multiple-location-identifiers-in-single-declaration-no-
> enhanced-layouts.vert
>  create mode 100644
> tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-
> identifiers/multiple-location-identifiers-in-single-declaration.vert
>  create mode 100644
> tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-
> identifiers/multiple-stream-identifiers-in-single-declaration-global-
> no-enhanced-layouts.geom
>  create mode 100644
> tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-
> identifiers/multiple-stream-identifiers-in-single-declaration-layout-
> global.geom
>  create mode 100644
> tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-
> identifiers/multiple-stream-identifiers-in-single-declaration-no-
> enhanced-layouts.geom
>  create mode 100644
> tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-qualifier-
> identifiers/multiple-stream-identifiers-in-single-declaration.geom
> 
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-
> layout-qualifier-identifiers/multiple-location-identifiers-in-single-
> declaration-no-enhanced-layouts.vert
> b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-
> qualifier-identifiers/multiple-location-identifiers-in-single-
> declaration-no-enhanced-layouts.vert
> new file mode 100644
> index 0000000..3e1827e
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-
> qualifier-identifiers/multiple-location-identifiers-in-single-
> declaration-no-enhanced-layouts.vert
> @@ -0,0 +1,22 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.40
> +// require_extensions: GL_ARB_separate_shader_objects
> +// check_link: false
> +// [end config]
> +//
> +// From the ARB_enhanced_layouts spec:
> +//
> +//    "More than one layout qualifier may appear in a single
> declaration.
> +//     Additionally, the same layout-qualifier-name can occur
> multiple times
> +//     within a layout qualifier or across multiple layout
> qualifiers in the
> +//     same declaration"
> +
> +#version 140
> +#extension GL_ARB_separate_shader_objects : enable
> +
> +layout(location=2) layout(location=1) out vec3 var;
> +
> +void main()
> +{
> +}
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-
> layout-qualifier-identifiers/multiple-location-identifiers-in-single-
> declaration.vert
> b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-
> qualifier-identifiers/multiple-location-identifiers-in-single-
> declaration.vert
> new file mode 100644
> index 0000000..30b6875
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-
> qualifier-identifiers/multiple-location-identifiers-in-single-
> declaration.vert
> @@ -0,0 +1,23 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.40
> +// require_extensions: GL_ARB_separate_shader_objects
> GL_ARB_enhanced_layouts
> +// check_link: false
> +// [end config]
> +//
> +// From the ARB_enhanced_layouts spec:
> +//
> +//    "More than one layout qualifier may appear in a single
> declaration.
> +//     Additionally, the same layout-qualifier-name can occur
> multiple times
> +//     within a layout qualifier or across multiple layout
> qualifiers in the
> +//     same declaration"
> +
> +#version 140
> +#extension GL_ARB_separate_shader_objects : enable
> +#extension GL_ARB_enhanced_layouts: enable
> +
> +layout(location=2) layout(location=1) out vec3 var;
> +
> +void main()
> +{
> +}
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-
> layout-qualifier-identifiers/multiple-stream-identifiers-in-single-
> declaration-global-no-enhanced-layouts.geom
> b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-
> qualifier-identifiers/multiple-stream-identifiers-in-single-
> declaration-global-no-enhanced-layouts.geom
> new file mode 100644
> index 0000000..0bc8eae
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-
> qualifier-identifiers/multiple-stream-identifiers-in-single-
> declaration-global-no-enhanced-layouts.geom
> @@ -0,0 +1,27 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_gpu_shader5
> +// check_link: false
> +// [end config]
> +//
> +// From the ARB_enhanced_layouts spec:
> +//
> +//    "More than one layout qualifier may appear in a single
> declaration.
> +//     Additionally, the same layout-qualifier-name can occur
> multiple times
> +//     within a layout qualifier or across multiple layout
> qualifiers in the
> +//     same declaration"
> +
> +#version 150
> +#extension GL_ARB_gpu_shader5 : enable
> +
> +layout(points) in;
> +layout(points) out;
> +
> +layout(stream=2) layout(stream=1) out;
> +
> +out vec3 var;
> +
> +void main()
> +{
> +}
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-
> layout-qualifier-identifiers/multiple-stream-identifiers-in-single-
> declaration-layout-global.geom
> b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-
> qualifier-identifiers/multiple-stream-identifiers-in-single-
> declaration-layout-global.geom
> new file mode 100644
> index 0000000..bcbf800
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-
> qualifier-identifiers/multiple-stream-identifiers-in-single-
> declaration-layout-global.geom
> @@ -0,0 +1,28 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_gpu_shader5 GL_ARB_enhanced_layouts
> +// check_link: false
> +// [end config]
> +//
> +// From the ARB_enhanced_layouts spec:
> +//
> +//    "More than one layout qualifier may appear in a single
> declaration.
> +//     Additionally, the same layout-qualifier-name can occur
> multiple times
> +//     within a layout qualifier or across multiple layout
> qualifiers in the
> +//     same declaration"
> +
> +#version 150
> +#extension GL_ARB_gpu_shader5 : enable
> +#extension GL_ARB_enhanced_layouts: enable
> +
> +layout(points) in;
> +layout(points) out;
> +
> +layout(stream=2) layout(stream=1) out;
> +
> +out vec3 var;
> +
> +void main()
> +{
> +}
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-
> layout-qualifier-identifiers/multiple-stream-identifiers-in-single-
> declaration-no-enhanced-layouts.geom
> b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-
> qualifier-identifiers/multiple-stream-identifiers-in-single-
> declaration-no-enhanced-layouts.geom
> new file mode 100644
> index 0000000..965f0c1
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-
> qualifier-identifiers/multiple-stream-identifiers-in-single-
> declaration-no-enhanced-layouts.geom
> @@ -0,0 +1,25 @@
> +// [config]
> +// expect_result: fail
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_gpu_shader5
> +// check_link: false
> +// [end config]
> +//
> +// From the ARB_enhanced_layouts spec:
> +//
> +//    "More than one layout qualifier may appear in a single
> declaration.
> +//     Additionally, the same layout-qualifier-name can occur
> multiple times
> +//     within a layout qualifier or across multiple layout
> qualifiers in the
> +//     same declaration"
> +
> +#version 150
> +#extension GL_ARB_gpu_shader5 : enable
> +
> +layout(points) in;
> +layout(points) out;
> +
> +layout(stream=2) layout(stream=1) out vec3 var;
> +
> +void main()
> +{
> +}
> diff --git a/tests/spec/arb_enhanced_layouts/compiler/duplicate-
> layout-qualifier-identifiers/multiple-stream-identifiers-in-single-
> declaration.geom
> b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-
> qualifier-identifiers/multiple-stream-identifiers-in-single-
> declaration.geom
> new file mode 100644
> index 0000000..4490ea6
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/compiler/duplicate-layout-
> qualifier-identifiers/multiple-stream-identifiers-in-single-
> declaration.geom
> @@ -0,0 +1,26 @@
> +// [config]
> +// expect_result: pass
> +// glsl_version: 1.50
> +// require_extensions: GL_ARB_gpu_shader5 GL_ARB_enhanced_layouts
> +// check_link: false
> +// [end config]
> +//
> +// From the ARB_enhanced_layouts spec:
> +//
> +//    "More than one layout qualifier may appear in a single
> declaration.
> +//     Additionally, the same layout-qualifier-name can occur
> multiple times
> +//     within a layout qualifier or across multiple layout
> qualifiers in the
> +//     same declaration"
> +
> +#version 150
> +#extension GL_ARB_gpu_shader5 : enable
> +#extension GL_ARB_enhanced_layouts: enable
> +
> +layout(points) in;
> +layout(points) out;
> +
> +layout(stream=2) layout(stream=1) out vec3 var;
> +
> +void main()
> +{
> +}
On Mon, 2016-10-24 at 11:05 +1100, Timothy Arceri wrote:
> On Sat, 2016-10-22 at 23:42 +0300, Andres Gomez wrote:
> > We already had tests for a repeated layout-qualifier-name in a single
> > layout-qualifier. Now, we also add similar tests to check across
> > multiple layout-qualifiers in the same declaration.
> > 
> > From the ARB_enhanced_layouts spec:
> > 
> >     "More than one layout qualifier may appear in a single
> > declaration.
> >      Additionally, the same layout-qualifier-name can occur multiple
> > times
> >      within a layout qualifier or across multiple layout qualifiers
> > in the
> >      same declaration"
> 
> 
> I believe this is just because the spec is written against the GLSL
> 4.30 spec. I'm not so sure that enhanced layouts should add this
> support. Did you test the Nvidia and Amd binary drivers to see what
> they do?

I run the tests with the proprietary drivers in a GNU/Linux box.

NVidia and AMD are a mess with respect to this. Some pass, some not.

My conclusion is that their implementation depends on the specific
layout-qualifier-name tested. Therefore, if with, let's say
max_vertices, they don't allow duplicates with different values, they
will fail in all the cases; with duplicates in a single layout-
qualifier or among several in the same declaration, no matter
if ARB_shading_language_420pack or ARB_enhanced_layouts are supported.

If duplicates with different values are allowed for the layout-
qualifier-name tested, then the ones failing will be the negative
tests. A mess ...

Let's drop this by now. It is always easy to add more tests later.

> Also I believe we should already have negative tests for this so some
> of these tests are likely duplicates of existing tests,
> probably ARB_shading_language_420pack tests.

Oh, right, it is stupid to test for the absence in 2 different places.
Good catch.