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:
authorBrecht Van Lommel <brecht@blender.org>2020-11-11 20:39:46 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-11-12 22:14:12 +0300
commitd59fa12f2ad5c57c68d63e476270fcd274b61062 (patch)
tree53021c1ae77da2a5b7524d7dcb1b692c13a94f4a /intern/cycles/render/geometry.cpp
parent5c01ecd2bf5d0dc0d42f90aba2a3d9f948d16bb8 (diff)
Fix T82607: crash cancelling Cycles render during adaptive subdivision update
Now that the Blender sync mechanism deletes nodes from the scene, we need to ensure scene update is stopped before we do this. Also add some more early out in scene geometry update to ensure we do not continue working on incomplete geometry data, though that was not the cause of this crash.
Diffstat (limited to 'intern/cycles/render/geometry.cpp')
-rw-r--r--intern/cycles/render/geometry.cpp39
1 files changed, 30 insertions, 9 deletions
diff --git a/intern/cycles/render/geometry.cpp b/intern/cycles/render/geometry.cpp
index fdfce63bbeb..03f10075147 100644
--- a/intern/cycles/render/geometry.cpp
+++ b/intern/cycles/render/geometry.cpp
@@ -1275,12 +1275,17 @@ void GeometryManager::device_update(Device *device,
true_displacement_used = true;
}
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
}
}
}
+ if (progress.get_cancel()) {
+ return;
+ }
+
/* Tessellate meshes that are using subdivision */
if (total_tess_needed) {
scoped_callback_timer timer([scene](double time) {
@@ -1317,10 +1322,15 @@ void GeometryManager::device_update(Device *device,
i++;
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
}
}
+
+ if (progress.get_cancel()) {
+ return;
+ }
}
/* Update images needed for true displacement. */
@@ -1350,8 +1360,9 @@ void GeometryManager::device_update(Device *device,
});
device_update_mesh(device, dscene, scene, true, progress);
}
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
{
scoped_callback_timer timer([scene](double time) {
@@ -1360,8 +1371,9 @@ void GeometryManager::device_update(Device *device,
}
});
device_update_attributes(device, dscene, scene, progress);
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
}
/* Update displacement. */
@@ -1391,11 +1403,16 @@ void GeometryManager::device_update(Device *device,
}
}
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
}
}
+ if (progress.get_cancel()) {
+ return;
+ }
+
/* Device re-update after displacement. */
if (displacement_done) {
scoped_callback_timer timer([scene](double time) {
@@ -1407,8 +1424,9 @@ void GeometryManager::device_update(Device *device,
device_free(device, dscene);
device_update_attributes(device, dscene, scene, progress);
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
}
{
@@ -1455,8 +1473,9 @@ void GeometryManager::device_update(Device *device,
}
}
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
{
scoped_callback_timer timer([scene](double time) {
@@ -1465,8 +1484,9 @@ void GeometryManager::device_update(Device *device,
}
});
device_update_bvh(device, dscene, scene, progress);
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
}
{
@@ -1477,8 +1497,9 @@ void GeometryManager::device_update(Device *device,
}
});
device_update_mesh(device, dscene, scene, false, progress);
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
}
need_update = false;