5 // default uniforms will be gathered into a uniform block
\r
7 uniform vec2 b = vec2(0, 0); // initializer will be ignored
\r
8 layout(location = 0) uniform vec2 c; // location qualifier will be ignored
\r
16 // opaque types will not be grouped into uniform block
\r
17 uniform sampler2D t1;
\r
19 // shared and packed layout qualifier are silently ignored
\r
20 layout(shared) uniform UniformBlock {
\r
25 layout(packed) buffer BufferBlock {
\r
30 // atomic_uint will be converted to uint and gathered in a buffer block
\r
31 layout(binding = 0) uniform atomic_uint counter1; // offset not used
\r
32 layout(binding = 0) uniform atomic_uint counter2; // offset not used
\r
33 layout(binding = 1) uniform atomic_uint counter3; // offset not used
\r
35 // atomic counter functions will be converted to equivalent integer atomic operations
\r
38 j = atomicCounterIncrement(counter1);
\r
39 j = atomicCounterDecrement(counter1);
\r
40 j = atomicCounter(counter1);
\r
42 j = atomicCounterAdd(counter1, 1);
\r
43 j = atomicCounterAdd(counter1, -1);
\r
44 j = atomicCounterSubtract(counter1, 1);
\r
46 j = atomicCounterMin(counter1, j);
\r
47 j = atomicCounterMax(counter1, j);
\r
48 j = atomicCounterAnd(counter1, j);
\r
50 j = atomicCounterOr(counter1, j);
\r
51 j = atomicCounterXor(counter1, j);
\r
53 j = atomicCounterExchange(counter1, j);
\r
54 j = atomicCounterCompSwap(counter1, 0, j);
\r
56 atomicCounterIncrement(counter2);
\r
57 atomicCounterIncrement(counter3);
\r
59 memoryBarrierAtomicCounter();
\r
65 float f = j + bufferInstance.j + structUniform.y + structUniform.z;
\r
66 vec2 v2 = b + c + structUniform.x;
\r
67 vec4 v4 = a + d[0] + d[1] + d[2] + k + bufferInstance.k + texture(t1, vec2(0, 0));
\r
68 return vec4(f) * vec4(v2, 1, 1) * v4;
\r
72 float j = float(bar());
\r