UV: avoid small allocations in PackIsland::finalize_geometry
Use the memory arena for convex vertices as well as the index buffer.
This commit is contained in:
@@ -358,11 +358,12 @@ void PackIsland::finalize_geometry_(const UVPackIsland_Params ¶ms, MemArena
|
||||
if (convex_len >= 3) {
|
||||
/* Write back. */
|
||||
triangle_vertices_.clear();
|
||||
Array<float2> convexVertices(convex_len);
|
||||
float2 *convex_verts = static_cast<float2 *>(
|
||||
BLI_memarena_alloc(arena, sizeof(*convex_verts) * convex_len));
|
||||
for (int i = 0; i < convex_len; i++) {
|
||||
convexVertices[i] = source[index_map[i]];
|
||||
convex_verts[i] = source[index_map[i]];
|
||||
}
|
||||
add_polygon(convexVertices, arena, heap);
|
||||
add_polygon(Span(convex_verts, convex_len), arena, heap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user