blob: c09b4ce6de8e974a401e83ee3d56b57b2af37093 [file] [log] [blame]
John Kessenichc0275792013-08-09 17:14:49 +00001#version 150 core
2
John Kesseniche7c59c12013-10-16 22:28:35 +00003in fromVertex {
4 vec3 color;
5} fromV;
6
7out toFragment {
8 vec3 color;
9} toF;
10
11out fromVertex { // okay to reuse a block name for another block name
12 vec3 color;
13};
14
15out fooB {
16 vec2 color;
17} fromVertex; // ERROR, cannot reuse block name as block instance
18
19int fromVertex; // ERROR, cannot reuse a block name for something else
20
21out fooC {
22 vec2 color;
23} fooC; // ERROR, cannot have same name for block and instance name
24
John Kessenichc0275792013-08-09 17:14:49 +000025void main()
26{
27 EmitVertex();
28 EndPrimitive();
29 EmitStreamVertex(1); // ERROR
30 EndStreamPrimitive(0); // ERROR
John Kesseniche7c59c12013-10-16 22:28:35 +000031
32 color = fromV.color;
33 gl_ClipDistance[3] = gl_in[1].gl_ClipDistance[2];
34 gl_Position = gl_in[0].gl_Position;
35 gl_PointSize = gl_in[3].gl_PointSize;
36 gl_PrimitiveID = gl_PrimitiveIDIn;
37 gl_Layer = 2;
John Kessenichc0275792013-08-09 17:14:49 +000038}
John Kessenich94fdd112013-10-23 19:34:05 +000039
40out vec4 ov0; // stream should be 0
41layout(stream = 4) out vec4 ov4;
42out vec4 o1v0; // stream should be 0
43
44layout(stream = 3) uniform; // ERROR
45layout(stream = 3) in; // ERROR
46layout(stream = 3) uniform int ua; // ERROR
47layout(stream = 3) uniform ubb { int ua; } ibb; // ERROR
48
49layout(line_strip, points, triangle_strip, stream = 3, points, triangle_strip) out; // just means "stream = 3, triangle_strip"
50layout(stream = 3, triangle_strip) out;
51out vec4 ov3; // stream should be 3
52
53layout(stream = 6) out ooutb { vec4 a; } ouuaa6;
54
55layout(stream = 6) out ooutb {
56 layout(stream = 6) vec4 a;
57} ouua6;
58
59layout(stream = 7) out ooutb {
60 layout(stream = 6) vec4 a; // ERROR
61} ouua7;
62
63out vec4 ov2s3; // stream should be 3
64
65void foo(layout(max_vertices = 4) int a) // ERROR
66{
67 ouuaa6.a = vec4(1.0);
68}
69
70layout(line_strip, points, triangle_strip, stream = 3, points) out; // ERROR, changing output primitive
71layout(line_strip, points, stream = 3) out; // ERROR, changing output primitive
72layout(triangle_strip) in; // ERROR, not an input primitive
73layout(triangle_strip) uniform; // ERROR
74layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable
75layout(triangle_strip) in vec4 bad2v4; // ERROR, not on a variable or input
76layout(invocations = 3) out outbn { int a; }; // ERROR, not on a block
77out outbn {
78 layout(invocations = 3) int a; // ERROR, not on a block member
79 layout(max_vertices = 3) int b; // ERROR, not on a block member
80 layout(triangle_strip) int c; // ERROR, not on a block member
81} outbi;
82
83layout(lines) out; // ERROR, not on output
84layout(lines_adjancency) in;
85layout(triangles) in; // ERROR, can't change it
86layout(triangles_adjacency) in; // ERROR, can't change it
87
88layout(invocations = 4, max_vertices = 127) out;
89
90in inbn {
91 layout(stream = 2) int a; // ERROR, stream on input
92} inbi;