Page MenuHome

Depsgraph; Sanitize update calls happening during evaluation
ClosedPublic

Authored by Sergey Sharybin (sergey) on Thu, Oct 10, 12:32 PM.

Details

Summary

This change consists of the following commits.

Depsgraph: Don't use push-from-thread when scheduling graph

This isn't guaranteed that graph is scheduled from main thread,
so it is actually a miracle how it all worked.

Depsgraph: Cleanup, promote is_evaluating query

This way it might be used for sanity checks in RNA API as well.

Depsgraph: Inform when update or tag happens during evaluation

It is not allowed to do tagging or updates while dependency graph is
in the middle of evaluation.

This is something what is simple to violate from python code. This
change adds some sanity checks.

The request to update view layer or dependency graph will raise an
exception in Python now, so it's easy for scripters to notice.

Tagging for update will do silent return unless running with debug
command line argument. This is because it's a bit tricky to know
which exact dependency graph corresponds to a context from which
an update tag was triggered.

Diff Detail

Repository
rB Blender

Event Timeline

source/blender/depsgraph/intern/depsgraph_tag.cc
627

Coul add , ignored at the end.

source/blender/depsgraph/intern/eval/deg_eval.cc
211 ↗(On Diff #18918)

This seems like an unrelated change?

source/blender/depsgraph/intern/eval/deg_eval.cc
211 ↗(On Diff #18918)

This is very first commit in the series:

Depsgraph: Don't use push-from-thread when scheduling graph

This isn't guaranteed that graph is scheduled from main thread,
so it is actually a miracle how it all worked.

Noticed an assert failure when following the steps from T70660.
I don't quite understand why the old logic worked for render threads, can dig into it and add comment perhaps.

This revision is now accepted and ready to land.Thu, Oct 10, 2:42 PM