fix the spelling in whole piglit
[piglit.git] / tests / spec / glsl-1.20 / execution / fs-deref-literal-array-of-structs-with-multiple-members.shader_test
blob5ff0626b8efcfceb588f6877500ec6a0a316711e
1 # Verify that an array of structs appearing in the shader as a literal
2 # can be successfully dereferenced to access the values inside the
3 # structs.
5 [require]
6 GLSL >= 1.20
8 [vertex shader]
9 void main()
11   gl_Position = gl_Vertex;
14 [fragment shader]
15 struct Foo {
16   int value;
18   /* A second member of a different size helps ensures we calculate member
19    * offsets correctly.
20    */
21   ivec2 value2;
24 uniform int i;
25 uniform ivec2 expected_value;
27 void main()
29   ivec2 actual_value = Foo[2](Foo(100, ivec2(200, 300)),
30                               Foo(400, ivec2(500, 600)))[i].value2;
31   if (actual_value == expected_value)
32     gl_FragColor = vec4(0.0, 1.0, 0.0, 1.0);
33   else
34     gl_FragColor = vec4(1.0, 0.0, 0.0, 1.0);
37 [test]
38 uniform int i 0
39 uniform ivec2 expected_value 200 300
40 draw rect -1 -1 2 1
41 uniform int i 1
42 uniform ivec2 expected_value 500 600
43 draw rect -1 0 2 1
44 probe all rgba 0.0 1.0 0.0 1.0