John Kessenich | dadf945 | 2013-02-11 00:54:44 +0000 | [diff] [blame] | 1 | #version 100 |
| 2 | |
John Kessenich | fb7044a | 2013-06-13 20:16:43 +0000 | [diff] [blame] | 3 | float gu[]; // ERROR |
John Kessenich | dadf945 | 2013-02-11 00:54:44 +0000 | [diff] [blame] | 4 | float g4[4]; |
| 5 | float g5[5]; |
| 6 | |
| 7 | uniform int a; |
| 8 | |
| 9 | float[4] foo(float[5] a) // ERROR // ERROR |
| 10 | { |
| 11 | return float[](a[0], a[1], a[2], a[3]); // ERROR |
| 12 | } |
| 13 | |
| 14 | void bar(float[5]) {} |
| 15 | |
| 16 | void main() |
| 17 | { |
| 18 | { |
| 19 | float gu[2]; // okay, new scope |
| 20 | |
| 21 | gu[2] = 4.0; // ERROR, overflow |
| 22 | } |
| 23 | |
John Kessenich | 816e9bc | 2013-10-04 21:09:36 +0000 | [diff] [blame] | 24 | g4 = foo(g5); // ERROR |
John Kessenich | dadf945 | 2013-02-11 00:54:44 +0000 | [diff] [blame] | 25 | g5 = g4; // ERROR |
| 26 | gu = g4; // ERROR |
| 27 | |
| 28 | foo(gu); // ERROR |
| 29 | bar(g5); |
| 30 | |
| 31 | if (float[4](1.0, 2.0, 3.0, 4.0) == g4) // ERROR |
| 32 | gu[0] = 2.0; |
| 33 | |
John Kessenich | dadf945 | 2013-02-11 00:54:44 +0000 | [diff] [blame] | 34 | float u[5]; |
| 35 | u[5] = 5.0; // ERROR |
| 36 | foo(u); // okay |
| 37 | |
| 38 | gl_FragData[1000] = vec4(1.0); // ERROR |
| 39 | gl_FragData[-1] = vec4(1.0); // ERROR |
| 40 | gl_FragData[3] = vec4(1.0); |
| 41 | } |
John Kessenich | 67c9f3a | 2013-11-12 01:02:51 +0000 | [diff] [blame] | 42 | |
| 43 | struct SA { |
| 44 | vec3 v3; |
| 45 | vec2 v2[4]; |
| 46 | }; |
| 47 | |
| 48 | struct SB { |
| 49 | vec4 v4; |
| 50 | SA sa; |
| 51 | }; |
| 52 | |
| 53 | SB bar9() |
| 54 | { |
| 55 | SB s; |
| 56 | return s; // ERROR |
| 57 | } |
| 58 | |
| 59 | void bar10(SB s) // okay |
| 60 | { |
| 61 | } |
| 62 | |
| 63 | void bar11() |
| 64 | { |
| 65 | SB s1, s2; |
| 66 | s1 = s2; // ERROR |
| 67 | bar10(s1); |
| 68 | s2 = bar9(); // ERROR |
John Kessenich | ffa66d3 | 2013-11-12 22:02:36 +0000 | [diff] [blame] | 69 | SB initSb = s1; // ERROR |
John Kessenich | 67c9f3a | 2013-11-12 01:02:51 +0000 | [diff] [blame] | 70 | } |