Hi,
I am using a Unity compute shader to create a vertex buffer and index buffer.
The vertex buffer is an
AppendStructuredBuffer<float3> vertexBuffer
Each thread calculates a vertex and then calls
vertexBuffer.Append(vertex)
Later in that same function (in that same kernel) I have a
RWStructuredBuffer<int> indexBuffer
I would like to add the index of the vertex just placed in vertexBuffer to indexbuffer. However there doesn't seem to be any way to get the index of the last item added to the vertex Append buffer?
I'm aware of CopyCount but that doesn't seem appropriate here. I've also looked into CopyStructureCount but I don't think that can be called in a Unity compute shader?
Thanks