diff options
author | Hans Goudey <h.goudey@me.com> | 2022-07-21 20:13:25 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-07-21 20:13:42 +0300 |
commit | ada601251889c2344a4a89c269cc85877eeb9ebc (patch) | |
tree | d92eb14ef3a8dc3ed8ea6e0182a439bc92bb292e /source/blender/blenkernel | |
parent | a5c2d0018cd9a5844d618aaed21f64f11f35a97a (diff) |
Fix T99854: Crash converting legacy NURBS curves to new type
Creating the attributes was done inside a parallel loop. Also correct a
typo for the parallel grain size, which was meant to be a power of two.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/curve_legacy_convert.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/curve_legacy_convert.cc b/source/blender/blenkernel/intern/curve_legacy_convert.cc index ff5bbc32afe..5c62f292832 100644 --- a/source/blender/blenkernel/intern/curve_legacy_convert.cc +++ b/source/blender/blenkernel/intern/curve_legacy_convert.cc @@ -115,7 +115,7 @@ Curves *curve_legacy_to_curves(const Curve &curve_legacy, const ListBase &nurbs_ MutableSpan<float> tilts = curves.tilt_for_write(); auto create_poly = [&](IndexMask selection) { - threading::parallel_for(selection.index_range(), 246, [&](IndexRange range) { + threading::parallel_for(selection.index_range(), 256, [&](IndexRange range) { for (const int curve_i : selection.slice(range)) { const Nurb &src_curve = *src_curves[curve_i]; const Span<BPoint> src_points(src_curve.bp, src_curve.pntsu); @@ -142,7 +142,7 @@ Curves *curve_legacy_to_curves(const Curve &curve_legacy, const ListBase &nurbs_ MutableSpan<int8_t> handle_types_l = curves.handle_types_left_for_write(); MutableSpan<int8_t> handle_types_r = curves.handle_types_right_for_write(); - threading::parallel_for(selection.index_range(), 246, [&](IndexRange range) { + threading::parallel_for(selection.index_range(), 256, [&](IndexRange range) { for (const int curve_i : selection.slice(range)) { const Nurb &src_curve = *src_curves[curve_i]; const Span<BezTriple> src_points(src_curve.bezt, src_curve.pntsu); @@ -165,12 +165,12 @@ Curves *curve_legacy_to_curves(const Curve &curve_legacy, const ListBase &nurbs_ }; auto create_nurbs = [&](IndexMask selection) { - threading::parallel_for(selection.index_range(), 246, [&](IndexRange range) { - MutableSpan<int> resolutions = curves.resolution_for_write(); - MutableSpan<float> nurbs_weights = curves.nurbs_weights_for_write(); - MutableSpan<int8_t> nurbs_orders = curves.nurbs_orders_for_write(); - MutableSpan<int8_t> nurbs_knots_modes = curves.nurbs_knots_modes_for_write(); - + MutableSpan<int> resolutions = curves.resolution_for_write(); + MutableSpan<float> nurbs_weights = curves.nurbs_weights_for_write(); + MutableSpan<int8_t> nurbs_orders = curves.nurbs_orders_for_write(); + MutableSpan<int8_t> nurbs_knots_modes = curves.nurbs_knots_modes_for_write(); + + threading::parallel_for(selection.index_range(), 256, [&](IndexRange range) { for (const int curve_i : selection.slice(range)) { const Nurb &src_curve = *src_curves[curve_i]; const Span src_points(src_curve.bp, src_curve.pntsu); |