#version 450 layout(local_size_x = 2) in; struct Data { float a; float b; }; layout(std430, binding = 0) buffer SSBO { Data outdata[]; }; layout(constant_id = 0) const float X = 4.0; Data data[2] = Data[](Data(1.0, 2.0), Data(3.0, 4.0)); Data data2[2] = Data[](Data(X, 2.0), Data(3.0, 5.0)); Data combine(Data a, Data b) { return Data(a.a + b.a, a.b + b.b); } void main() { if (gl_LocalInvocationIndex == 0u) outdata[gl_WorkGroupID.x] = combine(data[gl_LocalInvocationID.x], data2[gl_LocalInvocationID.x]); }