forked from KhronosGroup/glslang
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path430.vert
223 lines (172 loc) · 6.4 KB
/
430.vert
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
#version 430 core
layout(location = 3) vec4 v4; // ERROR
layout(location = 4) uniform vec4 uv4;
layout(location = 2) in inb1 { vec4 v; } b1; // ERROR
layout(location = 2) out outb1 { vec4 v; } b2; // ERROR
out gl_PerVertex {
float gl_ClipDistance[];
};
void foo()
{
gl_ClipDistance[2] = 3.7;
}
struct sp {
highp float f;
in float g; // ERROR
uniform float h; // ERROR
invariant float i; // ERROR
volatile float j; // ERROR
layout(row_major) mat3 m3; // ERROR
};
void foo3(invariant vec4 v4, // ERROR
volatile vec3 v3,
layout(location = 3) vec2 v2, // ERROR
centroid vec3 cv3) // ERROR
{
}
struct S {
mat3x2 m[7]; // needs 7*3 locations
float f; // needs 1 location
}; // needs 22 locations
layout(location = 10) out S cs[2]; // 10 through 10 + 2 * 22 - 1 = 53
layout(location = 54) out float cf;
layout(location = 53) out float cg; // ERROR, collision at 31
layout(location = 10) in vec4 alias1;
layout(location = 10) in vec4 alias2; // okay for vertex input on desktop
out float gl_ClipDistance[17]; // ERROR, size too big
// enhanced_layouts (most tests are in 440.*)
layout(location = start*start - 2 - 4) in vec4 v6e; // ERROR
layout(location = 28) in inblock2e {
layout(location = 25) float f2; // ERROR
} ininst2e;
in ublock4e {
layout(location = 50) float f1; // ERROR
layout(location = 51) float f2; // ERROR
} in4e;
layout(align=16, std140) uniform ubl4e { int a; } inst4e;// ERROR
layout(align=32) uniform ubl9e { // ERROR
layout(offset=12, align=4) float f; // ERROR
layout(offset=20) float g; // ERROR
} inst9e;
layout(std140) uniform blocke {
vec4 a;
layout(offset = 32) vec3 b; // ERROR
} spinste;
int aconste[gl_MaxTransformFeedbackBuffers]; // ERROR
int bconste[gl_MaxTransformFeedbackInterleavedComponents]; // ERROR
out bblck2 {
layout(xfb_offset=64) vec4 bbv; // ERROR
} bbinst2;
layout(xfb_buffer = 3, xfb_stride = 64) out; // ERROR
layout(xfb_buffer=2, xfb_offset=48, xfb_stride=80) out vec4 bge; // ERROR
layout( xfb_offset=32, xfb_stride=64) out vec4 bhe; // ERROR
layout(xfb_stride=80, xfb_buffer=2, xfb_offset=16) out bblck4e { // ERROR
vec4 bbv1;
vec4 bbv2;
} bbinst4e;
out bblck5e {
layout(xfb_offset=0) vec4 bbv1; // ERROR
layout(xfb_stride=64, xfb_buffer=3, xfb_offset=48) vec4 bbv2; // ERROR
} bbinst5e;
#extension GL_ARB_enhanced_layouts : enable
layout(align=16, std140) uniform ubl4 { int a; } inst4;
layout(std430) uniform;
layout(align=32) uniform ubl9 {
layout(offset=12, align=4) float f;
layout(offset=20) float g;
} inst9;
layout(std140) uniform block {
vec4 a; // a takes offsets 0-15
layout(offset = 32) vec3 b; // b takes offsets 32-43
} spinst;
int aconst[gl_MaxTransformFeedbackBuffers];
int bconst[gl_MaxTransformFeedbackInterleavedComponents];
const int start2 = 5;
layout(location = start2 * start2 - 2 - 4) in vec4 v6;
layout(location = 28) in inblock2 { // ERROR, input block in vertex shader, other errors are valid checks still...
bool b1;
float f1;
layout(location = 25) float f2;
} ininst2;
in ublock4 { // ERROR, input block in vertex shader, other errors are valid checks still...
layout(location = 50) float f1;
layout(location = 51) float f2;
} in4;
out bblck2g {
layout(xfb_offset=64) vec4 bbv;
} bbinst2g;
layout(xfb_buffer = 1, xfb_stride = 80) out; // default buffer is 3
layout(xfb_buffer=1, xfb_offset=48, xfb_stride=80) out vec4 bg;
layout( xfb_offset=32, xfb_stride=80) out vec4 bh;
layout(xfb_stride=80, xfb_buffer=1, xfb_offset=16) out bblck4 {
vec4 bbv1;
} bbinst4;
out bblck5 {
layout(xfb_offset=0) vec4 bbv1;
layout(xfb_stride=80, xfb_buffer=1, xfb_offset=64) vec4 bbv2;
} bbinst5;
shared vec4 sharedv; // ERROR
void fooBarrier()
{
barrier(); // ERROR
memoryBarrier();
memoryBarrierAtomicCounter();
memoryBarrierBuffer();
memoryBarrierShared(); // ERROR
memoryBarrierImage();
groupMemoryBarrier(); // ERROR
}
buffer vec4 v; // ERROR
uniform sampler2DMS s2dms;
uniform usampler2DMSArray us2dmsa;
layout(rgba32i) uniform iimage2DMS ii2dms;
layout(rgba32f) uniform image2DMSArray i2dmsa;
void fooq()
{
int s = textureSamples(s2dms); // ERROR
s += textureSamples(us2dmsa); // ERROR
s += imageSamples(ii2dms); // ERROR
s += imageSamples(i2dmsa); // ERROR
}
#extension GL_ARB_shader_texture_image_samples : enable
void fooq2()
{
int s = textureSamples(s2dms);
s += textureSamples(us2dmsa);
s += imageSamples(ii2dms);
s += imageSamples(i2dmsa);
}
uniform sampler1D samp1D;
uniform usampler2D usamp2D;
uniform isampler3D isamp3D;
uniform isamplerCube isampCube;
uniform isampler1DArray isamp1DA;
uniform sampler2DArray samp2DA;
uniform usamplerCubeArray usampCubeA;
uniform sampler1DShadow samp1Ds;
uniform sampler2DShadow samp2Ds;
uniform samplerCubeShadow sampCubes;
uniform sampler1DArrayShadow samp1DAs;
uniform sampler2DArrayShadow samp2DAs;
uniform samplerCubeArrayShadow sampCubeAs;
uniform samplerBuffer sampBuf;
uniform sampler2DRect sampRect;
void qlod()
{
int levels;
levels = textureQueryLevels(samp1D);
levels = textureQueryLevels(usamp2D);
levels = textureQueryLevels(isamp3D);
levels = textureQueryLevels(isampCube);
levels = textureQueryLevels(isamp1DA);
levels = textureQueryLevels(samp2DA);
levels = textureQueryLevels(usampCubeA);
levels = textureQueryLevels(samp1Ds);
levels = textureQueryLevels(samp2Ds);
levels = textureQueryLevels(sampCubes);
levels = textureQueryLevels(samp1DAs);
levels = textureQueryLevels(samp2DAs);
levels = textureQueryLevels(sampCubeAs);
levels = textureQueryLevels(sampBuf); // ERROR
levels = textureQueryLevels(sampRect); // ERROR
}