[08/10] arb_separate_shader_objects: add unused location qualified input test

Submitted by Andres Gomez on Feb. 1, 2019, 5:55 p.m.

Details

Message ID 20190201175524.24454-9-agomez@igalia.com
State Accepted
Commit ff410196b1cb8ce3ab975374bc58e54a876407fd
Headers show
Series "arb_enhanced_layouts: additional tests" ( rev: 2 1 ) in Piglit

Not browsing as part of any series.

Commit Message

Andres Gomez Feb. 1, 2019, 5:55 p.m.
New tests to check that an unused input varying, which would be
matched based on its explicit location, won't cause a link failure if
there is no matching output variable.

From the ARB_separate_shader_objects spec v.25:

  "   * An output variable is considered to match an input variable in
        the subequent shader if:

        * the two variables match in name, type, and qualification; or

        * the two variables are declared with the same location layout
          qualifier and match in type and qualification."

  ...

  " For program objects containing multiple shaders, LinkProgram will
    check for mismatches on interfaces between shader stages in the
    program being linked and generate a link error if a mismatch is
    detected.  A link error will be generated if any statically
    referenced input variable or block does not have a matching
    output."

Cc: Timothy Arceri <tarceri@itsqueeze.com>
Cc: Iago Toral Quiroga <itoral@igalia.com>
Cc: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Cc: Tapani Pälli <tapani.palli@intel.com>
Cc: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
---
 ...explicit-location-unused-input.shader_test | 38 +++++++++++++++++++
 1 file changed, 38 insertions(+)
 create mode 100644 tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test

Patch hide | download patch | download mbox

diff --git a/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test
new file mode 100644
index 000000000..c39fd4033
--- /dev/null
+++ b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test
@@ -0,0 +1,38 @@ 
+// From the ARB_separate_shader_objects spec v.25:
+//
+//   "   * An output variable is considered to match an input variable
+//         in the subequent shader if:
+//
+//         * the two variables match in name, type, and qualification;
+//           or
+//
+//         * the two variables are declared with the same location
+//           layout qualifier and match in type and qualification."
+//
+//   ...
+//
+//   " For program objects containing multiple shaders, LinkProgram
+//     will check for mismatches on interfaces between shader stages
+//     in the program being linked and generate a link error if a
+//     mismatch is detected.  A link error will be generated if any
+//     statically referenced input variable or block does not have a
+//     matching output."
+
+[require]
+GLSL >= 1.40
+GL_ARB_separate_shader_objects
+
+[vertex shader passthrough]
+
+[fragment shader]
+#version 140
+#extension GL_ARB_separate_shader_objects : require
+
+layout(location = 0) in vec4 in1;
+
+void main()
+{
+}
+
+[test]
+link success

Comments

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>

On 2/2/19 4:55 am, Andres Gomez wrote:
> New tests to check that an unused input varying, which would be
> matched based on its explicit location, won't cause a link failure if
> there is no matching output variable.
> 
>  From the ARB_separate_shader_objects spec v.25:
> 
>    "   * An output variable is considered to match an input variable in
>          the subequent shader if:
> 
>          * the two variables match in name, type, and qualification; or
> 
>          * the two variables are declared with the same location layout
>            qualifier and match in type and qualification."
> 
>    ...
> 
>    " For program objects containing multiple shaders, LinkProgram will
>      check for mismatches on interfaces between shader stages in the
>      program being linked and generate a link error if a mismatch is
>      detected.  A link error will be generated if any statically
>      referenced input variable or block does not have a matching
>      output."
> 
> Cc: Timothy Arceri <tarceri@itsqueeze.com>
> Cc: Iago Toral Quiroga <itoral@igalia.com>
> Cc: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
> Cc: Tapani Pälli <tapani.palli@intel.com>
> Cc: Ian Romanick <ian.d.romanick@intel.com>
> Signed-off-by: Andres Gomez <agomez@igalia.com>
> ---
>   ...explicit-location-unused-input.shader_test | 38 +++++++++++++++++++
>   1 file changed, 38 insertions(+)
>   create mode 100644 tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test
> 
> diff --git a/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test
> new file mode 100644
> index 000000000..c39fd4033
> --- /dev/null
> +++ b/tests/spec/arb_separate_shader_objects/linker/vs-to-fs-explicit-location-unused-input.shader_test
> @@ -0,0 +1,38 @@
> +// From the ARB_separate_shader_objects spec v.25:
> +//
> +//   "   * An output variable is considered to match an input variable
> +//         in the subequent shader if:
> +//
> +//         * the two variables match in name, type, and qualification;
> +//           or
> +//
> +//         * the two variables are declared with the same location
> +//           layout qualifier and match in type and qualification."
> +//
> +//   ...
> +//
> +//   " For program objects containing multiple shaders, LinkProgram
> +//     will check for mismatches on interfaces between shader stages
> +//     in the program being linked and generate a link error if a
> +//     mismatch is detected.  A link error will be generated if any
> +//     statically referenced input variable or block does not have a
> +//     matching output."
> +
> +[require]
> +GLSL >= 1.40
> +GL_ARB_separate_shader_objects
> +
> +[vertex shader passthrough]
> +
> +[fragment shader]
> +#version 140
> +#extension GL_ARB_separate_shader_objects : require
> +
> +layout(location = 0) in vec4 in1;
> +
> +void main()
> +{
> +}
> +
> +[test]
> +link success
>