From 95acd3b20a494d083ae2a3d5afa25d5bdf310ac8 Mon Sep 17 00:00:00 2001 From: Sergey Sharybin Date: Thu, 16 Jan 2014 02:03:48 +0600 Subject: Tweak to early threaded update escape Issue was caused by some objects being in bMain and tagged for update but not being in the DAG. This means objects wouldn't be updated and their recalc flag remains untouched triggering threaded for the next frame. Solved by tweaking POST_UPDATE_HANDLER_WORKAROUND in the way that it checks objects' recalc flags from the DAG, not from the bMain. This will work a bit longer since DAG stored more nodes than objects in the scene, but this code only runs in cases when there're some objects tagged for update, which keeps overall CPU usage on such a workaround pretty low. Now CPU usage on 11a_comp scene from project Pampa went down from ~15% down to ~5% (2,69 release uses ~%7). Pointed by Thomas Dinges in IRC. --- source/blender/blenkernel/BKE_depsgraph.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/blenkernel/BKE_depsgraph.h') diff --git a/source/blender/blenkernel/BKE_depsgraph.h b/source/blender/blenkernel/BKE_depsgraph.h index df7e9561c46..bfd01545f86 100644 --- a/source/blender/blenkernel/BKE_depsgraph.h +++ b/source/blender/blenkernel/BKE_depsgraph.h @@ -128,7 +128,7 @@ int DAG_id_type_tagged(struct Main *bmain, short idtype); void DAG_scene_flush_update(struct Main *bmain, struct Scene *sce, unsigned int lay, const short do_time); void DAG_ids_flush_tagged(struct Main *bmain); void DAG_ids_check_recalc(struct Main *bmain, struct Scene *scene, int time); -void DAG_ids_clear_recalc(struct Main *bmain); +void DAG_ids_clear_recalc(struct Main *bmain, struct Scene *scene); /* Armature: sorts the bones according to dependencies between them */ -- cgit v1.2.3