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