[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58319] branches/soc-2013-depsgraph_mt/ source/blender/blenkernel/intern/scene.c: Remove workaround for draw object free

Sergey Sharybin sergey.vfx at gmail.com
Tue Jul 16 22:11:08 CEST 2013


Revision: 58319
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58319
Author:   nazgul
Date:     2013-07-16 20:11:08 +0000 (Tue, 16 Jul 2013)
Log Message:
-----------
Remove workaround for draw object free

Code around draw objects became safe for threading
and no special workaround is needed in scene update
anymore.

Unused buffers will be freed next time window is
drawing. Some further tweaks maybe needed to how
buffers are freeing, but things shall work for now
nice and stable.

Modified Paths:
--------------
    branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/scene.c

Modified: branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/scene.c
===================================================================
--- branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/scene.c	2013-07-16 20:11:05 UTC (rev 58318)
+++ branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/scene.c	2013-07-16 20:11:08 UTC (rev 58319)
@@ -1324,34 +1324,6 @@
 	 */
 	BLI_begin_threaded_malloc();
 
-	/* XXX: Releasing DrawObject is not thread safe, but adding lock
-	 *      around it is gonna to harm even more. So for now let's
-	 *      free all caches from main thread.
-	 *
-	 * TODO(sergey): Making DrawObject thread-safe is a nice task on
-	 *               it's own and it'll also make it possible to remove
-	 *               this hack.
-	 */
-	{
-		Base *base;
-		for (base = scene->base.first; base; base = base->next) {
-			Object *ob = base->object;
-
-			if (ob->recalc & OB_RECALC_ALL) {
-				BKE_object_free_derived_caches(ob);
-
-				if (ob->dup_group && (ob->transflag & OB_DUPLIGROUP)) {
-					GroupObject *go;
-					for (go = ob->dup_group->gobject.first; go; go = go->next) {
-						if (go->ob && go->ob->recalc) {
-							BKE_object_free_derived_caches(go->ob);
-						}
-					}
-				}
-			}
-		}
-	}
-
 	state.scene = scene;
 	state.scene_parent = scene_parent;
 #ifdef ENABLE_THREAD_STATISTICS




More information about the Bf-blender-cvs mailing list