Blender Git Commit Log

Git Commits -> Revision 0c8aa85

Revision 0c8aa85 by Sergey Sharybin (master)
November 7, 2018, 13:04 (GMT)
Physics baking: tag interface locked during backing

This is a variation of older hach which was setting is_rendering
to truth to tell window manager to not do dependency graph update.

In the nowadays reality window manager is supposed to do dependency
graph update during rendering, that was the whole purpose of CoW
project. This works fine for rendering, since render engines has
their own dependency graphs.

Physics, on the other hand, is using same dependency graph as used
for the viewport, and what's worse: it modifies objects from it.
For example, in a single threaded evaluation ASAN instantly catches
case when cached BVH constructed by smoke is referencing looptri
layer which is freed by viewport's update.

Now we are locking interface, allowing only a subset of navigation
operators to run. This seems to be safest way of dealing with the
problem. There are following variations which we can consider
doing:

- Allow viewport navigation, which will require making it so draw
manager does not write to the objects.

A bit dangerous, since smoke simulation might in theory modify
data which is also used by a draw manager.

- Make physics simulation to have own dedicated dependency graph,
solving all threading conflicts all together.

This fixes crash when baking smoke. Steps to reproduce:

- Call "Quick Smoke"
- In smoke panel, click "Bake".

Commit Details:

Full Hash: 0c8aa85069fabd20d5f030f016a85ad060839066
Parent Commit: ee201d8
Lines Changed: +4, -6

1 Modified Path:

/source/blender/editors/physics/physics_pointcache.c (+4, -6) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021