1#version 460 2 3out vec4 o; 4 5// default uniforms will be gathered into a uniform block 6// final global block will merge uniforms from all linked files 7uniform vec4 a; // declared in both stages 8uniform vec2 b1; // declaration order swapped in other stage 9uniform vec2 b2; 10uniform vec4 c1; // not delcared in other file 11uniform vec4 d; 12 13// final global buffer will berge buffers from all linked files 14layout (binding = 0) uniform atomic_uint counter1; 15layout (binding = 0) uniform atomic_uint counter2; 16 17vec4 foo(); 18 19vec4 bar() { 20 uint j = atomicCounterIncrement(counter1) + atomicCounterDecrement(counter2); 21 vec4 v = a + vec4(b1.x, b1.y, b2.x, b2.y) + c1 + d; 22 23 return float(j) * v; 24} 25 26void main() { 27 o = foo() + bar(); 28}