3 // Note 'location'-only tests for enhanced layouts are in 330.frag
\r
4 // Generic 'component' tests are in 440.vert
\r
6 // a consumes components 2 and 3 of location 4
\r
7 layout(location = 4, component = 2) in vec2 a;
\r
9 // b consumes component 1 of location 4
\r
10 layout(location = 4, component = 1) in float b;
\r
11 layout(location = 4, component = 2) in vec2 h; // ERROR, component overlap not okay for fragment in
\r
13 layout(location = 3, component = 2) in vec3 c; // ERROR: c overflows components 2 and 3
\r
15 // e consumes beginning (components 0, 1 and 2) of each of 6 slots
\r
16 layout(location = 20, component = 0) in vec3 e[6];
\r
18 // f consumes last component of the same 6 slots
\r
19 layout(location = 20, component = 3) in float f[6];
\r
21 layout(location = 30, component = 3) out int be;
\r
22 layout(location = 30, component = 0) out vec3 bf; // ERROR, not the same basic type
\r
24 writeonly uniform; // ERROR
\r
25 readonly in; // ERROR
\r
29 layout(offset=12) uniform; // ERROR
\r
30 layout(offset=12) in; // ERROR
\r
31 layout(offset=12) out; // ERROR
\r
33 layout(align=16) uniform; // ERROR
\r
34 layout(align=16) in; // ERROR
\r
35 layout(align=16) out; // ERROR
\r
37 layout(offset=12) uniform ubl1 { int a; } inst1; // ERROR
\r
38 layout(offset=12) in inbl2 { int a; } inst2; // ERROR
\r
39 layout(offset=12) out inbl3 { int a; } inst3; // ERROR
\r
41 layout(align=16, std140) uniform ubl4 { int a; } inst4;
\r
42 layout(align=16) uniform ubl8 { int a; } inst8; // ERROR, no packing
\r
43 layout(align=16) in inbl5 { int a; } inst5; // ERROR
\r
44 layout(align=16) out inbl6 { int a; } inst6; // ERROR
\r
46 layout(offset=12) uniform vec4 v1; // ERROR
\r
47 layout(offset=12) in vec4 v2; // ERROR
\r
48 layout(offset=12) out vec4 v3; // ERROR
\r
50 layout(align=16) uniform vec4 v4; // ERROR
\r
51 layout(align=16) in vec4 v5; // ERROR
\r
52 layout(align=16) out vec4 v6; // ERROR
\r
54 layout(std140) in; // ERROR
\r
55 layout(std140) uniform vec4 v7; // ERROR
\r
57 layout(align=48) uniform ubl7 { // ERROR, not power of 2
\r
58 layout(offset=12, align=4) float f; // ERROR, no packing
\r
62 layout(offset=12) float f; // ERROR
\r
63 layout(align=4) float g; // ERROR
\r
66 layout(std430) uniform;
\r
68 layout(align=32) uniform ubl9 {
\r
70 layout(offset=12, align=4) float f;
\r
71 layout(offset=20) float g;
\r
76 layout(offset=12, align=4) float f;
\r
80 layout(std140) uniform block {
\r
81 vec4 a; // a takes offsets 0-15
\r
82 layout(offset = 32) vec3 b; // b takes offsets 32-43
\r
83 layout(offset = 40) vec2 c; // ERROR, lies within previous member
\r
84 layout(align = 6) double g; // ERROR, 6 is not a power of 2
\r
85 layout(offset=68) double h; // ERROR, offset not aligned
\r
86 } specExampleErrors;
\r
88 layout(std140) uniform block2 {
\r
89 vec4 a; // a takes offsets 0-15
\r
90 layout(offset = 32) vec3 b; // b takes offsets 32-43
\r
91 layout(offset = 48) vec2 d; // d takes offsets 48-55
\r
92 layout(align = 16) float e; // e takes offsets 64-67
\r
93 layout(align = 2) double f; // f takes offsets 72-79
\r
94 layout(offset = 80) float h; // h takes offsets 80-83
\r
95 layout(align = 64) dvec3 i; // i takes offsets 128-151
\r
96 layout(offset = 164, align = 8) float j; // j takes offsets 168-171
\r
99 layout(std430) uniform block430 {
\r
100 vec4 a; // a takes offsets 0-15
\r
101 layout(offset = 32) vec3 b; // b takes offsets 32-43
\r
102 layout(offset = 40) vec2 c; // ERROR, lies within previous member
\r
103 layout(align = 6) double g; // ERROR, 6 is not a power of 2
\r
104 layout(offset=68) double h; // ERROR, offset not aligned
\r
105 layout(align = 0) double i; // ERROR, 0 not a power of 2
\r
106 } specExampleErrors430;
\r
108 layout(std430) uniform block2430 {
\r
109 vec4 a; // a takes offsets 0-15
\r
110 layout(offset = 32) vec3 b; // b takes offsets 32-43
\r
111 layout(offset = 48) vec2 d; // d takes offsets 48-55
\r
112 layout(align = 16) float e; // e takes offsets 64-67
\r
113 layout(align = 2) double f; // f takes offsets 72-79
\r
114 layout(offset = 80) float h; // h takes offsets 80-83
\r
115 layout(align = 64) dvec3 i; // i takes offsets 128-151
\r
116 layout(offset = 164, align = 8) float j; // j takes offsets 168-171
\r
119 layout(std430, align = 128) uniform block24300 {
\r
129 layout(std430, align = 128) uniform block24301 {
\r
133 layout(offset=388) float e;
\r
134 layout(align=8) double f;
\r
139 int aconst[gl_MaxTransformFeedbackBuffers];
\r
140 int bconst[gl_MaxTransformFeedbackInterleavedComponents];
\r