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.
This commit is contained in:
@@ -1324,34 +1324,6 @@ static void scene_update_objects_threaded(Scene *scene, Scene *scene_parent)
|
||||
*/
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user