diff options
author | Jacques Lucke <jacques@blender.org> | 2022-01-12 13:15:22 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2022-01-12 13:15:22 +0300 |
commit | 1e61b759c7adc10be2df7edab35c507e804a7fed (patch) | |
tree | b5c8374274b52a27d65a2d834845ab99b2a5ff58 /source/blender/depsgraph/intern/builder/deg_builder_relations.cc | |
parent | 145f1d1e0a59c1de311a0511e05541563296d879 (diff) |
Fix T94797: crash when playing animation in eevee rendered view
The issue was caused by rBd09b1d2759861aa012ab2e7e4ce2ffa2.
Since this commit, the image users in gpu materials were updated
during depsgraph evaluation as well. However, there was a race
condition when one thread is deleting gpu materials in `BKE_material_eval`
while another thread is updating the image users at the same time.
The solution is to make sure that deleting gpu materials is done before
iterating over all gpu materials, by adding a new depsgraph relation.
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_relations.cc')
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder_relations.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 1c09417e9ab..fcdc3fe58e8 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -1475,6 +1475,17 @@ void DepsgraphRelationBuilder::build_animation_images(ID *id) id, NodeType::IMAGE_ANIMATION, OperationCode::IMAGE_ANIMATION); TimeSourceKey time_src_key; add_relation(time_src_key, image_animation_key, "TimeSrc -> Image Animation"); + + /* The image users of these ids may change during evaluation. Make sure that the image + * animation update happens after evaluation. */ + if (GS(id->name) == ID_MA) { + OperationKey material_update_key(id, NodeType::SHADING, OperationCode::MATERIAL_UPDATE); + add_relation(material_update_key, image_animation_key, "Material Update -> Image Animation"); + } + else if (GS(id->name) == ID_WO) { + OperationKey world_update_key(id, NodeType::SHADING, OperationCode::WORLD_UPDATE); + add_relation(world_update_key, image_animation_key, "World Update -> Image Animation"); + } } } |