A core problem with the mesh API is that modifying a mesh at run time is a blocking operation. Vertex data can be built on either seperate threads or the job system, but ultimately you are bottlenecked by the part where you have to assign the data to the mesh to update it since this has to be done on the main thread. The workaround I use is time slicing where I allocate time per frame to process a queue of meshes that need updating.



What I have always wanted is for the entire process of updating a mesh to be completely non-blocking. Either allow us to do it all on the job system or alternatively introduce a thread safe variant of the Mesh class where you can lock/unlock it for writing.

Click to expand...