blob: 178b9942d104f477d5bb449386a9f7249c08b19b [file] [log] [blame]
John Kessenichc0275792013-08-09 17:14:49 +00001#version 430 core
2
John Kessenich79cddfc2014-08-11 02:32:30 +00003layout(local_size_x = 2) in;
4layout(local_size_x = 16) in; // ERROR, changing
5layout(local_size_z = 4096) in; // ERROR, too large
6layout(local_size_x = 2) in;
7
8const int total = gl_MaxComputeWorkGroupCount.y
9 + gl_MaxComputeUniformComponents
10 + gl_MaxComputeTextureImageUnits
11 + gl_MaxComputeImageUniforms
12 + gl_MaxComputeAtomicCounters
13 + gl_MaxComputeAtomicCounterBuffers;
14
John Kessenich67cf1f62014-08-12 02:11:55 +000015buffer ShaderStorageBlock
16{
17 int value;
18 float values[];
19};
20
21buffer InvalidShaderStorageBlock
22{
John Kessenich93122692015-09-11 15:25:38 -060023 float values[];
John Kessenich67cf1f62014-08-12 02:11:55 +000024 int value;
25} invalid;
26
John Kessenichc0275792013-08-09 17:14:49 +000027void main()
28{
John Kessenich79cddfc2014-08-11 02:32:30 +000029 barrier();
30 memoryBarrier();
31 memoryBarrierAtomicCounter();
32 memoryBarrierBuffer();
33 memoryBarrierShared();
34 memoryBarrierImage();
35 groupMemoryBarrier();
John Kessenich67cf1f62014-08-12 02:11:55 +000036 value = int(values[gl_LocalInvocationIndex]);
John Kessenich05a62bf2015-01-07 06:14:06 +000037
38 int a;
39 if (a > 10)
40 barrier();
John Kessenichc0275792013-08-09 17:14:49 +000041}
John Kessenichc78a1262013-10-22 00:21:04 +000042
John Kessenich79cddfc2014-08-11 02:32:30 +000043layout(location = 2) in vec3 v3; // ERROR
44in float f; // ERROR
45out float fo; // ERROR
46
47shared vec4 s;
48layout(location = 2) shared vec4 sl; // ERROR
49shared float fs = 4.2; // ERROR
50
Chow352e6682019-09-09 13:24:24 +080051layout(local_size_y = 1) in;
52layout(local_size_y = 2) in; // ERROR, changing
53layout(local_size_y = 1) in;
John Kessenich79cddfc2014-08-11 02:32:30 +000054layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out; // ERROR
55
56int arrX[gl_WorkGroupSize.x];
57int arrY[gl_WorkGroupSize.y];
58int arrZ[gl_WorkGroupSize.z];
John Kessenich67cf1f62014-08-12 02:11:55 +000059
60readonly buffer roblock
61{
62 int value;
63 float values[];
64} ro;
65
66void foo()
67{
John Kessenichedd18192015-04-17 21:47:07 +000068 ro.values[2] = 4.7; // ERROR, readonly
John Kessenich67cf1f62014-08-12 02:11:55 +000069 ro.values.length();
John Kessenich05a62bf2015-01-07 06:14:06 +000070 barrier();
John Kessenich67cf1f62014-08-12 02:11:55 +000071}
John Kessenichedd18192015-04-17 21:47:07 +000072
73uniform double roll;
74uniform writeonly image2D destTex;
75void fooaoeu() {
76 ivec2 storePos = ivec2(gl_GlobalInvocationID.xy);
77 double localCoef = length(vec2(ivec2(gl_LocalInvocationID.xy)-8)/8.0);
78 dvec4 aa = dvec4(0.4, 0.2, 0.3, 0.4);
79 double globalCoef = 1.0;
80 int i = globalCoef; // ERROR, can't convert from double to int
81 double di = i;
82}
John Kessenichf6deb622015-06-14 21:36:44 +000083
84in inb { // ERROR
85 int a;
86} inbi;
87
88out outb { // ERROR
89 int a;
90} outbi;