John Kessenich | 4d57090 | 2014-08-12 22:07:22 +0000 | [diff] [blame] | 1 | #version 310 es
|
| 2 |
|
| 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 |
|
| 15 | buffer ShaderStorageBlock
|
| 16 | {
|
| 17 | int value;
|
| 18 | float values[];
|
| 19 | };
|
| 20 |
|
| 21 | buffer InvalidShaderStorageBlock
|
| 22 | {
|
| 23 | float values[]; // ERROR
|
| 24 | int value;
|
| 25 | } invalid;
|
| 26 |
|
| 27 | void main()
|
| 28 | {
|
| 29 | barrier();
|
| 30 | memoryBarrier();
|
| 31 | memoryBarrierAtomicCounter();
|
| 32 | memoryBarrierBuffer();
|
| 33 | memoryBarrierShared();
|
| 34 | memoryBarrierImage();
|
| 35 | groupMemoryBarrier();
|
| 36 | value = int(values[gl_LocalInvocationIndex]);
|
| 37 | }
|
| 38 |
|
| 39 | layout(location = 2) in vec3 v3; // ERROR
|
| 40 | in float f; // ERROR
|
| 41 | out float fo; // ERROR
|
| 42 |
|
| 43 | shared vec4 s;
|
| 44 | layout(location = 2) shared vec4 sl; // ERROR
|
| 45 | shared float fs = 4.2; // ERROR
|
| 46 |
|
| 47 | layout(local_size_x = 2, local_size_y = 3, local_size_z = 4) out; // ERROR
|
| 48 |
|
| 49 | int arrX[gl_WorkGroupSize.x];
|
| 50 | int arrY[gl_WorkGroupSize.y];
|
| 51 | int arrZ[gl_WorkGroupSize.z];
|
| 52 |
|
| 53 | readonly buffer roblock
|
| 54 | {
|
| 55 | int value;
|
| 56 | float values[];
|
| 57 | } ro;
|
| 58 |
|
| 59 | void foo()
|
| 60 | {
|
| 61 | ro.values[2] = 4.7; // ERROR, readonly
|
| 62 | ro.values.length();
|
| 63 | ++s;
|
| 64 | }
|
| 65 |
|
| 66 | buffer vec4 v; // ERROR
|
| 67 |
|
| 68 | uniform usampler2D us2dbad; // ERROR, default precision
|
| 69 |
|
| 70 | precision highp usampler2D;
|
| 71 | precision highp iimage2DArray;
|
| 72 | precision highp iimage2D;
|
| 73 |
|
| 74 | uniform usampler2D us2d;
|
| 75 |
|
| 76 | uniform iimage2DArray ii2dabad; // ERROR, not writeonly
|
| 77 | uniform writeonly iimage2DArray ii2da;
|
| 78 |
|
| 79 | layout(r32i) uniform iimage2D iimg2D;
|
| 80 | layout(rgba32i) uniform iimage2D iimg2Drgba;
|
| 81 | layout(rgba32f) uniform image2D img2Drgba;
|
| 82 | layout(r32ui) uniform uimage2D uimg2D;
|
| 83 |
|
| 84 | void qux()
|
| 85 | {
|
| 86 | int i = 4;
|
| 87 | imageAtomicCompSwap(iimg2D, ivec2(i,i), i, i);// ERROR no longer in 310
|
| 88 | imageAtomicAdd(uimg2D, ivec2(i,i), uint(i)); // ERROR no longer in 310
|
| 89 | imageAtomicMin(iimg2Drgba, ivec2(i,i), i); // ERROR no longer in 310 // ERROR iimg2Drgba does not have r32i layout
|
| 90 | imageAtomicMax(img2Drgba, ivec2(i,i), i); // ERROR no longer in 310 // ERROR img2Drgba is not integer image
|
| 91 | ivec4 pos = imageLoad(iimg2D, ivec2(i,i));
|
| 92 | imageStore(ii2da, ivec3(i,i,i), ivec4(0));
|
| 93 | imageLoad(img2Drgba, ivec2(i,i));
|
| 94 | imageLoad(ii2da, ivec3(i,i,i)); // ERROR, drops writeonly
|
| 95 | }
|
| 96 |
|
| 97 | volatile float vol; // ERROR, not an image
|
| 98 | readonly int vol2; // ERROR, not an image
|
| 99 |
|
| 100 | void passr(coherent readonly iimage2D image)
|
| 101 | {
|
| 102 | }
|
| 103 |
|
| 104 | layout(r32i) coherent readonly uniform iimage2D qualim1;
|
| 105 | layout(r32i) coherent restrict readonly uniform iimage2D qualim2;
|
| 106 |
|
| 107 | void passrc()
|
| 108 | {
|
| 109 | passr(qualim1);
|
| 110 | passr(qualim2); // ERROR, drops restrict
|
| 111 | passr(iimg2D);
|
| 112 | }
|
| 113 |
|
| 114 | layout(rg8i) uniform uimage2D i1bad; // ERROR, type mismatch
|
| 115 | layout(rgba32i) uniform image2D i2bad; // ERROR, type mismatch
|
| 116 | layout(rgba32f) uniform uimage2D i3bad; // ERROR, type mismatch
|
| 117 | layout(r8_snorm) uniform iimage2D i4bad; // ERROR, type mismatch
|
| 118 | layout(rgba32ui) uniform iimage2D i5bad; // ERROR, type mismatch
|
| 119 | layout(r8ui) uniform iimage2D i6bad; // ERROR, type mismatch
|
| 120 |
|
| 121 | layout(binding = 0) uniform atomic_uint counter;
|
| 122 |
|
| 123 | uint func(atomic_uint c)
|
| 124 | {
|
| 125 | return atomicCounterIncrement(c);
|
| 126 | }
|
| 127 |
|
| 128 | uint func2(out atomic_uint c) // ERROR, output
|
| 129 | {
|
| 130 | return counter; // ERROR, type mismatch
|
| 131 | return atomicCounter(counter);
|
| 132 | }
|
| 133 |
|
| 134 | void mainAC()
|
| 135 | {
|
| 136 | atomic_uint non_uniform_counter; // ERROR
|
| 137 | uint val = atomicCounter(counter);
|
| 138 | atomicCounterDecrement(counter);
|
| 139 | }
|
| 140 |
|
| 141 | layout(binding = 1) uniform mediump atomic_uint counterBad; // ERROR, not highp
|
John Kessenich | 265f5fb | 2014-08-13 01:04:28 +0000 | [diff] [blame] | 142 |
|
| 143 | layout(binding = 2, offset = 4) uniform atomic_uint countArr[4];
|
| 144 | uniform int i;
|
| 145 |
|
| 146 | void opac()
|
| 147 | {
|
| 148 | int a[3];
|
| 149 | a[counter]; // ERROR
|
| 150 | countArr[2];
|
| 151 | countArr[i];
|
| 152 | }
|
John Kessenich | df1d81a | 2014-08-13 08:32:15 +0000 | [diff] [blame] | 153 |
|
| 154 | shared int atomi;
|
| 155 | shared uint atomu;
|
| 156 |
|
| 157 | void atoms()
|
| 158 | {
|
| 159 | int origi = atomicAdd(atomi, 3);
|
| 160 | uint origu = atomicAnd(atomu, 7u);
|
| 161 | origi = atomicExchange(atomi, 4);
|
| 162 | origu = atomicCompSwap(atomu, 10u, 8u);
|
| 163 | }
|
John Kessenich | b300751 | 2014-08-14 07:07:21 +0000 | [diff] [blame] | 164 |
|
| 165 | precision highp atomic_uint;
|
| 166 | precision lowp atomic_uint; // ERROR
|
| 167 |
|
| 168 | precise int pfoo; // ERROR, reserved
|
| 169 |
|
| 170 | dmat2x4 dm; // ERROR
|
| 171 | uniform samplerCubeArray sca; // ERROR
|
| 172 | uniform iimage2DRect i2dr; // ERROR
|
| 173 | uniform image2DMS i2dms; // ERROR
|
| 174 | uniform uimage2DMSArray u2dmsa; // ERROR
|