Page MenuHome

Subdiv: Enable topology cache in edit mode
ClosedPublic

Authored by Sergey Sharybin (sergey) on Mar 18 2019, 4:01 PM.

Details

Summary

The general idea of this change is to have a runtime data pointer
in the ModifierData, so it can be preserved through copy-on-write
updates by the dependency graph.

This is where subdivision surface modifier can store its topology
cache, so it is not getting trashed on every copy-on-write which
is happening when moving a vertex.

Similar mechanism should be used by multiresolution, dynamic paint
and some other modifiers which cache evaluated data.

This fixes T61746.
Thing to keep in mind, that there are more reports about slow
subdivision surface in the tracker, but that boils down to the
fact that those have a lot of extraordinary vertices, and hence
a lot slower to evaluated topology.

Diff Detail

Repository
rB Blender
Branch
topology_cache_edit_mode (branched from master)
Build Status
Buildable 3165
Build 3165: arc lint + arc unit

Event Timeline

Harbormaster completed remote builds in B3163: Diff 14249.
Brecht Van Lommel (brecht) requested changes to this revision.Mar 18 2019, 4:13 PM
Brecht Van Lommel (brecht) added inline comments.
source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc
876โ€“879

Shouldn't it be like this?

if (modifier_data == other.modifier_data) {
    return static_cast<int>(type) < static_cast<int>(other.type);
}
return false;
946โ€“951

Can we do this only for objects with modifier_data->runtime != NULL?

This revision now requires changes to proceed.Mar 18 2019, 4:13 PM

Addressed bug found by Brecht.

Addressed another point from Brecht.
Missed that in the first round of update.

This revision is now accepted and ready to land.Mar 18 2019, 5:09 PM
This revision was automatically updated to reflect the committed changes.