Blender V5.0
device/metal/bvh.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021-2022 Blender Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#ifdef WITH_METAL
8
9# include "bvh/bvh.h"
10# include "bvh/params.h"
11# include "device/memory.h"
12
13# include <Metal/Metal.h>
14
16
17class BVHMetal : public BVH {
18 public:
19 API_AVAILABLE(macos(11.0))
20 id<MTLAccelerationStructure> accel_struct = nil;
21
22 API_AVAILABLE(macos(11.0))
23 id<MTLAccelerationStructure> null_BLAS = nil;
24
25 API_AVAILABLE(macos(11.0))
26 vector<id<MTLAccelerationStructure>> blas_array;
27
28 API_AVAILABLE(macos(11.0))
29 vector<id<MTLAccelerationStructure>> unique_blas_array;
30
31 Device *device = nullptr;
32
33 bool motion_blur = false;
34
35 /* Per-component Motion Interpolation in macOS 15. */
36 bool use_pcmi = false;
37
38 bool extended_limits = false;
39
40 bool build(Progress &progress, id<MTLDevice> device, id<MTLCommandQueue> queue, bool refit);
41
42 BVHMetal(const BVHParams &params,
43 const vector<Geometry *> &geometry,
44 const vector<Object *> &objects,
45 Device *device);
46 ~BVHMetal() override;
47
48 bool build_BLAS(Progress &progress, id<MTLDevice> device, id<MTLCommandQueue> queue, bool refit);
49 bool build_BLAS_mesh(Progress &progress,
50 id<MTLDevice> device,
51 id<MTLCommandQueue> queue,
52 Geometry *const geom,
53 bool refit);
54 bool build_BLAS_hair(Progress &progress,
55 id<MTLDevice> device,
56 id<MTLCommandQueue> queue,
57 Geometry *const geom,
58 bool refit);
59 bool build_BLAS_pointcloud(Progress &progress,
60 id<MTLDevice> device,
61 id<MTLCommandQueue> queue,
62 Geometry *const geom,
63 bool refit);
64 bool build_TLAS(Progress &progress, id<MTLDevice> device, id<MTLCommandQueue> queue, bool refit);
65
66 API_AVAILABLE(macos(11.0))
67 void set_accel_struct(id<MTLAccelerationStructure> new_accel_struct);
68};
69
71
72#endif /* WITH_METAL */
struct Object Object
void refit(btStridingMeshInterface *triangles, const btVector3 &aabbMin, const btVector3 &aabbMax)
void build(btStridingMeshInterface *triangles, bool useQuantizedAabbCompression, const btVector3 &bvhAabbMin, const btVector3 &bvhAabbMax)
Definition bvh/bvh.h:67
#define CCL_NAMESPACE_END
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]
bool override
Definition wm_files.cc:1192