MTLBuffer - Does it have the concept of atomicity?

Hi, Is there the concept of atomic read/write to an MTLBuffer?



For instance, save I have an MTLBuffer of structs and want to change one of the values, can I atomically write a value that another GPU thread can't read until it's been updated?



I have seen you can do this with Int's directly, but what about an Int, for example, as part of a struct in an MTLBuffer?