Fix slight inconsistencies in which qualifiers are inherited into block members:
[platform/upstream/glslang.git] / Test / 430.vert
1 #version 430 core\r
2 \r
3 layout(location = 3) vec4 v4;  // ERROR\r
4 \r
5 layout(location = 4) uniform vec4 uv4;\r
6 \r
7 layout(location = 2) in   inb1 { vec4 v; } b1;  // ERROR\r
8 layout(location = 2) out outb1 { vec4 v; } b2;  // ERROR\r
9 \r
10 out gl_PerVertex {\r
11     float gl_ClipDistance[];\r
12 };\r
13 \r
14 void foo()\r
15 {\r
16     gl_ClipDistance[2] = 3.7;\r
17 }\r
18 \r
19 struct sp {\r
20     highp float f;\r
21     in float g;             // ERROR\r
22     uniform float h;        // ERROR\r
23     invariant float i;      // ERROR\r
24     volatile float j;       // ERROR\r
25     layout(row_major) mat3 m3; // ERROR\r
26 };\r
27 \r
28 void foo3(invariant vec4 v4,                 // ERROR\r
29           volatile vec3 v3,\r
30           layout(location = 3) vec2 v2,      // ERROR\r
31           centroid vec3 cv3)                 // ERROR\r
32 {\r
33 }\r
34 \r
35 struct S {\r
36     mat3x2 m[7];  // needs 7*3 locations\r
37     float f;      // needs 1 location\r
38 };                // needs 22 locations\r
39 \r
40 layout(location = 10) out S cs[2];     // 10 through 10 + 2 * 22 - 1 = 53\r
41 layout(location = 54) out float cf;\r
42 layout(location = 53) out float cg; // ERROR, collision at 31\r
43 \r
44 layout(location = 10) in vec4 alias1;\r
45 layout(location = 10) in vec4 alias2;  // okay for vertex input on desktop\r
46 \r
47 out float gl_ClipDistance[17];  // ERROR, size too big