blob: 7fe9fc1c3880b6e6b69cdad8b23565a87bdac799 [file] [log] [blame]
John Kessenichc0275792013-08-09 17:14:49 +00001#version 400 core
2
3void main()
4{
5 EmitStreamVertex(1);
6 EndStreamPrimitive(0);
7 EmitVertex();
8 EndPrimitive();
John Kesseniche7c59c12013-10-16 22:28:35 +00009 int id = gl_InvocationID;
John Kessenichc0275792013-08-09 17:14:49 +000010}
John Kessenich94fdd112013-10-23 19:34:05 +000011
John Kessenich7c908d22013-12-18 03:06:24 +000012layout(invocations = 4) in outbn { int a; } bn[]; // ERROR, not on a block
13layout(max_vertices = 127) out;
14layout(invocations = 4) in;
John Kessenich94974852013-10-24 22:41:04 +000015
16#extension GL_ARB_separate_shader_objects : enable
17
18in gl_PerVertex { // testing input arrays with a block redeclaration, see 420.geom for without
19 vec4 gl_Position;
John Kessenichc7194812013-12-09 00:37:46 +000020 layout(std140, location = 3) patch float gl_PointSize; // ERRORs...
John Kessenich94974852013-10-24 22:41:04 +000021} gl_in[];
22
23void foo()
24{
25 gl_in.length(); // ERROR
26 gl_in[1].gl_Position;
27}
28
29in vec4 color[];
30in vec4 color2[];
31in vec4 colorS[3];
32in vec4 colorBad[4];
33
34void foo2()
35{
36 color.length(); // ERROR
37 colorS.length();
38}
39
40layout(triangles) in; // give ERROR just for colorBad
41
42in vec4 color[3];
43in vec4 color2[3];
44in vec4 colorbad2[2]; // ERROR
45
46void foo3()
47{
48 gl_in.length();
49 color.length();
50 color2.length();
51 colorS.length();
52}
John Kessenich521ca372013-12-05 20:58:16 +000053
54layout(location = 4) in vec4 cva[3];
55layout(location = 5) in vec4 cvb[3];
56layout(location = 2) in mat3 cmc[3]; // ERROR, collision
John Kessenich116c30b2013-12-12 01:25:37 +000057
John Kessenich7c908d22013-12-18 03:06:24 +000058patch in vec4 patchIn[]; // ERROR
59patch out vec4 patchOut; // ERROR
60
61in float scalar; // ERROR, no array
62
63layout(max_vertices = 127, invocations = 4) out; // ERROR
64layout(invocations = 4, max_vertices = 127) in; // ERROR
65layout(max_vertices = 127, invocations = 4) uniform; // 2 ERRORs
66
67in inblockscalar {
68 int a;
69} inbls; // ERROR, not an array
70
71in inblocka {
72 int a;
73} inbla[17]; // ERROR, wrong array size
John Kessenichbe703392014-08-13 20:04:19 +000074
75void 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 Kessenichaa657c12014-08-19 02:12:44 +0000102
103layout(location = 7, index = 1) out vec4 indexedOut;