3 layout(local_size_x = 2) in;
\r
4 layout(local_size_x = 16) in; // ERROR, changing
\r
5 layout(local_size_z = 4096) in; // ERROR, too large
\r
6 layout(local_size_x = 2) in;
\r
7 layout(local_size_y = 0) in; // ERROR, 0 not allowed
\r
8 const int total = gl_MaxComputeWorkGroupCount.y
\r
9 + gl_MaxComputeUniformComponents
\r
10 + gl_MaxComputeTextureImageUnits
\r
11 + gl_MaxComputeImageUniforms
\r
12 + gl_MaxComputeAtomicCounters
\r
13 + gl_MaxComputeAtomicCounterBuffers;
\r
15 buffer ShaderStorageBlock
\r
21 buffer InvalidShaderStorageBlock
\r
23 float values[]; // ERROR
\r
31 memoryBarrierAtomicCounter();
\r
32 memoryBarrierBuffer();
\r
33 memoryBarrierShared();
\r
34 memoryBarrierImage();
\r
35 groupMemoryBarrier();
\r
36 value = int(values[gl_LocalInvocationIndex]);
\r
39 layout(location = 2) in vec3 v3; // ERROR
\r
40 in float f; // ERROR
\r
41 out float fo; // ERROR
\r
44 layout(location = 2) shared vec4 sl; // ERROR
\r
45 shared float fs = 4.2; // ERROR
\r
47 layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out; // ERROR
\r
49 int arrX[gl_WorkGroupSize.x];
\r
50 int arrY[gl_WorkGroupSize.y];
\r
51 int arrZ[gl_WorkGroupSize.z];
\r
53 readonly buffer roblock
\r
61 ro.values[2] = 4.7; // ERROR, readonly
\r
66 buffer vec4 v; // ERROR
\r
68 uniform usampler2D us2dbad; // ERROR, default precision
\r
70 precision highp usampler2D;
\r
71 precision highp iimage2DArray;
\r
72 precision highp iimage2D;
\r
74 uniform usampler2D us2d;
\r
76 uniform iimage2DArray ii2dabad; // ERROR, not writeonly
\r
77 uniform writeonly iimage2DArray ii2da;
\r
79 layout(r32i) uniform iimage2D iimg2D;
\r
80 layout(rgba32i) uniform readonly iimage2D iimg2Drgba;
\r
81 layout(rgba32f) uniform readonly image2D img2Drgba; // ERROR, no default
\r
82 layout(r32ui) uniform uimage2D uimg2D; // ERROR, no default
\r
87 imageAtomicCompSwap(iimg2D, ivec2(i,i), i, i);// ERROR no longer in 310
\r
88 imageAtomicAdd(uimg2D, ivec2(i,i), uint(i)); // ERROR no longer in 310
\r
89 imageAtomicMin(iimg2Drgba, ivec2(i,i), i); // ERROR no longer in 310 // ERROR iimg2Drgba does not have r32i layout
\r
90 imageAtomicMax(img2Drgba, ivec2(i,i), i); // ERROR no longer in 310 // ERROR img2Drgba is not integer image
\r
91 ivec4 pos = imageLoad(iimg2D, ivec2(i,i));
\r
92 imageStore(ii2da, ivec3(i,i,i), ivec4(0));
\r
93 imageLoad(img2Drgba, ivec2(i,i));
\r
94 imageLoad(ii2da, ivec3(i,i,i)); // ERROR, drops writeonly
\r
97 volatile float vol; // ERROR, not an image
\r
98 readonly int vol2; // ERROR, not an image
\r
100 void passr(coherent readonly iimage2D image)
\r
104 layout(r32i) coherent readonly uniform iimage2D qualim1;
\r
105 layout(r32i) coherent restrict readonly uniform iimage2D qualim2;
\r
109 passr(qualim1); // ERROR, changing formats
\r
110 passr(qualim2); // ERROR, drops restrict, ERROR, changing formats
\r
111 passr(iimg2D); // ERROR, changing formats
\r
114 highp layout(rg8i) uniform readonly uimage2D i1bad; // ERROR, type mismatch
\r
115 highp layout(rgba32i) uniform readonly image2D i2bad; // ERROR, type mismatch
\r
116 highp layout(rgba32f) uniform readonly uimage2D i3bad; // ERROR, type mismatch
\r
117 layout(r8_snorm) uniform readonly iimage2D i4bad; // ERROR, type mismatch
\r
118 layout(rgba32ui) uniform readonly iimage2D i5bad; // ERROR, type mismatch
\r
119 layout(r8ui) uniform readonly iimage2D i6bad; // ERROR, type mismatch
\r
121 layout(binding = 0) uniform atomic_uint counter;
\r
123 uint func(atomic_uint c)
\r
125 return atomicCounterIncrement(c);
\r
128 uint func2(out atomic_uint c) // ERROR, output
\r
130 return counter; // ERROR, type mismatch
\r
131 return atomicCounter(counter);
\r
136 atomic_uint non_uniform_counter; // ERROR
\r
137 uint val = atomicCounter(counter);
\r
138 atomicCounterDecrement(counter);
\r
141 layout(binding = 1) uniform mediump atomic_uint counterBad; // ERROR, not highp
\r
143 layout(binding = 2, offset = 4) uniform atomic_uint countArr[4];
\r
149 a[counter]; // ERROR, non-integer
\r
159 int origi = atomicAdd(atomi, 3);
\r
160 uint origu = atomicAnd(atomu, 7u);
\r
161 origi = atomicExchange(atomi, 4);
\r
162 origu = atomicCompSwap(atomu, 10u, 8u);
\r
165 precision highp atomic_uint;
\r
166 precision lowp atomic_uint; // ERROR
\r
168 precise int pfoo; // ERROR, reserved
\r
170 dmat2x4 dm; // ERROR
\r
171 uniform samplerCubeArray sca; // ERROR
\r
172 uniform iimage2DRect i2dr; // ERROR
\r
173 highp uniform image2DMS i2dms; // ERROR
\r
174 uniform uimage2DMSArray u2dmsa; // ERROR
\r
176 highp layout(r32f) coherent volatile restrict readonly writeonly uniform image2D okay1;
\r
177 layout(r32i) coherent volatile restrict readonly uniform iimage2D okay2;
\r
178 highp layout(r32ui) coherent volatile restrict writeonly uniform uimage2D okay3;
\r
179 highp layout(r32f) coherent volatile restrict uniform image2D okay4;
\r
181 highp layout(rgba32f) coherent volatile restrict uniform image2D badQ1; // ERROR, bad qualifiers
\r
182 layout(rgba8i) coherent volatile restrict uniform iimage2D badQ2; // ERROR, bad qualifiers
\r
183 highp layout(rgba16ui) coherent volatile restrict uniform uimage2D badQ3; // ERROR, bad qualifiers
\r
185 writeonly buffer woblock
\r
194 g = wo.values[2]; // ERROR, writeonly
\r
195 float f = wo.values[2]; // ERROR, writeonly
\r
196 ++wo.values[2]; // ERROR, writeonly
\r
197 wo.values[2]--; // ERROR, writeonly
\r
198 f + wo.values[2]; // ERROR, writeonly
\r
199 wo.values[2] - f; // ERROR, writeonly
\r
201 b ? f : wo.values[2]; // ERROR, writeonly
\r
202 b ? wo.values[2] : f; // ERROR, writeonly
\r
203 if (f == wo.values[2]) // ERROR, writeonly
\r
205 if (f >= wo.values[2]) // ERROR, writeonly
\r
207 f = vec3(wo.values[2]).x; // ERROR, writeonly
\r
208 ~wo.value; // ERROR, writeonly
\r
209 wo.values[2] = 3.4;
\r
214 readonly int value;
\r
215 writeonly float values[];
\r
221 g = wo.values[2]; // ERROR, writeonly
\r
223 wo.values[2] = 3.4;
\r
224 wo.value = 2; // ERROR, readonly
\r
231 out outb { // ERROR
\r
235 float t__; // ERROR, no __ until revision 310
237 // ERROR, no __ until revision 310
240 shared vec4 arr[2][3][4];
244 gl_DeviceIndex; // ERROR, no extension
245 gl_ViewIndex; // ERROR, never this stage
248 #ifdef GL_EXT_device_group
249 #extension GL_EXT_device_group : enable
255 gl_ViewIndex; // ERROR, never this stage