Blender V4.5
hiprt.cpp
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2023 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#ifdef WITH_HIPRT
6
7# include "bvh/hiprt.h"
8
9# include "scene/mesh.h"
10# include "scene/object.h"
11
13
15
16BVHHIPRT::BVHHIPRT(const BVHParams &params,
17 const vector<Geometry *> &geometry,
18 const vector<Object *> &objects,
19 Device *in_device)
20 : BVH(params, geometry, objects),
21 hiprt_geom(nullptr),
22 custom_primitive_bound(in_device, "Custom Primitive Bound", MEM_READ_ONLY),
23 triangle_index(in_device, "HIPRT Triangle Index", MEM_READ_ONLY),
24 vertex_data(in_device, "vertex_data", MEM_READ_ONLY),
25 device(in_device)
26{
27 triangle_mesh = {nullptr};
28 custom_prim_aabb = {nullptr};
29}
30
31BVHHIPRT::~BVHHIPRT()
32{
33 HIPRTDevice *hiprt_device = static_cast<HIPRTDevice *>(device);
34 hiprtContext hiprt_context = hiprt_device->get_hiprt_context();
35 custom_primitive_bound.free();
36 triangle_index.free();
37 vertex_data.free();
38 hiprtDestroyGeometry(hiprt_context, hiprt_geom);
39}
40
42
43#endif
Definition bvh/bvh.h:67
@ MEM_READ_ONLY
#define CCL_NAMESPACE_END
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]