Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2021-02-11 13:54:29 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2021-02-11 14:03:26 +0300
commit349c17cf5436d3726d22bcf61160b1e3cb320e12 (patch)
tree77557636f6d55c715479ea0061601d6c9193a6b1 /intern/cycles
parent69e191604b55b5c64acfb3d29253aca33fb023bb (diff)
Fix T85462: crash in render mode while removing instances
This crash is caused by accessing object data in the kernel at an out of bound index from a deleted instance. Cycles represents instances as Object nodes sharing the same Geometry node, so we need to tag the GeometryManager for an update if some objects are added or removed as no geometry might have been added or removed in order to properly update the BVH and its associated data arrays. Regression caused by rBbbe6d4492823.
Diffstat (limited to 'intern/cycles')
-rw-r--r--intern/cycles/render/object.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/intern/cycles/render/object.cpp b/intern/cycles/render/object.cpp
index 0f16a4fc12c..e837be9e6fb 100644
--- a/intern/cycles/render/object.cpp
+++ b/intern/cycles/render/object.cpp
@@ -915,7 +915,15 @@ void ObjectManager::tag_update(Scene *scene, uint32_t flag)
/* avoid infinite loops if the geometry manager tagged us for an update */
if ((flag & GEOMETRY_MANAGER) == 0) {
- scene->geometry_manager->tag_update(scene, GeometryManager::OBJECT_MANAGER);
+ uint32_t geometry_flag = GeometryManager::OBJECT_MANAGER;
+
+ /* Also notify in case added or removed objects were instances, as no Geometry might have been
+ * added or removed, but the BVH still needs to updated. */
+ if ((flag & (OBJECT_ADDED | OBJECT_REMOVED)) != 0) {
+ geometry_flag |= (GeometryManager::GEOMETRY_ADDED | GeometryManager::GEOMETRY_REMOVED);
+ }
+
+ scene->geometry_manager->tag_update(scene, geometry_flag);
}
scene->light_manager->tag_update(scene, LightManager::OBJECT_MANAGER);