John Kessenich | c027579 | 2013-08-09 17:14:49 +0000 | [diff] [blame] | 1 | #version 150 core
|
| 2 |
|
John Kessenich | e7c59c1 | 2013-10-16 22:28:35 +0000 | [diff] [blame] | 3 | in fromVertex {
|
| 4 | vec3 color;
|
| 5 | } fromV;
|
| 6 |
|
| 7 | out toFragment {
|
| 8 | vec3 color;
|
| 9 | } toF;
|
| 10 |
|
| 11 | out fromVertex { // okay to reuse a block name for another block name
|
| 12 | vec3 color;
|
| 13 | };
|
| 14 |
|
| 15 | out fooB {
|
| 16 | vec2 color;
|
| 17 | } fromVertex; // ERROR, cannot reuse block name as block instance
|
| 18 |
|
| 19 | int fromVertex; // ERROR, cannot reuse a block name for something else
|
| 20 |
|
| 21 | out fooC {
|
| 22 | vec2 color;
|
| 23 | } fooC; // ERROR, cannot have same name for block and instance name
|
| 24 |
|
John Kessenich | c027579 | 2013-08-09 17:14:49 +0000 | [diff] [blame] | 25 | void main()
|
| 26 | {
|
| 27 | EmitVertex();
|
| 28 | EndPrimitive();
|
| 29 | EmitStreamVertex(1); // ERROR
|
| 30 | EndStreamPrimitive(0); // ERROR
|
John Kessenich | e7c59c1 | 2013-10-16 22:28:35 +0000 | [diff] [blame] | 31 |
|
| 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 Kessenich | c027579 | 2013-08-09 17:14:49 +0000 | [diff] [blame] | 38 | }
|
John Kessenich | 94fdd11 | 2013-10-23 19:34:05 +0000 | [diff] [blame^] | 39 |
|
| 40 | out vec4 ov0; // stream should be 0
|
| 41 | layout(stream = 4) out vec4 ov4;
|
| 42 | out vec4 o1v0; // stream should be 0
|
| 43 |
|
| 44 | layout(stream = 3) uniform; // ERROR
|
| 45 | layout(stream = 3) in; // ERROR
|
| 46 | layout(stream = 3) uniform int ua; // ERROR
|
| 47 | layout(stream = 3) uniform ubb { int ua; } ibb; // ERROR
|
| 48 |
|
| 49 | layout(line_strip, points, triangle_strip, stream = 3, points, triangle_strip) out; // just means "stream = 3, triangle_strip"
|
| 50 | layout(stream = 3, triangle_strip) out;
|
| 51 | out vec4 ov3; // stream should be 3
|
| 52 |
|
| 53 | layout(stream = 6) out ooutb { vec4 a; } ouuaa6;
|
| 54 |
|
| 55 | layout(stream = 6) out ooutb {
|
| 56 | layout(stream = 6) vec4 a;
|
| 57 | } ouua6;
|
| 58 |
|
| 59 | layout(stream = 7) out ooutb {
|
| 60 | layout(stream = 6) vec4 a; // ERROR
|
| 61 | } ouua7;
|
| 62 |
|
| 63 | out vec4 ov2s3; // stream should be 3
|
| 64 |
|
| 65 | void foo(layout(max_vertices = 4) int a) // ERROR
|
| 66 | {
|
| 67 | ouuaa6.a = vec4(1.0);
|
| 68 | }
|
| 69 |
|
| 70 | layout(line_strip, points, triangle_strip, stream = 3, points) out; // ERROR, changing output primitive
|
| 71 | layout(line_strip, points, stream = 3) out; // ERROR, changing output primitive
|
| 72 | layout(triangle_strip) in; // ERROR, not an input primitive
|
| 73 | layout(triangle_strip) uniform; // ERROR
|
| 74 | layout(triangle_strip) out vec4 badv4; // ERROR, not on a variable
|
| 75 | layout(triangle_strip) in vec4 bad2v4; // ERROR, not on a variable or input
|
| 76 | layout(invocations = 3) out outbn { int a; }; // ERROR, not on a block
|
| 77 | out 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 |
|
| 83 | layout(lines) out; // ERROR, not on output
|
| 84 | layout(lines_adjancency) in;
|
| 85 | layout(triangles) in; // ERROR, can't change it
|
| 86 | layout(triangles_adjacency) in; // ERROR, can't change it
|
| 87 |
|
| 88 | layout(invocations = 4, max_vertices = 127) out;
|
| 89 |
|
| 90 | in inbn {
|
| 91 | layout(stream = 2) int a; // ERROR, stream on input
|
| 92 | } inbi;
|