Merge branch 'blender-v2.92-release'

This commit is contained in:
Brecht Van Lommel 2021-02-17 15:56:24 +01:00
commit 5b6a3a57fb
2 changed files with 8 additions and 2 deletions

@ -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));

@ -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;