1struct S { 2 atomicUint structMemberAtomic; // valid 3 atomicUint structMemberAtomicArray[2]; // valid 4}; 5 6struct NestedS { 7 S nestedStructWithAtomicMember; // valid 8}; 9 10layout(metal, binding = 0) buffer ssbo { 11 atomicUint ssboAtomic; // valid 12 atomicUint ssboAtomicArray[2]; // valid 13 S ssboStructWithAtomicMember; // valid 14 S ssboStructWithAtomicMemberArray[2]; // valid 15 NestedS ssboNestedStructWithAtomicMember; // valid 16}; 17 18workgroup atomicUint wgAtomic; // valid 19workgroup atomicUint wgAtomicArray[2]; // valid 20workgroup NestedS wgNestedStructWithAtomicMember; // valid; 21 22void main() { 23 // Do something with each workgroup atomic to prevent them from getting eliminated as 24 // dead globals. 25 atomicAdd(wgAtomicArray[1], atomicLoad(wgAtomic)); 26 atomicAdd(wgAtomicArray[0], atomicLoad(wgAtomicArray[1])); 27 atomicAdd(wgNestedStructWithAtomicMember.nestedStructWithAtomicMember.structMemberAtomic, 1); 28} 29