BLI: refactor IndexMask for better performance and memory usage #104629

Merged
Jacques Lucke merged 254 commits from JacquesLucke/blender:index-mask-refactor into main 2023-05-24 18:11:47 +02:00
2 changed files with 4 additions and 7 deletions
Showing only changes of commit a0752026b5 - Show all commits

View File

@ -53,7 +53,6 @@
namespace blender::ed::sculpt_paint {
using blender::bke::CurvesGeometry;
using threading::EnumerableThreadSpecific;
/**
* Moves individual points under the brush and does a length preservation step afterwards.
@ -179,9 +178,8 @@ struct CombOperationExecutor {
static_cast<Mesh *>(curves_id_orig_->surface->data) :
nullptr;
Vector<int64_t> indices;
const IndexMask changed_curves_mask = index_mask_ops::find_indices_from_array(changed_curves,
indices);
IndexMaskMemory memory;
const IndexMask changed_curves_mask = IndexMask::from_bools(changed_curves, memory);
self_->constraint_solver_.solve_step(*curves_orig_, changed_curves_mask, surface, transforms_);
curves_orig_->tag_positions_changed();

View File

@ -142,9 +142,8 @@ struct PinchOperationExecutor {
BLI_assert_unreachable();
}
Vector<int64_t> indices;
const IndexMask changed_curves_mask = index_mask_ops::find_indices_from_array(changed_curves,
indices);
IndexMaskMemory memory;
const IndexMask changed_curves_mask = IndexMask::from_bools(changed_curves, memory);
const Mesh *surface = curves_id_->surface && curves_id_->surface->type == OB_MESH ?
static_cast<const Mesh *>(curves_id_->surface->data) :
nullptr;