diff options
author | Brecht Van Lommel <brecht@blender.org> | 2021-02-17 17:56:24 +0300 |
---|---|---|
committer | Brecht Van Lommel <brecht@blender.org> | 2021-02-17 17:56:24 +0300 |
commit | 5b6a3a57fbf625efe306e0a1b17e7a553e850074 (patch) | |
tree | 64077c0a36dbe1f705d113424875f3c77386b12e | |
parent | 0cbbb9edd79d69a4925289bfe8e92ea9d599a3e2 (diff) | |
parent | 2217719feb250458bef461d405985e79d3c72a14 (diff) |
Merge branch 'blender-v2.92-release'
-rw-r--r-- | intern/cycles/render/geometry.cpp | 9 | ||||
-rw-r--r-- | intern/cycles/render/geometry.h | 1 |
2 files changed, 8 insertions, 2 deletions
diff --git a/intern/cycles/render/geometry.cpp b/intern/cycles/render/geometry.cpp index 575042360aa..2c2b987e5c0 100644 --- a/intern/cycles/render/geometry.cpp +++ b/intern/cycles/render/geometry.cpp @@ -61,6 +61,7 @@ Geometry::Geometry(const NodeType *node_type, const Type type) : Node(node_type), geometry_type(type), attributes(this, ATTR_PRIM_GEOMETRY) { need_update_rebuild = false; + need_update_bvh_for_offset = false; transform_applied = false; transform_negative_scaled = false; @@ -241,6 +242,7 @@ void Geometry::compute_bvh( } need_update_rebuild = false; + need_update_bvh_for_offset = false; } bool Geometry::has_motion_blur() const @@ -964,7 +966,8 @@ void GeometryManager::mesh_calc_offset(Scene *scene, BVHLayout bvh_layout) const bool has_optix_bvh = bvh_layout == BVH_LAYOUT_OPTIX || bvh_layout == BVH_LAYOUT_MULTI_OPTIX || bvh_layout == BVH_LAYOUT_MULTI_OPTIX_EMBREE; - geom->tag_bvh_update(has_optix_bvh); + geom->need_update_rebuild |= has_optix_bvh; + geom->need_update_bvh_for_offset = true; } if (geom->geometry_type == Geometry::MESH || geom->geometry_type == Geometry::VOLUME) { @@ -1878,7 +1881,9 @@ void GeometryManager::device_update(Device *device, displacement_done = true; } } + } + if (geom->is_modified() || geom->need_update_bvh_for_offset) { if (geom->need_build_bvh(bvh_layout)) { num_bvh++; } @@ -1923,7 +1928,7 @@ void GeometryManager::device_update(Device *device, size_t i = 0; foreach (Geometry *geom, scene->geometry) { - if (geom->is_modified()) { + if (geom->is_modified() || geom->need_update_bvh_for_offset) { need_update_scene_bvh = true; pool.push(function_bind( &Geometry::compute_bvh, geom, device, dscene, &scene->params, &progress, i, num_bvh)); diff --git a/intern/cycles/render/geometry.h b/intern/cycles/render/geometry.h index 88388f31a9b..fe30f3a807c 100644 --- a/intern/cycles/render/geometry.h +++ b/intern/cycles/render/geometry.h @@ -90,6 +90,7 @@ class Geometry : public Node { /* Update Flags */ bool need_update_rebuild; + bool need_update_bvh_for_offset; /* Index into scene->geometry (only valid during update) */ size_t index; |