[Piglit] [PATCH 3/6] glsl-es-3.00: add uniform block type mismatch link test

Anuj Phogat anuj.phogat at gmail.com
Thu Feb 28 10:44:54 PST 2013


On Wed, Feb 27, 2013 at 11:24 AM, Jordan Justen
<jordan.l.justen at intel.com> wrote:
> Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
> ---
>  ...terface-blocks-member-type-mismatch.shader_test |   39 ++++++++++++++++++++
>  1 file changed, 39 insertions(+)
>  create mode 100644 tests/spec/glsl-es-3.00/linker/interface-blocks-member-type-mismatch.shader_test
>
> diff --git a/tests/spec/glsl-es-3.00/linker/interface-blocks-member-type-mismatch.shader_test b/tests/spec/glsl-es-3.00/linker/interface-blocks-member-type-mismatch.shader_test
> new file mode 100644
> index 0000000..d586867
> --- /dev/null
> +++ b/tests/spec/glsl-es-3.00/linker/interface-blocks-member-type-mismatch.shader_test
> @@ -0,0 +1,39 @@
> +# Tests that a link error occurs when an interface block member's type
> +# differs between the vertex and fragment shaders.
> +#
> +# GLSL_ES_Specification_3.00.3, 4.3.7 Interface Blocks:
> +# "Matched block names within an interface (as defined above) must match
> +#  in terms of having the same number of declarations with the same
> +#  sequence of types, precisions and the same sequence of member names,
> +#  as well as having the same member-wise layout qualification (see next
> +#  section)."
I think few more test can be added to test same number of declarations and
same sequence of member names and types.
e.g.
[vertex shader]
uniform block {
       vec4 a;
       float b;
       int c;
} inst_a;

[fragment shader]
uniform block {
       float b;
       int c;
       vec4 a;
} inst_b;

as per spec this should not work.

> +[require]
> +GL ES >= 3.0
> +GLSL ES >= 3.00
> +
> +[vertex shader]
> +#version 300 es
> +
> +uniform block {
> +       vec4 a; // a is vec3 in FS
> +} inst_a;
> +
> +void main()
> +{
> +    gl_Position = vec4(0.0);
> +}
> +
> +[fragment shader]
> +#version 300 es
> +
> +uniform block {
> +       vec3 a; // a is vec4 in VS
> +} inst_b;
> +
> +void main()
> +{
> +}
> +
> +[test]
> +link error
> +
> --
> 1.7.10.4
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list