Ok, so I currently trying out UAVs (Unordered Access Views) and I stumbled upon an error I’m not quite sure what to do about.
I’m writing to a ComputeBuffer and increment its values each time i press update. If the values get higher than 1, I just loop back to 0 so we have an endless cycle of changing values. This is done via SetRandomWriteTarget and I write to this buffer from my vertex program (it is an RWStructuredBuffer and has exactly the size of the vertex count of the mesh. So i can just read the data out via the vertexID in shader)
Now the problem. While this works all fine and dandy, I noticed that after some time randomly it seems that certain values get added more than once. If you watch the Gif you can see how all values are the same at first, but after some time, some inconsistencies appear (as if certain increments where added 2 times instead of one)
Does anyone have and idea how I could go about fixing that? Or is this just a limitation of UAVs that sometimes errors can occur?