Blender  V2.93
bvh_optix.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2019, NVIDIA Corporation.
3  * Copyright 2019, Blender Foundation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #ifdef WITH_OPTIX
19 
20 # include "device/device.h"
21 
22 # include "bvh/bvh_optix.h"
23 
25 
26 BVHOptiX::BVHOptiX(const BVHParams &params_,
27  const vector<Geometry *> &geometry_,
28  const vector<Object *> &objects_,
29  Device *device)
30  : BVH(params_, geometry_, objects_),
31  device(device),
32  traversable_handle(0),
33  as_data(device, params_.top_level ? "optix tlas" : "optix blas", false),
34  motion_transform_data(device, "optix motion transform", false)
35 {
36 }
37 
38 BVHOptiX::~BVHOptiX()
39 {
40  // Acceleration structure memory is delayed freed on device, since deleting the
41  // BVH may happen while still being used for rendering.
42  device->release_optix_bvh(this);
43 }
44 
46 
47 #endif /* WITH_OPTIX */
Definition: bvh/bvh.h:80
Definition: device.h:293
virtual void release_optix_bvh(BVH *)
Definition: device.h:430
#define CCL_NAMESPACE_END