diff options
author | Howard Trickey <howard.trickey@gmail.com> | 2020-12-05 15:48:41 +0300 |
---|---|---|
committer | Howard Trickey <howard.trickey@gmail.com> | 2020-12-05 15:48:41 +0300 |
commit | 8982a315b76e70ecf244243c3002d46ca73761f8 (patch) | |
tree | d508a5bddf1fff9021bea19c0431fb36f26b938e /source/blender/modifiers | |
parent | 887a602448286fe57b77046001a72d488415b1b8 (diff) |
Add more timing hooks for boolean.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r-- | source/blender/modifiers/intern/MOD_boolean.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/source/blender/modifiers/intern/MOD_boolean.c b/source/blender/modifiers/intern/MOD_boolean.c index 4152e8633e5..0513d3af13a 100644 --- a/source/blender/modifiers/intern/MOD_boolean.c +++ b/source/blender/modifiers/intern/MOD_boolean.c @@ -630,7 +630,15 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * Object *operand_ob = bmd->object; +#ifdef DEBUG_TIME + TIMEIT_BLOCK_INIT(operand_get_evaluated_mesh); + TIMEIT_BLOCK_START(operand_get_evaluated_mesh); +#endif mesh_operand_ob = BKE_modifier_get_evaluated_mesh_from_evaluated_object(operand_ob, false); +#ifdef DEBUG_TIME + TIMEIT_BLOCK_END(operand_get_evaluated_mesh); + TIMEIT_BLOCK_STATS(operand_get_evaluated_mesh); +#endif if (mesh_operand_ob) { /* XXX This is utterly non-optimal, we may go from a bmesh to a mesh back to a bmesh! @@ -642,11 +650,35 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * result = get_quick_mesh(object, mesh, operand_ob, mesh_operand_ob, bmd->operation); if (result == NULL) { +#ifdef DEBUG_TIME + TIMEIT_BLOCK_INIT(object_BMD_mesh_bm_create); + TIMEIT_BLOCK_START(object_BMD_mesh_bm_create); +#endif bm = BMD_mesh_bm_create(mesh, object, mesh_operand_ob, operand_ob, &is_flip); +#ifdef DEBUG_TIME + TIMEIT_BLOCK_END(object_BMD_mesh_bm_create); + TIMEIT_BLOCK_STATS(object_BMD_mesh_bm_create); +#endif +#ifdef DEBUG_TIME + TIMEIT_BLOCK_INIT(BMD_mesh_intersection); + TIMEIT_BLOCK_START(BMD_mesh_intersection); +#endif BMD_mesh_intersection(bm, md, ctx, mesh_operand_ob, object, operand_ob, is_flip); +#ifdef DEBUG_TIME + TIMEIT_BLOCK_END(BMD_mesh_intersection); + TIMEIT_BLOCK_STATS(BMD_mesh_intersection); +#endif +#ifdef DEBUG_TIME + TIMEIT_BLOCK_INIT(BKE_mesh_from_bmesh_for_eval_nomain); + TIMEIT_BLOCK_START(BKE_mesh_from_bmesh_for_eval_nomain); +#endif result = BKE_mesh_from_bmesh_for_eval_nomain(bm, NULL, mesh); +#ifdef DEBUG_TIME + TIMEIT_BLOCK_END(BKE_mesh_from_bmesh_for_eval_nomain); + TIMEIT_BLOCK_STATS(BKE_mesh_from_bmesh_for_eval_nomain); +#endif BM_mesh_free(bm); result->runtime.cd_dirty_vert |= CD_MASK_NORMAL; } |