[Bf-blender-cvs] [fefad4ee1c1] cycles_procedural_api: Merge branch 'master' into cycles_procedural_api
Kévin Dietrich
noreply at git.blender.org
Mon Nov 16 13:11:32 CET 2020
Commit: fefad4ee1c1b829144525ef1e32a003c63412cae
Author: Kévin Dietrich
Date: Fri Nov 13 11:52:57 2020 +0100
Branches: cycles_procedural_api
https://developer.blender.org/rBfefad4ee1c1b829144525ef1e32a003c63412cae
Merge branch 'master' into cycles_procedural_api
===================================================================
===================================================================
diff --cc intern/cycles/render/geometry.cpp
index 99c16a1b900,12f4eaf0b79..21af3ffffc3
--- a/intern/cycles/render/geometry.cpp
+++ b/intern/cycles/render/geometry.cpp
@@@ -1612,14 -1456,17 +1617,19 @@@ void GeometryManager::device_update(Dev
DiagSplit dsplit(*mesh->subd_params);
mesh->tessellate(&dsplit);
+ device_update_flags |= DEVICE_MESH_DATA_NEEDS_REALLOC;
+
i++;
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
}
}
+
+ if (progress.get_cancel()) {
+ return;
+ }
}
/* Update images needed for true displacement. */
@@@ -1706,14 -1560,11 +1723,15 @@@
device_free(device, dscene);
device_update_attributes(device, dscene, scene, progress);
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
}
+ /* update the bvh even when there is no geometry so the kernel bvh data is still valid,
+ * especially when removing all the objects in interactive rendering */
+ bool need_update_scene_bvh = scene->geometry.size() == 0 ||
+ (device_update_flags & DEVICE_MESH_DATA_NEEDS_REALLOC);
{
scoped_callback_timer timer([scene](double time) {
if (scene->update_stats) {
@@@ -1761,13 -1609,20 +1779,15 @@@
}
}
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
- {
- scoped_callback_timer timer([scene](double time) {
- if (scene->update_stats) {
- scene->update_stats->geometry.times.add_entry({"device_update (build scene BVH)", time});
- }
- });
+ if (need_update_scene_bvh) {
device_update_bvh(device, dscene, scene, progress);
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
}
{
@@@ -1778,27 -1633,12 +1798,28 @@@
}
});
device_update_mesh(device, dscene, scene, false, progress);
- if (progress.get_cancel())
+ if (progress.get_cancel()) {
return;
+ }
}
- need_update = false;
+ foreach (Geometry *geom, scene->geometry) {
+ geom->clear_modified();
+
+ foreach (Attribute &attr, geom->attributes.attributes) {
+ attr.modified = false;
+ }
+
+ if (geom->is_mesh()) {
+ Mesh *mesh = static_cast<Mesh *>(geom);
+
+ foreach (Attribute &attr, mesh->subd_attributes.attributes) {
+ attr.modified = false;
+ }
+ }
+ }
+
+ update_flags = UPDATE_NONE;
if (true_displacement_used) {
/* Re-tag flags for update, so they're re-evaluated
More information about the Bf-blender-cvs
mailing list