Hopefully a very simple question! I have a particle system that I'm updating with a compute shader (just updating a buffer with position data). Right now I'm reading from an input buffer and writing to a different output buffer (that will be the input buffer next frame). But I was wondering, since each update is reading/writing to the same slot, whether it might be more efficient, or even possible, to update the buffer in-situ rather than having to create two and ping-pong back and forth.
I suspect the answer here is "no, this is a bad idea", since I'm sure there's a whole host of undefined behaviors around caches, memory access ordering, etc, but I thought it was worth asking if there's any approach that could work on a buffer in-place like this, since it would be nice to save that extra memory (and if it's faster!).