-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Neither TessellateConvex nor FillPointsForPolyLine preallocates any space for the resulting points/indices generated, so profiles of this code show a lot of std::vector reallocation:
For TessellateConvex, we should be able to compute the exact number of indices and vertex points needed and size the vector correctly the first time. Additionally, we may wish to make the method accept a host buffer and emplace directly into it.
For FillPointsForPolyLine, we should experiment with a two pass system - one pass to compute or estimate the number of points needed and another to fill in. Alternatively, we could allocate a large buffer internally and hand out temporary views to this buffer - as tessellation will only be done from a single thread right now this should be mostly safe.
