Page MenuHome

Depsgraph: Wrong copy-on-write update after depsgraph rebuild.
ClosedPublic

Authored by Jacques Lucke (JacquesLucke) on Oct 17 2022, 4:03 PM.

Details

Summary

DepsgraphNodeBuilder::foreach_id_cow_detect_need_for_update_callback seems to only make sense for id types that actually support cow.

In this test file, the node tree is tagged with ID_RECALC_COPY_ON_WRITE after unrelated changes (e.g. when adding a new object). That can be seen in the terminal after applying P3260. That happens because it the node tree has a reference to a font which does not use cow, but does have an id node in the depsgraph.

Diff Detail

Repository
rB Blender
Branch
fix-wrong-update (branched from master)
Build Status
Buildable 24287
Build 24287: arc lint + arc unit

Event Timeline

Jacques Lucke (JacquesLucke) requested review of this revision.Oct 17 2022, 4:03 PM
Jacques Lucke (JacquesLucke) created this revision.
Jacques Lucke (JacquesLucke) retitled this revision from Fix T101797: Wrong depsgraph update tag. to Depsgraph: Wrong copy-on-write update after depsgraph rebuild..Oct 18 2022, 11:27 AM
Jacques Lucke (JacquesLucke) edited the summary of this revision. (Show Details)

Fix sounds good, indeed if the ID type is never 'CoW-able', there is no point in going further here, since that pointer can never point to a CoW ID, only always to the original ID.

For reference, this whole bit of code comes from rBcf4258673755: Fix T85752: Collection Instance Crash when instancing collections with disabled….

source/blender/depsgraph/intern/builder/deg_builder_nodes.cc
456–458

Would not hurt to have a comment explaining why non-CoW ID types can be skipped here?

This revision is now accepted and ready to land.Oct 18 2022, 2:31 PM