From b84255f590c07b129f726eadbfec72c73bfc2ee1 Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Tue, 5 Apr 2022 11:36:12 -0500 Subject: 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 --- source/blender/makesdna/DNA_curve_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/blender/makesdna/DNA_curve_types.h') 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; -- cgit v1.2.3