John Kessenich | e17ef84 | 2013-10-28 19:49:16 +0000 | [diff] [blame] | 1 | #version 420 core
|
John Kessenich | 9497485 | 2013-10-24 22:41:04 +0000 | [diff] [blame] | 2 |
|
| 3 | // testing input arrays without a gl_in[] block redeclaration, see 400.geom for with
|
| 4 |
|
| 5 | int i;
|
| 6 |
|
| 7 | void foo()
|
| 8 | {
|
| 9 | gl_in.length(); // ERROR
|
| 10 | gl_in[1].gl_Position;
|
| 11 | gl_in[i].gl_Position; // ERROR
|
| 12 | }
|
| 13 |
|
| 14 | layout(triangles) in;
|
| 15 |
|
| 16 | in vec4 color3[3];
|
| 17 |
|
| 18 | void foo3()
|
| 19 | {
|
| 20 | gl_in.length();
|
| 21 | gl_in[i].gl_Position;
|
| 22 | color3.length();
|
| 23 | }
|
John Kessenich | e17ef84 | 2013-10-28 19:49:16 +0000 | [diff] [blame] | 24 |
|
| 25 | uniform sampler2D s2D;
|
John Kessenich | 7c908d2 | 2013-12-18 03:06:24 +0000 | [diff] [blame] | 26 | in vec2 coord[];
|
John Kessenich | e17ef84 | 2013-10-28 19:49:16 +0000 | [diff] [blame] | 27 | uniform vec4 v4;
|
| 28 |
|
| 29 | void foo4()
|
| 30 | {
|
| 31 | const ivec2 offsets[5] =
|
| 32 | {
|
| 33 | ivec2(0,1),
|
| 34 | ivec2(1,-2),
|
| 35 | ivec2(0,3),
|
| 36 | ivec2(-3,0),
|
| 37 | ivec2(2,1)
|
| 38 | };
|
| 39 |
|
John Kessenich | 7c908d2 | 2013-12-18 03:06:24 +0000 | [diff] [blame] | 40 | vec4 v = textureGatherOffset(s2D, coord[0], offsets[i].xy);
|
John Kessenich | e17ef84 | 2013-10-28 19:49:16 +0000 | [diff] [blame] | 41 |
|
| 42 | offsets[i].xy = ivec2(3); // ERROR
|
| 43 | v4.x = 3.2; // ERROR
|
| 44 | v4.xy; // should have non-uniform type
|
| 45 | }
|
John Kessenich | c719481 | 2013-12-09 00:37:46 +0000 | [diff] [blame] | 46 |
|
| 47 | out gl_PerVertex {
|
| 48 | float gl_PointSize[1]; // ERROR, adding array
|
| 49 | float gl_ClipDistance; // ERROR, removing array
|
| 50 | };
|
John Kessenich | 8a1a4a7 | 2014-05-06 06:02:01 +0000 | [diff] [blame] | 51 |
|
| 52 | float foo5()
|
| 53 | {
|
| 54 | return i; // implicit conversion of return type
|
| 55 | }
|