John Kessenich | c027579 | 2013-08-09 17:14:49 +0000 | [diff] [blame] | 1 | #version 400 core
|
| 2 |
|
| 3 | void main()
|
| 4 | {
|
| 5 | EmitStreamVertex(1);
|
| 6 | EndStreamPrimitive(0);
|
| 7 | EmitVertex();
|
| 8 | EndPrimitive();
|
John Kessenich | e7c59c1 | 2013-10-16 22:28:35 +0000 | [diff] [blame] | 9 | int id = gl_InvocationID;
|
John Kessenich | c027579 | 2013-08-09 17:14:49 +0000 | [diff] [blame] | 10 | }
|
John Kessenich | 94fdd11 | 2013-10-23 19:34:05 +0000 | [diff] [blame] | 11 |
|
John Kessenich | 7c908d2 | 2013-12-18 03:06:24 +0000 | [diff] [blame] | 12 | layout(invocations = 4) in outbn { int a; } bn[]; // ERROR, not on a block
|
| 13 | layout(max_vertices = 127) out;
|
| 14 | layout(invocations = 4) in;
|
John Kessenich | 9497485 | 2013-10-24 22:41:04 +0000 | [diff] [blame] | 15 |
|
| 16 | #extension GL_ARB_separate_shader_objects : enable
|
| 17 |
|
| 18 | in gl_PerVertex { // testing input arrays with a block redeclaration, see 420.geom for without
|
| 19 | vec4 gl_Position;
|
John Kessenich | c719481 | 2013-12-09 00:37:46 +0000 | [diff] [blame] | 20 | layout(std140, location = 3) patch float gl_PointSize; // ERRORs...
|
John Kessenich | 9497485 | 2013-10-24 22:41:04 +0000 | [diff] [blame] | 21 | } gl_in[];
|
| 22 |
|
| 23 | void foo()
|
| 24 | {
|
| 25 | gl_in.length(); // ERROR
|
| 26 | gl_in[1].gl_Position;
|
| 27 | }
|
| 28 |
|
| 29 | in vec4 color[];
|
| 30 | in vec4 color2[];
|
| 31 | in vec4 colorS[3];
|
| 32 | in vec4 colorBad[4];
|
| 33 |
|
| 34 | void foo2()
|
| 35 | {
|
| 36 | color.length(); // ERROR
|
| 37 | colorS.length();
|
| 38 | }
|
| 39 |
|
| 40 | layout(triangles) in; // give ERROR just for colorBad
|
| 41 |
|
| 42 | in vec4 color[3];
|
| 43 | in vec4 color2[3];
|
| 44 | in vec4 colorbad2[2]; // ERROR
|
| 45 |
|
| 46 | void foo3()
|
| 47 | {
|
| 48 | gl_in.length();
|
| 49 | color.length();
|
| 50 | color2.length();
|
| 51 | colorS.length();
|
| 52 | }
|
John Kessenich | 521ca37 | 2013-12-05 20:58:16 +0000 | [diff] [blame] | 53 |
|
| 54 | layout(location = 4) in vec4 cva[3];
|
| 55 | layout(location = 5) in vec4 cvb[3];
|
| 56 | layout(location = 2) in mat3 cmc[3]; // ERROR, collision
|
John Kessenich | 116c30b | 2013-12-12 01:25:37 +0000 | [diff] [blame] | 57 |
|
John Kessenich | 7c908d2 | 2013-12-18 03:06:24 +0000 | [diff] [blame] | 58 | patch in vec4 patchIn[]; // ERROR
|
| 59 | patch out vec4 patchOut; // ERROR
|
| 60 |
|
| 61 | in float scalar; // ERROR, no array
|
| 62 |
|
| 63 | layout(max_vertices = 127, invocations = 4) out; // ERROR
|
| 64 | layout(invocations = 4, max_vertices = 127) in; // ERROR
|
| 65 | layout(max_vertices = 127, invocations = 4) uniform; // 2 ERRORs
|
| 66 |
|
| 67 | in inblockscalar {
|
| 68 | int a;
|
| 69 | } inbls; // ERROR, not an array
|
| 70 |
|
| 71 | in inblocka {
|
| 72 | int a;
|
| 73 | } inbla[17]; // ERROR, wrong array size
|
John Kessenich | be70339 | 2014-08-13 20:04:19 +0000 | [diff] [blame] | 74 |
|
| 75 | void bits()
|
| 76 | {
|
| 77 | uvec2 u2;
|
| 78 | u2 = uaddCarry(u2, u2, u2);
|
| 79 | uint u1;
|
| 80 | u1 = usubBorrow(u1, u1, u1);
|
| 81 | uvec4 u4;
|
| 82 | umulExtended(u4, u4, u4, u4);
|
| 83 | ivec4 i4;
|
| 84 | imulExtended(i4, i4, i4, i4);
|
| 85 | int i1;
|
| 86 | i1 = bitfieldExtract(i1, 4, 5);
|
| 87 | uvec3 u3;
|
| 88 | u3 = bitfieldExtract(u3, 4, 5);
|
| 89 | ivec3 i3;
|
| 90 | i3 = bitfieldInsert(i3, i3, 4, 5);
|
| 91 | u1 = bitfieldInsert(u1, u1, 4, 5);
|
| 92 | ivec2 i2;
|
| 93 | i2 = bitfieldReverse(i2);
|
| 94 | u4 = bitfieldReverse(u4);
|
| 95 | i1 = bitCount(i1);
|
| 96 | i3 = bitCount(u3);
|
| 97 | i2 = findLSB(i2);
|
| 98 | i4 = findLSB(u4);
|
| 99 | i1 = findMSB(i1);
|
| 100 | i2 = findMSB(u2);
|
| 101 | }
|
John Kessenich | aa657c1 | 2014-08-19 02:12:44 +0000 | [diff] [blame] | 102 |
|
| 103 | layout(location = 7, index = 1) out vec4 indexedOut;
|