I generate a mesh and apply a material to it with a shader written in HLSL.
The only purpose of this mesh is to be rendered. No physics, no scripts.
When generating this mesh, a lot of time is wasted waiting for the data to be sent from the GPU to the CPU, which I know is generally something you want to avoid.
computeShader.SetBuffer(vertexKernelID, "vertexBuffer", vertexBuffer);
computeShader.Dispatch(vertexKernelID, GetThreadGroups(vertexKernelID, vertices.Length), 1, 1);
vertexBuffer.GetData(vertices); <- Here
computeShader.SetBuffer(triangleKernelID, "triangleBuffer", triangleBuffer);
computeShader.Dispatch(triangleKernelID, GetThreadGroups(triangleKernelID, triangles.Length / 6), 1, 1);
triangleBuffer.GetData(triangles); <- And here
Is there a way to just render it without sending anything back to the CPU?