diff options
Diffstat (limited to 'intern/cycles/device/device.cpp')
-rw-r--r-- | intern/cycles/device/device.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index eb8fb8040e3..1efd628b79b 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -17,6 +17,8 @@ #include <stdlib.h> #include <string.h> +#include "bvh/bvh2.h" + #include "device/device.h" #include "device/device_intern.h" @@ -364,6 +366,19 @@ void Device::draw_pixels(device_memory &rgba, } } +void Device::build_bvh(BVH *bvh, Progress &progress, bool refit) +{ + assert(bvh->params.bvh_layout == BVH_LAYOUT_BVH2); + + BVH2 *const bvh2 = static_cast<BVH2 *>(bvh); + if (refit) { + bvh2->refit(progress); + } + else { + bvh2->build(progress, &stats); + } +} + Device *Device::create(DeviceInfo &info, Stats &stats, Profiler &profiler, bool background) { #ifdef WITH_MULTI |