Geometry: Use implicit sharing for deformed positions
commite7339bdd5fcc8f93be5a27ee183cb1c361e02b30
authorHans Goudey <hans@blender.org>
Wed, 3 Apr 2024 12:14:34 +0000 (3 14:14 +0200)
committerHans Goudey <hooglyboogly@noreply.localhost>
Wed, 3 Apr 2024 12:14:34 +0000 (3 14:14 +0200)
tree19e79706e8ef017707cf15cdbd688d4636bf2a9f
parent50f5128be09cb16380f8215ea99b130199ea7fce
Geometry: Use implicit sharing for deformed positions

Avoid copying the positions array into the evaluated edit hints array
that's used to support editing with deformed positions when there is
a topology-changing procedural operation. In a simple test in sculpt
mode with 706k curve points, memory usage went from 78 to 70 MB.

This adds more duplication would be ideal, mainly because retrieving
the data with write access and making implicit sharing info for arbitrary
arrays aren't abstracted by implicit sharing utilities. It may be possible
to improve both of those aspects, either now or in the future.

Pull Request: https://projects.blender.org/blender/blender/pulls/120146
source/blender/blenkernel/BKE_curves.hh
source/blender/blenkernel/BKE_grease_pencil.hh
source/blender/blenkernel/intern/crazyspace.cc
source/blender/blenkernel/intern/curves.cc
source/blender/blenkernel/intern/geometry_component_edit_data.cc
source/blender/blenkernel/intern/grease_pencil.cc
source/blender/blenlib/BLI_implicit_sharing.hh
source/blender/blenlib/BLI_implicit_sharing_ptr.hh
source/blender/geometry/intern/transform.cc
source/blender/nodes/geometry/nodes/node_geo_deform_curves_on_surface.cc
source/blender/nodes/intern/geometry_nodes_log.cc