[Piglit] [PATCH 21/23] arb_shading_language_420pack: Test initialized structs are identical

Anuj Phogat anuj.phogat at gmail.com
Wed Jul 3 13:42:48 PDT 2013


On Sat, Jun 29, 2013 at 8:43 PM, Matt Turner <mattst88 at gmail.com> wrote:
>
> ---
>  .../aggregate-initializer-struct.shader_test       | 83 ++++++++++++++++++++++
>  1 file changed, 83 insertions(+)
>  create mode 100644 tests/spec/arb_shading_language_420pack/execution/aggregate-initializer-struct.shader_test
>
> diff --git a/tests/spec/arb_shading_language_420pack/execution/aggregate-initializer-struct.shader_test b/tests/spec/arb_shading_language_420pack/execution/aggregate-initializer-struct.shader_test
> new file mode 100644
> index 0000000..ce86f69
> --- /dev/null
> +++ b/tests/spec/arb_shading_language_420pack/execution/aggregate-initializer-struct.shader_test
> @@ -0,0 +1,83 @@
> +[require]
> +GLSL >= 1.30
> +GL_ARB_shading_language_420pack
> +
> +[vertex shader]
> +#extension GL_ARB_shading_language_420pack: enable
> +
> +in vec4 vertex;
> +out vec4 color;
> +
> +void main()
> +{
> +    struct S {
> +        vec4 v[2];
> +    };
> +
> +    struct T {
> +        S a[2], b;
> +        int c;
> +    }
> +    s1 = T(
> +          S[2](
> +               S(vec4[2](vec4(1.0, 2.0, 3.0, 4.0), vec4(5.0, 6.0, 7.0, 8.0))),
> +               S(vec4[2](vec4(1.0, 2.0, 3.0, 4.0), vec4(5.0, 6.0, 7.0, 8.0)))
> +          ), // a
> +          S(vec4[2](vec4(1.0, 2.0, 3.0, 4.0), vec4(5.0, 6.0, 7.0, 8.0))), // b
> +          4 // c
> +    ),
> +    s2 = {
> +        {
> +            {
> +                {
> +                    {1.0, 2.0, 3.0, 4.0}, // a[0].v[0]
> +                    {5.0, 6.0, 7.0, 8.0}  // a[0].v[1]
> +                } // a[0].v
> +            }, // a[0]
> +            {
> +                {
> +                    {1.0, 2.0, 3.0, 4.0}, // a[1].v[0]
> +                    {5.0, 6.0, 7.0, 8.0}  // a[1].v[1]
> +                } // a[1].v
> +            } // a[1]
> +        }, // a
> +        {
> +            {
> +                {1.0, 2.0, 3.0, 4.0}, // b.v[0]
> +                {5.0, 6.0, 7.0, 8.0}  // b.v[1]
> +            } // b.v
> +        }, // b
> +        4 // c
> +    };
> +
> +    color = vec4(0.0, 1.0, 0.0, 1.0);
> +
> +    if (s1.a[0].v[0] != s2.a[0].v[0] ||
> +        s1.a[0].v[1] != s2.a[0].v[1] ||
> +        s1.a[1].v[1] != s2.a[1].v[1] ||
This condition should be s1.a[1].v[0] != s2.a[1].v[0]

> +        s1.a[1].v[1] != s2.a[1].v[1] ||
> +        s1.b.v[0] != s2.b.v[0] ||
> +        s1.b.v[1] != s2.b.v[1] ||
> +        s1.c != s2.c) {
> +        color = vec4(1.0, 0.0, 0.0, 1.0);
> +    }
> +    gl_Position = vertex;
> +}
> +
> +[fragment shader]
> +in vec4 color;
> +
> +void main() {
> +    gl_FragColor = color;;
> +}
> +
> +[vertex data]
> +vertex/float/2
> +-1.0 -1.0
> + 1.0 -1.0
> + 1.0  1.0
> +-1.0  1.0
> +
> +[test]
> +draw arrays GL_TRIANGLE_FAN 0 4
> +probe all rgba 0.0 1.0 0.0 1.0
> --
> 1.8.1.5
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit


More information about the Piglit mailing list