Fix #129596: Always use multithreaded BVH building in Cycles again

The workaround of forcing BVH building into single thread
execution on the Blender side is not needed anymore,
because the problem was properly fixed in the upstream
since Embree upgrade in Blender 4.5

This reverts commit c0f0e2ca6f.

Pull Request: https://projects.blender.org/blender/blender/pulls/146859
This commit is contained in:
Nikita Sirgienko
2025-09-27 21:07:39 +02:00
parent ce85d4cbaf
commit d36eea7fa7
4 changed files with 3 additions and 29 deletions

View File

@@ -831,17 +831,4 @@ bool GPUDevice::is_shared(const void *shared_pointer,
/* DeviceInfo */
bool DeviceInfo::contains_device_type(const DeviceType type) const
{
if (this->type == type) {
return true;
}
for (const DeviceInfo &info : multi_devices) {
if (info.contains_device_type(type)) {
return true;
}
}
return false;
}
CCL_NAMESPACE_END

View File

@@ -119,8 +119,6 @@ class DeviceInfo {
{
return !(*this == info);
}
bool contains_device_type(const DeviceType type) const;
};
/* Device */

View File

@@ -957,12 +957,6 @@ void GeometryManager::device_update(Device *device,
}
});
/* Work around Embree/oneAPI bug #129596 with BVH updates. */
/* Also note the use of #bvh_task_pool_, see its definition for details. */
const bool use_multithreaded_build = first_bvh_build ||
!device->info.contains_device_type(DEVICE_ONEAPI);
first_bvh_build = false;
size_t i = 0;
size_t num_bvh = 0;
for (Geometry *geom : scene->geometry) {
@@ -974,14 +968,10 @@ void GeometryManager::device_update(Device *device,
num_bvh++;
}
if (use_multithreaded_build) {
bvh_task_pool_.push([geom, device, dscene, scene, &progress, i, &num_bvh] {
geom->compute_bvh(device, dscene, &scene->params, &progress, i, num_bvh);
});
}
else {
/* Note the use of #bvh_task_pool_, see its definition for details. */
bvh_task_pool_.push([geom, device, dscene, scene, &progress, i, &num_bvh] {
geom->compute_bvh(device, dscene, &scene->params, &progress, i, num_bvh);
}
});
}
}

View File

@@ -237,7 +237,6 @@ class GeometryManager {
/* Update Flags */
bool need_flags_update;
bool first_bvh_build = true;
/* Constructor/Destructor */
GeometryManager();