Blender  V3.3
device/metal/bvh.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: Apache-2.0
2  * Copyright 2021-2022 Blender Foundation */
3 
4 #pragma once
5 
6 #ifdef WITH_METAL
7 
8 # include "bvh/bvh.h"
9 # include "bvh/params.h"
10 # include "device/memory.h"
11 
12 # include <Metal/Metal.h>
13 
15 
16 class BVHMetal : public BVH {
17  public:
18  API_AVAILABLE(macos(11.0))
19  id<MTLAccelerationStructure> accel_struct = nil;
20  bool accel_struct_building = false;
21 
22  API_AVAILABLE(macos(11.0))
23  vector<id<MTLAccelerationStructure>> blas_array;
24 
25  bool motion_blur = false;
26 
27  Stats &stats;
28 
29  bool build(Progress &progress, id<MTLDevice> device, id<MTLCommandQueue> queue, bool refit);
30 
31  BVHMetal(const BVHParams &params,
32  const vector<Geometry *> &geometry,
33  const vector<Object *> &objects,
34  Device *device);
35  virtual ~BVHMetal();
36 
37  bool build_BLAS(Progress &progress, id<MTLDevice> device, id<MTLCommandQueue> queue, bool refit);
38  bool build_BLAS_mesh(Progress &progress,
39  id<MTLDevice> device,
40  id<MTLCommandQueue> queue,
41  Geometry *const geom,
42  bool refit);
43  bool build_BLAS_hair(Progress &progress,
44  id<MTLDevice> device,
45  id<MTLCommandQueue> queue,
46  Geometry *const geom,
47  bool refit);
48  bool build_BLAS_pointcloud(Progress &progress,
49  id<MTLDevice> device,
50  id<MTLCommandQueue> queue,
51  Geometry *const geom,
52  bool refit);
53  bool build_TLAS(Progress &progress, id<MTLDevice> device, id<MTLCommandQueue> queue, bool refit);
54 };
55 
57 
58 #endif /* WITH_METAL */
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:63
#define CCL_NAMESPACE_END
Definition: cuda/compat.h:9
SyclQueue * queue
uiWidgetBaseParameters params[MAX_WIDGET_BASE_BATCH]