John Kessenich | c027579 | 2013-08-09 17:14:49 +0000 | [diff] [blame] | 1 | #version 430 core
|
| 2 |
|
John Kessenich | 79cddfc | 2014-08-11 02:32:30 +0000 | [diff] [blame] | 3 | layout(local_size_x = 2) in;
|
| 4 | layout(local_size_x = 16) in; // ERROR, changing
|
| 5 | layout(local_size_z = 4096) in; // ERROR, too large
|
| 6 | layout(local_size_x = 2) in;
|
| 7 |
|
| 8 | const int total = gl_MaxComputeWorkGroupCount.y
|
| 9 | + gl_MaxComputeUniformComponents
|
| 10 | + gl_MaxComputeTextureImageUnits
|
| 11 | + gl_MaxComputeImageUniforms
|
| 12 | + gl_MaxComputeAtomicCounters
|
| 13 | + gl_MaxComputeAtomicCounterBuffers;
|
| 14 |
|
John Kessenich | 67cf1f6 | 2014-08-12 02:11:55 +0000 | [diff] [blame] | 15 | buffer ShaderStorageBlock
|
| 16 | {
|
| 17 | int value;
|
| 18 | float values[];
|
| 19 | };
|
| 20 |
|
| 21 | buffer InvalidShaderStorageBlock
|
| 22 | {
|
John Kessenich | 9312269 | 2015-09-11 15:25:38 -0600 | [diff] [blame] | 23 | float values[];
|
John Kessenich | 67cf1f6 | 2014-08-12 02:11:55 +0000 | [diff] [blame] | 24 | int value;
|
| 25 | } invalid;
|
| 26 |
|
John Kessenich | c027579 | 2013-08-09 17:14:49 +0000 | [diff] [blame] | 27 | void main()
|
| 28 | {
|
John Kessenich | 79cddfc | 2014-08-11 02:32:30 +0000 | [diff] [blame] | 29 | barrier();
|
| 30 | memoryBarrier();
|
| 31 | memoryBarrierAtomicCounter();
|
| 32 | memoryBarrierBuffer();
|
| 33 | memoryBarrierShared();
|
| 34 | memoryBarrierImage();
|
| 35 | groupMemoryBarrier();
|
John Kessenich | 67cf1f6 | 2014-08-12 02:11:55 +0000 | [diff] [blame] | 36 | value = int(values[gl_LocalInvocationIndex]);
|
John Kessenich | 05a62bf | 2015-01-07 06:14:06 +0000 | [diff] [blame] | 37 |
|
| 38 | int a;
|
| 39 | if (a > 10)
|
| 40 | barrier();
|
John Kessenich | c027579 | 2013-08-09 17:14:49 +0000 | [diff] [blame] | 41 | }
|
John Kessenich | c78a126 | 2013-10-22 00:21:04 +0000 | [diff] [blame] | 42 |
|
John Kessenich | 79cddfc | 2014-08-11 02:32:30 +0000 | [diff] [blame] | 43 | layout(location = 2) in vec3 v3; // ERROR
|
| 44 | in float f; // ERROR
|
| 45 | out float fo; // ERROR
|
| 46 |
|
| 47 | shared vec4 s;
|
| 48 | layout(location = 2) shared vec4 sl; // ERROR
|
| 49 | shared float fs = 4.2; // ERROR
|
| 50 |
|
Chow | 352e668 | 2019-09-09 13:24:24 +0800 | [diff] [blame] | 51 | layout(local_size_y = 1) in;
|
| 52 | layout(local_size_y = 2) in; // ERROR, changing
|
| 53 | layout(local_size_y = 1) in;
|
John Kessenich | 79cddfc | 2014-08-11 02:32:30 +0000 | [diff] [blame] | 54 | layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out; // ERROR
|
| 55 |
|
| 56 | int arrX[gl_WorkGroupSize.x];
|
| 57 | int arrY[gl_WorkGroupSize.y];
|
| 58 | int arrZ[gl_WorkGroupSize.z];
|
John Kessenich | 67cf1f6 | 2014-08-12 02:11:55 +0000 | [diff] [blame] | 59 |
|
| 60 | readonly buffer roblock
|
| 61 | {
|
| 62 | int value;
|
| 63 | float values[];
|
| 64 | } ro;
|
| 65 |
|
| 66 | void foo()
|
| 67 | {
|
John Kessenich | edd1819 | 2015-04-17 21:47:07 +0000 | [diff] [blame] | 68 | ro.values[2] = 4.7; // ERROR, readonly
|
John Kessenich | 67cf1f6 | 2014-08-12 02:11:55 +0000 | [diff] [blame] | 69 | ro.values.length();
|
John Kessenich | 05a62bf | 2015-01-07 06:14:06 +0000 | [diff] [blame] | 70 | barrier();
|
John Kessenich | 67cf1f6 | 2014-08-12 02:11:55 +0000 | [diff] [blame] | 71 | }
|
John Kessenich | edd1819 | 2015-04-17 21:47:07 +0000 | [diff] [blame] | 72 |
|
| 73 | uniform double roll;
|
| 74 | uniform writeonly image2D destTex;
|
| 75 | void 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 Kessenich | f6deb62 | 2015-06-14 21:36:44 +0000 | [diff] [blame] | 83 |
|
| 84 | in inb { // ERROR
|
| 85 | int a;
|
| 86 | } inbi;
|
| 87 |
|
| 88 | out outb { // ERROR
|
| 89 | int a;
|
| 90 | } outbi;
|