Blender V4.5
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 build(Progress &progress, id<MTLDevice> device, id<MTLCommandQueue> queue, bool refit);
39
40 BVHMetal(const BVHParams &params,
41 const vector<Geometry *> &geometry,
42 const vector<Object *> &objects,
43 Device *device);
44 ~BVHMetal() override;
45
46 bool build_BLAS(Progress &progress, id<MTLDevice> device, id<MTLCommandQueue> queue, bool refit);
47 bool build_BLAS_mesh(Progress &progress,
48 id<MTLDevice> device,
49 id<MTLCommandQueue> queue,
50 Geometry *const geom,
51 bool refit);
52 bool build_BLAS_hair(Progress &progress,
53 id<MTLDevice> device,
54 id<MTLCommandQueue> queue,
55 Geometry *const geom,
56 bool refit);
57 bool build_BLAS_pointcloud(Progress &progress,
58 id<MTLDevice> device,
59 id<MTLCommandQueue> queue,
60 Geometry *const geom,
61 bool refit);
62 bool build_TLAS(Progress &progress, id<MTLDevice> device, id<MTLCommandQueue> queue, bool refit);
63
64 API_AVAILABLE(macos(11.0))
65 void set_accel_struct(id<MTLAccelerationStructure> new_accel_struct);
66};
67
69
70#endif /* WITH_METAL */
struct Object Object
float progress
Definition WM_types.hh:1019
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:1184