1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
use objc2::{
extern_class, extern_conformance, extern_methods,
rc::{Allocated, Retained},
};
use objc2_foundation::{CopyingHelper, NSCopying, NSObject, NSObjectProtocol, NSUInteger};
use crate::*;
extern_class!(
/// Describes bounding-box geometry suitable for ray tracing.
///
/// You use bounding boxes to implement procedural geometry for ray tracing, such as spheres or any other shape
/// you define by using intersection functions.
///
/// Use a ``MTLResidencySet`` to mark residency of all buffers this descriptor references when you build this
/// acceleration structure.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtl4accelerationstructureboundingboxgeometrydescriptor?language=objc)
#[unsafe(super(MTL4AccelerationStructureGeometryDescriptor, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTL4AccelerationStructureBoundingBoxGeometryDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MTL4AccelerationStructureBoundingBoxGeometryDescriptor {}
);
unsafe impl CopyingHelper for MTL4AccelerationStructureBoundingBoxGeometryDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTL4AccelerationStructureBoundingBoxGeometryDescriptor {}
);
impl MTL4AccelerationStructureBoundingBoxGeometryDescriptor {
extern_methods!(
/// References a buffer containing bounding box data in `MTLAxisAlignedBoundingBoxes` format.
///
/// You are responsible for ensuring the buffer address of the range is not zero.
#[unsafe(method(boundingBoxBuffer))]
#[unsafe(method_family = none)]
pub fn bounding_box_buffer(&self) -> MTL4BufferRange;
/// Setter for [`boundingBoxBuffer`][Self::boundingBoxBuffer].
#[unsafe(method(setBoundingBoxBuffer:))]
#[unsafe(method_family = none)]
pub fn set_bounding_box_buffer(
&self,
bounding_box_buffer: MTL4BufferRange,
);
/// Assigns the stride, in bytes, between bounding boxes in the bounding box buffer `boundingBoxBuffer` references.
///
/// You are responsible for ensuring this stride is at least 24 bytes and a multiple of 4 bytes.
///
/// This property defaults to `24` bytes.
#[unsafe(method(boundingBoxStride))]
#[unsafe(method_family = none)]
pub fn bounding_box_stride(&self) -> NSUInteger;
/// Setter for [`boundingBoxStride`][Self::boundingBoxStride].
#[unsafe(method(setBoundingBoxStride:))]
#[unsafe(method_family = none)]
pub fn set_bounding_box_stride(
&self,
bounding_box_stride: NSUInteger,
);
/// Describes the number of bounding boxes the `boundingBoxBuffer` contains.
#[unsafe(method(boundingBoxCount))]
#[unsafe(method_family = none)]
pub fn bounding_box_count(&self) -> NSUInteger;
/// Setter for [`boundingBoxCount`][Self::boundingBoxCount].
#[unsafe(method(setBoundingBoxCount:))]
#[unsafe(method_family = none)]
pub fn set_bounding_box_count(
&self,
bounding_box_count: NSUInteger,
);
);
}
/// Methods declared on superclass `NSObject`.
impl MTL4AccelerationStructureBoundingBoxGeometryDescriptor {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new() -> Retained<Self>;
);
}