diff options
author | Hans Goudey <h.goudey@me.com> | 2022-04-05 19:36:12 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2022-04-05 19:36:12 +0300 |
commit | b84255f590c07b129f726eadbfec72c73bfc2ee1 (patch) | |
tree | e5bd68a9b5cb575e2b126efc08836dd9f1253b27 /source/blender/blenkernel/intern/displist.cc | |
parent | edcbf741df2f6d5567da123e1f4763cc82921ec8 (diff) |
Curves: Port legacy curve viewport drawing to the new data-block
Instead of using `CurveEval` to draw the curve wire edges, use
the new `Curves` data-block, which is already built as part of
an object's evaluated geometry set whenever there is a
`CurveComponent`.
This means that we can remove `Curve`'s temporary ownership
of `CurveEval` for drawing (added in 9ec12c26f16ea3da1e),
which caused a memory leak as described in T96498.
In my testing this improved performance by around 1.5x during
viewport playback, back to the performance of 3.1 before the
curve data structure transition started.
The next step of using the GPU to do the final curve evaluation
for the viewport is described in T96455, but is unrelated.
Differential Revision: https://developer.blender.org/D14551
Diffstat (limited to 'source/blender/blenkernel/intern/displist.cc')
-rw-r--r-- | source/blender/blenkernel/intern/displist.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc index cda2bb5f4c0..8c1161d6ff6 100644 --- a/source/blender/blenkernel/intern/displist.cc +++ b/source/blender/blenkernel/intern/displist.cc @@ -1494,7 +1494,7 @@ void BKE_displist_make_curveTypes(Depsgraph *depsgraph, * the CurveEval data type was introduced, when an evaluated object's curve data was just a * copy of the original curve and everything else ended up in #CurveCache. */ CurveComponent &curve_component = geometry.get_component_for_write<CurveComponent>(); - cow_curve.curve_eval = curves_to_curve_eval(*curve_component.get_for_read()).release(); + cow_curve.curve_eval = curve_component.get_for_read(); BKE_object_eval_assign_data(ob, &cow_curve.id, false); } |