[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [57941] branches/soc-2013-depsgraph_mt/ source/blender/blenkernel/intern: Add workaroud to make threaded object update stable

Sergey Sharybin sergey.vfx at gmail.com
Tue Jul 2 21:23:03 CEST 2013


Revision: 57941
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=57941
Author:   nazgul
Date:     2013-07-02 19:23:03 +0000 (Tue, 02 Jul 2013)
Log Message:
-----------
Add workaroud to make threaded object update stable

Added threading lock around unsafe part of do_makeDispListCurveTypes
(parts which touches Curve->bev and Curve->path). Namely it means
pre-tesselation modifiers, bevel, path and non-modified display
list will be calculated inside a locked thread.

Post-tessellation modifiers will eb calculated outside of locked
thread, which means heavy constructive or deformation modifiers
applying on tesselated spline will be nicely threaded.

This makes it possible to use threaded object update by default
in the branch, so everyone could start testing it.

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

Modified: branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/displist.c
===================================================================
--- branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/displist.c	2013-07-02 19:22:59 UTC (rev 57940)
+++ branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/displist.c	2013-07-02 19:23:03 UTC (rev 57941)
@@ -45,6 +45,7 @@
 #include "BLI_blenlib.h"
 #include "BLI_math.h"
 #include "BLI_scanfill.h"
+#include "BLI_threads.h"
 #include "BLI_utildefines.h"
 
 #include "BKE_global.h"
@@ -1394,6 +1395,9 @@
 
 		nubase = BKE_curve_nurbs_get(cu);
 
+		/* XXX: Temp workaround for depsgraph_mt branch. */
+		BLI_lock_thread(LOCK_CUSTOM1);
+
 		BLI_freelistN(&(cu->bev));
 
 		if (cu->path) free_path(cu->path);
@@ -1594,6 +1598,10 @@
 		if (cu->bb == NULL) {
 			cu->bb = MEM_callocN(sizeof(BoundBox), "boundbox");
 		}
+
+		/* XXX: Temp workaround for depsgraph_mt branch. */
+		BLI_unlock_thread(LOCK_CUSTOM1);
+
 		boundbox_dispbase(cu->bb, dispbase);
 
 		if (!forRender) {

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-02 19:22:59 UTC (rev 57940)
+++ branches/soc-2013-depsgraph_mt/source/blender/blenkernel/intern/scene.c	2013-07-02 19:23:03 UTC (rev 57941)
@@ -1164,8 +1164,6 @@
 		BKE_rigidbody_do_simulation(scene, ctime);
 }
 
-#undef USE_THREADED_UPDATE
-
 typedef struct ThreadedObjectUpdateState {
 	Scene *scene;
 	Scene *scene_parent;
@@ -1329,12 +1327,6 @@
 		}
 	}
 
-#ifndef USE_THREADED_UPDATE
-	if (true) {
-		scene_update_all_bases(scene, scene_parent);
-	}
-	else
-#endif
 	if (update_count > 1) {
 		scene_update_objects_threaded(scene, scene_parent);
 	}




More information about the Bf-blender-cvs mailing list