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/makesdna | |
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/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_curve_types.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/makesdna/DNA_curve_types.h b/source/blender/makesdna/DNA_curve_types.h index 33a12592aa8..556e467c4b6 100644 --- a/source/blender/makesdna/DNA_curve_types.h +++ b/source/blender/makesdna/DNA_curve_types.h @@ -19,7 +19,7 @@ extern "C" { #define MAXTEXTBOX 256 /* used in readfile.c and editfont.c */ struct AnimData; -struct CurveEval; +struct Curves; struct CurveProfile; struct EditFont; struct GHash; @@ -291,7 +291,7 @@ typedef struct Curve { * since it also contains the result of geometry nodes evaluation, and isn't just a copy of the * original object data. */ - struct CurveEval *curve_eval; + const struct Curves *curve_eval; void *batch_cache; } Curve; |