[Piglit] [PATCH] glsl-1.50: instance name is not used to match UBO/SSBOs shader interfaces
Antia Puentes
apuentes at igalia.com
Mon Apr 3 13:08:56 UTC 2017
The new tests look good to me. Thanks.
Reviewed-by: Antia Puentes <apuentes at igalia.com>
On 24/02/17 16:05, Andres Gomez wrote:
> This adds tests to check that no link error occurs when two
> differently named but equally instanced interface blocks differ in
> some way.
>
> From page 35 (page 41 of the PDF) of the GLSL 1.50, v11, spec:
>
> "The block name (block-name) is used to match interfaces: an output
> block of one pipeline stage will be matched to an input block
> with the same name in the subsequent pipeline stage. For uniform
> blocks, the application uses the block name to identify the
> block.
>
> ...
>
> Outside the shading language (i.e., in the API), members are
> similarly identified except the block name is always used in
> place of the instance name (API accesses are to interfaces, not
> to shaders)."
>
> Signed-off-by: Andres Gomez <agomez at igalia.com>
> Cc: Timothy Arceri <tarceri at itsqueeze.com>
> ---
> ...age-blocks-align-qualifier-mismatch.shader_test | 54 +++++++++++++++++++++
> ...cks-member-align-qualifier-mismatch.shader_test | 54 +++++++++++++++++++++
> ...orm-blocks-align-qualifier-mismatch.shader_test | 51 ++++++++++++++++++++
> ...cks-member-align-qualifier-mismatch.shader_test | 51 ++++++++++++++++++++
> ...ks-member-offset-qualifier-mismatch.shader_test | 54 +++++++++++++++++++++
> ...ks-member-offset-qualifier-mismatch.shader_test | 51 ++++++++++++++++++++
> ...-storage-blocks-array-size-mismatch.shader_test | 54 +++++++++++++++++++++
> ...e-blocks-binding-qualifier-mismatch.shader_test | 55 ++++++++++++++++++++++
> ...e-blocks-member-array-size-mismatch.shader_test | 52 ++++++++++++++++++++
> ...torage-blocks-member-count-mismatch.shader_test | 53 +++++++++++++++++++++
> ...storage-blocks-member-name-mismatch.shader_test | 52 ++++++++++++++++++++
> ...torage-blocks-member-order-mismatch.shader_test | 54 +++++++++++++++++++++
> ...ge-blocks-member-qualifier-mismatch.shader_test | 52 ++++++++++++++++++++
> ...storage-blocks-member-type-mismatch.shader_test | 52 ++++++++++++++++++++
> ...ge-blocks-memory-qualifier-mismatch.shader_test | 52 ++++++++++++++++++++
> ...blocks-packaging-qualifier-mismatch.shader_test | 52 ++++++++++++++++++++
> ...m-blocks-binding-qualifier-mismatch.shader_test | 52 ++++++++++++++++++++
> ...-uniform-blocks-array-size-mismatch.shader_test | 50 ++++++++++++++++++++
> ...m-blocks-member-array-size-mismatch.shader_test | 48 +++++++++++++++++++
> ...niform-blocks-member-count-mismatch.shader_test | 49 +++++++++++++++++++
> ...uniform-blocks-member-name-mismatch.shader_test | 48 +++++++++++++++++++
> ...niform-blocks-member-order-mismatch.shader_test | 50 ++++++++++++++++++++
> ...rm-blocks-member-qualifier-mismatch.shader_test | 48 +++++++++++++++++++
> ...uniform-blocks-member-type-mismatch.shader_test | 48 +++++++++++++++++++
> ...rm-blocks-memory-qualifier-mismatch.shader_test | 48 +++++++++++++++++++
> ...blocks-packaging-qualifier-mismatch.shader_test | 48 +++++++++++++++++++
> 26 files changed, 1332 insertions(+)
> create mode 100644 tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-shader-storage-blocks-align-qualifier-mismatch.shader_test
> create mode 100644 tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-shader-storage-blocks-member-align-qualifier-mismatch.shader_test
> create mode 100644 tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-uniform-blocks-align-qualifier-mismatch.shader_test
> create mode 100644 tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-uniform-blocks-member-align-qualifier-mismatch.shader_test
> create mode 100644 tests/spec/arb_enhanced_layouts/linker/explicit-offsets/instance-matching-shader-storage-blocks-member-offset-qualifier-mismatch.shader_test
> create mode 100644 tests/spec/arb_enhanced_layouts/linker/explicit-offsets/instance-matching-uniform-blocks-member-offset-qualifier-mismatch.shader_test
> create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-array-size-mismatch.shader_test
> create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-binding-qualifier-mismatch.shader_test
> create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-array-size-mismatch.shader_test
> create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-count-mismatch.shader_test
> create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-name-mismatch.shader_test
> create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-order-mismatch.shader_test
> create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-qualifier-mismatch.shader_test
> create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-type-mismatch.shader_test
> create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-memory-qualifier-mismatch.shader_test
> create mode 100644 tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-packaging-qualifier-mismatch.shader_test
> create mode 100644 tests/spec/arb_shading_language_420pack/linker/instance-matching-uniform-blocks-binding-qualifier-mismatch.shader_test
> create mode 100644 tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-array-size-mismatch.shader_test
> create mode 100644 tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-array-size-mismatch.shader_test
> create mode 100644 tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-count-mismatch.shader_test
> create mode 100644 tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-name-mismatch.shader_test
> create mode 100644 tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-order-mismatch.shader_test
> create mode 100644 tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-qualifier-mismatch.shader_test
> create mode 100644 tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-type-mismatch.shader_test
> create mode 100644 tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-memory-qualifier-mismatch.shader_test
> create mode 100644 tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-packaging-qualifier-mismatch.shader_test
>
> diff --git a/tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-shader-storage-blocks-align-qualifier-mismatch.shader_test b/tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-shader-storage-blocks-align-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..1de65955f
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-shader-storage-blocks-align-qualifier-mismatch.shader_test
> @@ -0,0 +1,54 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in its binding
> +# qualification between the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_enhanced_layouts
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_enhanced_layouts : require
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +layout(std140, align = 32) buffer blockA {
> + vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_enhanced_layouts : require
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +layout(std140, align = 64) buffer blockB {
> + vec4 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-shader-storage-blocks-member-align-qualifier-mismatch.shader_test b/tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-shader-storage-blocks-member-align-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..f05c3b28d
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-shader-storage-blocks-member-align-qualifier-mismatch.shader_test
> @@ -0,0 +1,54 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in its binding
> +# qualification between the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_enhanced_layouts
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_enhanced_layouts : require
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +layout(std140) buffer blockA {
> + layout(align = 32) vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_enhanced_layouts : require
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +layout(std140) buffer blockB {
> + layout(align = 64) vec4 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-uniform-blocks-align-qualifier-mismatch.shader_test b/tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-uniform-blocks-align-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..32714d8e8
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-uniform-blocks-align-qualifier-mismatch.shader_test
> @@ -0,0 +1,51 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in its binding
> +# qualification between the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_enhanced_layouts
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_enhanced_layouts : require
> +
> +layout(std140, align = 32) uniform blockA {
> + vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_enhanced_layouts : require
> +
> +layout(std140, align = 64) uniform blockB {
> + vec4 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-uniform-blocks-member-align-qualifier-mismatch.shader_test b/tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-uniform-blocks-member-align-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..df541356c
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/linker/align-layout/instance-matching-uniform-blocks-member-align-qualifier-mismatch.shader_test
> @@ -0,0 +1,51 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in its binding
> +# qualification between the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_enhanced_layouts
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_enhanced_layouts : require
> +
> +layout(std140) uniform blockA {
> + layout(align = 32) vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_enhanced_layouts : require
> +
> +layout(std140) uniform blockB {
> + layout(align = 64) vec4 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/instance-matching-shader-storage-blocks-member-offset-qualifier-mismatch.shader_test b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/instance-matching-shader-storage-blocks-member-offset-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..d267bf6a0
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/instance-matching-shader-storage-blocks-member-offset-qualifier-mismatch.shader_test
> @@ -0,0 +1,54 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in its binding
> +# qualification between the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_enhanced_layouts
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_enhanced_layouts : require
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +layout(std140) buffer blockA {
> + layout(offset = 32) vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_enhanced_layouts : require
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +layout(std140) buffer blockB {
> + layout(offset = 64) vec4 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/instance-matching-uniform-blocks-member-offset-qualifier-mismatch.shader_test b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/instance-matching-uniform-blocks-member-offset-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..5817562d2
> --- /dev/null
> +++ b/tests/spec/arb_enhanced_layouts/linker/explicit-offsets/instance-matching-uniform-blocks-member-offset-qualifier-mismatch.shader_test
> @@ -0,0 +1,51 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in its binding
> +# qualification between the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_enhanced_layouts
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_enhanced_layouts : require
> +
> +layout(std140) uniform blockA {
> + layout(offset = 32) vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_enhanced_layouts : require
> +
> +layout(std140) uniform blockB {
> + layout(offset = 64) vec4 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-array-size-mismatch.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-array-size-mismatch.shader_test
> new file mode 100644
> index 000000000..3037342d1
> --- /dev/null
> +++ b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-array-size-mismatch.shader_test
> @@ -0,0 +1,54 @@
> +/* Tests that no link error occurs when two different but equally
> + * instanced interface blocks differ on the array dimension of the
> + * interface.
> + *
> + * GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> + * "The block name (block-name) is used to match interfaces: an output
> + * block of one pipeline stage will be matched to an input block with
> + * the same name in the subsequent pipeline stage. For uniform blocks,
> + * the application uses the block name to identify the block.
> + *
> + * ...
> + *
> + * Outside the shading language (i.e., in the API), members are
> + * similarly identified except the block name is always used in place
> + * of the instance name (API accesses are to interfaces, not to
> + * shaders)."
> + */
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockA {
> + vec4 a;
> + vec4 b;
> +} inst[3];
> +
> +void main()
> +{
> + gl_Position = inst[0].a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockB {
> + vec4 a;
> + vec4 b;
> +} inst[2];
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst[0].a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-binding-qualifier-mismatch.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-binding-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..7e58148e8
> --- /dev/null
> +++ b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-binding-qualifier-mismatch.shader_test
> @@ -0,0 +1,55 @@
> +/* Tests that no link error occurs when two different but equally
> + * instanced interface blocks differ only in its binding
> + * qualification between the vertex and fragment shaders.
> + *
> + * GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> + * "The block name (block-name) is used to match interfaces: an output
> + * block of one pipeline stage will be matched to an input block with
> + * the same name in the subsequent pipeline stage. For uniform blocks,
> + * the application uses the block name to identify the block.
> + *
> + * ...
> + *
> + * Outside the shading language (i.e., in the API), members are
> + * similarly identified except the block name is always used in place
> + * of the instance name (API accesses are to interfaces, not to
> + * shaders)."
> + */
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_shading_language_420pack
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_shading_language_420pack: require
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +layout(binding = 0) buffer blockA {
> + vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_shading_language_420pack: require
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +layout(binding = 1) buffer blockB {
> + vec4 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-array-size-mismatch.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-array-size-mismatch.shader_test
> new file mode 100644
> index 000000000..bc40f4e8d
> --- /dev/null
> +++ b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-array-size-mismatch.shader_test
> @@ -0,0 +1,52 @@
> +/* Tests that no link error occurs when two different but equally
> + * instanced interface blocks differ only in a member's array size
> + * between the vertex and fragment shaders.
> + *
> + * GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> + * "The block name (block-name) is used to match interfaces: an output
> + * block of one pipeline stage will be matched to an input block with
> + * the same name in the subsequent pipeline stage. For uniform blocks,
> + * the application uses the block name to identify the block.
> + *
> + * ...
> + *
> + * Outside the shading language (i.e., in the API), members are
> + * similarly identified except the block name is always used in place
> + * of the instance name (API accesses are to interfaces, not to
> + * shaders)."
> + */
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockA {
> + vec4 a[2];
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a[0];
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockB {
> + vec4 a[3];
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a[0];
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-count-mismatch.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-count-mismatch.shader_test
> new file mode 100644
> index 000000000..57a46b062
> --- /dev/null
> +++ b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-count-mismatch.shader_test
> @@ -0,0 +1,53 @@
> +/* Tests that no link error occurs when two different but equally
> + * instanced interface blocks differ only in the number of members
> + * between the vertex and fragment shaders.
> + *
> + * GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> + * "The block name (block-name) is used to match interfaces: an output
> + * block of one pipeline stage will be matched to an input block with
> + * the same name in the subsequent pipeline stage. For uniform blocks,
> + * the application uses the block name to identify the block.
> + *
> + * ...
> + *
> + * Outside the shading language (i.e., in the API), members are
> + * similarly identified except the block name is always used in place
> + * of the instance name (API accesses are to interfaces, not to
> + * shaders)."
> + */
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockA {
> + vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockB {
> + vec4 a;
> + vec4 b;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-name-mismatch.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-name-mismatch.shader_test
> new file mode 100644
> index 000000000..b7e8d7cf0
> --- /dev/null
> +++ b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-name-mismatch.shader_test
> @@ -0,0 +1,52 @@
> +/* Tests that no link error occurs when two different but equally
> + * instanced interface blocks differ only in a member's name between
> + * the vertex and fragment shaders.
> + *
> + * GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> + * "The block name (block-name) is used to match interfaces: an output
> + * block of one pipeline stage will be matched to an input block with
> + * the same name in the subsequent pipeline stage. For uniform blocks,
> + * the application uses the block name to identify the block.
> + *
> + * ...
> + *
> + * Outside the shading language (i.e., in the API), members are
> + * similarly identified except the block name is always used in place
> + * of the instance name (API accesses are to interfaces, not to
> + * shaders)."
> + */
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockA {
> + vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockB {
> + vec4 b;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.b;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-order-mismatch.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-order-mismatch.shader_test
> new file mode 100644
> index 000000000..12cd8f8c9
> --- /dev/null
> +++ b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-order-mismatch.shader_test
> @@ -0,0 +1,54 @@
> +/* Tests that no link error occurs when two different but equally
> + * instanced interface blocks differ only in the order of the members
> + * between the vertex and fragment shaders.
> + *
> + * GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> + * "The block name (block-name) is used to match interfaces: an output
> + * block of one pipeline stage will be matched to an input block with
> + * the same name in the subsequent pipeline stage. For uniform blocks,
> + * the application uses the block name to identify the block.
> + *
> + * ...
> + *
> + * Outside the shading language (i.e., in the API), members are
> + * similarly identified except the block name is always used in place
> + * of the instance name (API accesses are to interfaces, not to
> + * shaders)."
> + */
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockA {
> + vec4 a;
> + vec4 b;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockB {
> + vec4 b;
> + vec4 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-qualifier-mismatch.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..a8989daed
> --- /dev/null
> +++ b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-qualifier-mismatch.shader_test
> @@ -0,0 +1,52 @@
> +/* Tests that no link error occurs when two different but equally
> + * instanced interface blocks differ only in a member's qualifier
> + * between the vertex and fragment shaders.
> + *
> + * GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> + * "The block name (block-name) is used to match interfaces: an output
> + * block of one pipeline stage will be matched to an input block with
> + * the same name in the subsequent pipeline stage. For uniform blocks,
> + * the application uses the block name to identify the block.
> + *
> + * ...
> + *
> + * Outside the shading language (i.e., in the API), members are
> + * similarly identified except the block name is always used in place
> + * of the instance name (API accesses are to interfaces, not to
> + * shaders)."
> + */
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockA {
> + layout(column_major) mat4 m;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.m[0];
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockB {
> + layout(row_major) mat4 m;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.m[0];
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-type-mismatch.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-type-mismatch.shader_test
> new file mode 100644
> index 000000000..6cf264b5f
> --- /dev/null
> +++ b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-member-type-mismatch.shader_test
> @@ -0,0 +1,52 @@
> +/* Tests that no link error occurs when two different but equally
> + * instanced interface blocks differ only in a member's type between
> + * the vertex and fragment shaders.
> + *
> + * GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> + * "The block name (block-name) is used to match interfaces: an output
> + * block of one pipeline stage will be matched to an input block with
> + * the same name in the subsequent pipeline stage. For uniform blocks,
> + * the application uses the block name to identify the block.
> + *
> + * ...
> + *
> + * Outside the shading language (i.e., in the API), members are
> + * similarly identified except the block name is always used in place
> + * of the instance name (API accesses are to interfaces, not to
> + * shaders)."
> + */
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockA {
> + vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +buffer blockB {
> + vec3 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = vec4(inst.a, 0.0);
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-memory-qualifier-mismatch.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-memory-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..21c153a23
> --- /dev/null
> +++ b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-memory-qualifier-mismatch.shader_test
> @@ -0,0 +1,52 @@
> +/* Tests that no link error occurs when two different but equally
> + * instanced interface blocks differ only in its memory qualification
> + * between the vertex and fragment shaders.
> + *
> + * GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> + * "The block name (block-name) is used to match interfaces: an output
> + * block of one pipeline stage will be matched to an input block with
> + * the same name in the subsequent pipeline stage. For uniform blocks,
> + * the application uses the block name to identify the block.
> + *
> + * ...
> + *
> + * Outside the shading language (i.e., in the API), members are
> + * similarly identified except the block name is always used in place
> + * of the instance name (API accesses are to interfaces, not to
> + * shaders)."
> + */
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +layout(column_major) buffer blockA {
> + mat4 m;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.m[0];
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +layout(row_major) buffer blockB {
> + mat4 m;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.m[0];
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-packaging-qualifier-mismatch.shader_test b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-packaging-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..36d1b928b
> --- /dev/null
> +++ b/tests/spec/arb_shader_storage_buffer_object/linker/instance-matching-shader-storage-blocks-packaging-qualifier-mismatch.shader_test
> @@ -0,0 +1,52 @@
> +/* Tests that no link error occurs when two different but equally
> + * instanced interface blocks differ only in its packaging
> + * qualification between the vertex and fragment shaders.
> + *
> + * GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> + * "The block name (block-name) is used to match interfaces: an output
> + * block of one pipeline stage will be matched to an input block with
> + * the same name in the subsequent pipeline stage. For uniform blocks,
> + * the application uses the block name to identify the block.
> + *
> + * ...
> + *
> + * Outside the shading language (i.e., in the API), members are
> + * similarly identified except the block name is always used in place
> + * of the instance name (API accesses are to interfaces, not to
> + * shaders)."
> + */
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_shader_storage_buffer_object
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +layout(std140) buffer blockA {
> + vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_shader_storage_buffer_object: require
> +
> +layout(shared) buffer blockB {
> + vec4 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/arb_shading_language_420pack/linker/instance-matching-uniform-blocks-binding-qualifier-mismatch.shader_test b/tests/spec/arb_shading_language_420pack/linker/instance-matching-uniform-blocks-binding-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..2d523972d
> --- /dev/null
> +++ b/tests/spec/arb_shading_language_420pack/linker/instance-matching-uniform-blocks-binding-qualifier-mismatch.shader_test
> @@ -0,0 +1,52 @@
> +/* Tests that no link error occurs when two different but equally
> + * instanced interface blocks differ only in its binding
> + * qualification between the vertex and fragment shaders.
> + *
> + * GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> + * "The block name (block-name) is used to match interfaces: an output
> + * block of one pipeline stage will be matched to an input block with
> + * the same name in the subsequent pipeline stage. For uniform blocks,
> + * the application uses the block name to identify the block.
> + *
> + * ...
> + *
> + * Outside the shading language (i.e., in the API), members are
> + * similarly identified except the block name is always used in place
> + * of the instance name (API accesses are to interfaces, not to
> + * shaders)."
> + */
> +
> +[require]
> +GLSL >= 1.50
> +GL_ARB_shading_language_420pack
> +
> +[vertex shader]
> +#version 150
> +#extension GL_ARB_shading_language_420pack: require
> +
> +layout(binding = 0) uniform blockA {
> + vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +#extension GL_ARB_shading_language_420pack: require
> +
> +layout(binding = 1) uniform blockB {
> + vec4 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-array-size-mismatch.shader_test b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-array-size-mismatch.shader_test
> new file mode 100644
> index 000000000..851a4fb1c
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-array-size-mismatch.shader_test
> @@ -0,0 +1,50 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ on the array dimension of the
> +# interface.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +#version 150
> +
> +uniform blockA {
> + vec4 a;
> + vec4 b;
> +} inst[3];
> +
> +void main()
> +{
> + gl_Position = inst[0].a;
> +}
> +
> +[fragment shader]
> +#version 150
> +
> +uniform blockB {
> + vec4 a;
> + vec4 b;
> +} inst[2];
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst[0].a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-array-size-mismatch.shader_test b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-array-size-mismatch.shader_test
> new file mode 100644
> index 000000000..2148f34e1
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-array-size-mismatch.shader_test
> @@ -0,0 +1,48 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in a member's array size
> +# between the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +#version 150
> +
> +uniform blockA {
> + vec4 a[2];
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a[0];
> +}
> +
> +[fragment shader]
> +#version 150
> +
> +uniform blockB {
> + vec4 a[3];
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a[0];
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-count-mismatch.shader_test b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-count-mismatch.shader_test
> new file mode 100644
> index 000000000..12e7896a2
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-count-mismatch.shader_test
> @@ -0,0 +1,49 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in the number of members
> +# between the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +#version 150
> +
> +uniform blockA {
> + vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +
> +uniform blockB {
> + vec4 a;
> + vec4 b;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-name-mismatch.shader_test b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-name-mismatch.shader_test
> new file mode 100644
> index 000000000..af71c3701
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-name-mismatch.shader_test
> @@ -0,0 +1,48 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in a member's name between
> +# the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +#version 150
> +
> +uniform blockA {
> + vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +
> +uniform blockB {
> + vec4 b;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.b;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-order-mismatch.shader_test b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-order-mismatch.shader_test
> new file mode 100644
> index 000000000..38c34b12a
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-order-mismatch.shader_test
> @@ -0,0 +1,50 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in the order of the members
> +# between the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +#version 150
> +
> +uniform blockA {
> + vec4 a;
> + vec4 b;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +
> +uniform blockB {
> + vec4 b;
> + vec4 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-qualifier-mismatch.shader_test b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..b9a1492e8
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-qualifier-mismatch.shader_test
> @@ -0,0 +1,48 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in a member's qualifier
> +# between the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +#version 150
> +
> +uniform blockA {
> + layout(column_major) mat4 m;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.m[0];
> +}
> +
> +[fragment shader]
> +#version 150
> +
> +uniform blockB {
> + layout(row_major) mat4 m;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.m[0];
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-type-mismatch.shader_test b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-type-mismatch.shader_test
> new file mode 100644
> index 000000000..63f57a3cc
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-member-type-mismatch.shader_test
> @@ -0,0 +1,48 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in a member's type between
> +# the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +#version 150
> +
> +uniform blockA {
> + vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +
> +uniform blockB {
> + vec3 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = vec4(inst.a, 0.0);
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-memory-qualifier-mismatch.shader_test b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-memory-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..d4b207b7a
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-memory-qualifier-mismatch.shader_test
> @@ -0,0 +1,48 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in its memory qualification
> +# between the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +#version 150
> +
> +layout(column_major) uniform blockA {
> + mat4 m;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.m[0];
> +}
> +
> +[fragment shader]
> +#version 150
> +
> +layout(row_major) uniform blockB {
> + mat4 m;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.m[0];
> +}
> +
> +[test]
> +link success
> diff --git a/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-packaging-qualifier-mismatch.shader_test b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-packaging-qualifier-mismatch.shader_test
> new file mode 100644
> index 000000000..cb59c224a
> --- /dev/null
> +++ b/tests/spec/glsl-1.50/linker/instance-matching-uniform-blocks-packaging-qualifier-mismatch.shader_test
> @@ -0,0 +1,48 @@
> +# Tests that no link error occurs when two different but equally
> +# instanced interface blocks differ only in its packaging
> +# qualification between the vertex and fragment shaders.
> +#
> +# GLSLangSpec.1.50.11, 4.3.7 Interface Blocks:
> +# "The block name (block-name) is used to match interfaces: an output
> +# block of one pipeline stage will be matched to an input block with
> +# the same name in the subsequent pipeline stage. For uniform blocks,
> +# the application uses the block name to identify the block.
> +#
> +# ...
> +#
> +# Outside the shading language (i.e., in the API), members are
> +# similarly identified except the block name is always used in place
> +# of the instance name (API accesses are to interfaces, not to
> +# shaders)."
> +
> +[require]
> +GLSL >= 1.50
> +
> +[vertex shader]
> +#version 150
> +
> +layout(std140) uniform blockA {
> + vec4 a;
> +} inst;
> +
> +void main()
> +{
> + gl_Position = inst.a;
> +}
> +
> +[fragment shader]
> +#version 150
> +
> +layout(shared) uniform blockB {
> + vec4 a;
> +} inst;
> +
> +out vec4 color;
> +
> +void main()
> +{
> + color = inst.a;
> +}
> +
> +[test]
> +link success
More information about the Piglit
mailing list