Blender V4.3
optix.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2019 NVIDIA Corporation
2 * SPDX-FileCopyrightText: 2019-2022 Blender Foundation
3 *
4 * SPDX-License-Identifier: Apache-2.0 */
5
6#ifdef WITH_OPTIX
7
8# include "device/device.h"
9
10# include "bvh/optix.h"
11
13
14BVHOptiX::BVHOptiX(const BVHParams &params_,
15 const vector<Geometry *> &geometry_,
16 const vector<Object *> &objects_,
17 Device *device)
18 : BVH(params_, geometry_, objects_),
19 device(device),
20 traversable_handle(0),
21 as_data(make_unique<device_only_memory<char>>(
22 device, params.top_level ? "optix tlas" : "optix blas", false)),
23 motion_transform_data(
24 make_unique<device_only_memory<char>>(device, "optix motion transform", false))
25{
26}
27
28BVHOptiX::~BVHOptiX()
29{
30 /* Acceleration structure memory is delayed freed on device, since deleting the
31 * BVH may happen while still being used for rendering. */
32 device->release_bvh(this);
33}
34
36
37#endif /* WITH_OPTIX */
Definition bvh/bvh.h:66
virtual void release_bvh(BVH *)
#define CCL_NAMESPACE_END
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]