2023-06-14 16:52:36 +10:00
|
|
|
/* SPDX-FileCopyrightText: 2011-2023 Blender Foundation
|
|
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: Apache-2.0 */
|
2023-04-24 19:05:30 +02:00
|
|
|
|
|
|
|
|
#ifdef WITH_HIPRT
|
|
|
|
|
|
|
|
|
|
# include "bvh/hiprt.h"
|
|
|
|
|
|
|
|
|
|
# include "scene/mesh.h"
|
|
|
|
|
# include "scene/object.h"
|
|
|
|
|
|
|
|
|
|
# include "device/hiprt/device_impl.h"
|
|
|
|
|
|
|
|
|
|
CCL_NAMESPACE_BEGIN
|
|
|
|
|
|
|
|
|
|
BVHHIPRT::BVHHIPRT(const BVHParams ¶ms,
|
|
|
|
|
const vector<Geometry *> &geometry,
|
|
|
|
|
const vector<Object *> &objects,
|
|
|
|
|
Device *in_device)
|
|
|
|
|
: BVH(params, geometry, objects),
|
2024-12-26 17:53:59 +01:00
|
|
|
hiprt_geom(nullptr),
|
2023-04-24 19:05:30 +02:00
|
|
|
custom_primitive_bound(in_device, "Custom Primitive Bound", MEM_READ_ONLY),
|
|
|
|
|
triangle_index(in_device, "HIPRT Triangle Index", MEM_READ_ONLY),
|
|
|
|
|
vertex_data(in_device, "vertex_data", MEM_READ_ONLY),
|
|
|
|
|
device(in_device)
|
|
|
|
|
{
|
2024-12-26 17:53:59 +01:00
|
|
|
triangle_mesh = {nullptr};
|
|
|
|
|
custom_prim_aabb = {nullptr};
|
2023-04-24 19:05:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BVHHIPRT::~BVHHIPRT()
|
|
|
|
|
{
|
|
|
|
|
custom_primitive_bound.free();
|
|
|
|
|
triangle_index.free();
|
|
|
|
|
vertex_data.free();
|
2025-10-17 16:32:23 +02:00
|
|
|
device->release_bvh(this);
|
2023-04-24 19:05:30 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
CCL_NAMESPACE_END
|
|
|
|
|
|
|
|
|
|
#endif
|