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.
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user