Drawing indexed vertices from compute shader

I am trying to generate triangles in a compute shader, which I would then like to render using Graphics.DrawProcedural from a C# script. The compute shader generates two buffers, one containing the vertices of the mesh, and the other contains indices for indexing into the vertex buffer.

My problem arises when I want to draw this, I can’t seem to figure out a way to use the indices to draw triangles, as Graphics.DrawProcedural doesn’t exactly take many parameters. The only solution I can come up with is to create vertices for every triangle and ditch the index buffer, however this can potentially create many duplicate vertices. As I want to draw rather complex meshes (marching cubes) this would probably end up being too heavy memory wise.

Anyone have a good idea on how I can solve this?

You may store the data as array of vertices and array of indexes.
But as far as i know you can only procedurally render an unindexed triangles.

Just do regular Graphics.DrawProcedural(MeshTopology.Triangles, dataBuffer.indexes.Count/3);
And in the vertex shader do output.position.xyz = dataBuffer.vertices[dataBuffer.indexes[input.vertexid]];
Basically your vertex shader will turn the indexed triangles into unindexed.

Also this question contains nice example.