Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey@blender.org>2021-11-22 19:32:23 +0300
committerSergey Sharybin <sergey@blender.org>2021-11-22 19:32:23 +0300
commit1706bf7780a04a5affa016339a1fdb2563e97cb0 (patch)
tree462ce2a6500825e27f3ffa6dc85224151a5608c8 /intern/cycles/bvh
parent059da44fbc30803e019214c852cb2f3b99f97069 (diff)
parent336ca6796a7a6ee26ff6d889643df07a37efa554 (diff)
Merge branch 'blender-v3.0-release'
Diffstat (limited to 'intern/cycles/bvh')
-rw-r--r--intern/cycles/bvh/optix.cpp10
-rw-r--r--intern/cycles/bvh/optix.h6
2 files changed, 10 insertions, 6 deletions
diff --git a/intern/cycles/bvh/optix.cpp b/intern/cycles/bvh/optix.cpp
index ebc3fa68b97..671e1a42a31 100644
--- a/intern/cycles/bvh/optix.cpp
+++ b/intern/cycles/bvh/optix.cpp
@@ -30,15 +30,17 @@ BVHOptiX::BVHOptiX(const BVHParams &params_,
: BVH(params_, geometry_, objects_),
device(device),
traversable_handle(0),
- as_data(device, params_.top_level ? "optix tlas" : "optix blas", false),
- motion_transform_data(device, "optix motion transform", false)
+ as_data(make_unique<device_only_memory<char>>(
+ device, params.top_level ? "optix tlas" : "optix blas", false)),
+ motion_transform_data(
+ make_unique<device_only_memory<char>>(device, "optix motion transform", false))
{
}
BVHOptiX::~BVHOptiX()
{
- // Acceleration structure memory is delayed freed on device, since deleting the
- // BVH may happen while still being used for rendering.
+ /* Acceleration structure memory is delayed freed on device, since deleting the
+ * BVH may happen while still being used for rendering. */
device->release_optix_bvh(this);
}
diff --git a/intern/cycles/bvh/optix.h b/intern/cycles/bvh/optix.h
index 037e54980bd..cb855d786bf 100644
--- a/intern/cycles/bvh/optix.h
+++ b/intern/cycles/bvh/optix.h
@@ -25,14 +25,16 @@
# include "device/memory.h"
+# include "util/unique_ptr.h"
+
CCL_NAMESPACE_BEGIN
class BVHOptiX : public BVH {
public:
Device *device;
uint64_t traversable_handle;
- device_only_memory<char> as_data;
- device_only_memory<char> motion_transform_data;
+ unique_ptr<device_only_memory<char>> as_data;
+ unique_ptr<device_only_memory<char>> motion_transform_data;
protected:
friend class BVH;