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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
use objc2::{
extern_class, extern_conformance, extern_methods,
rc::{Allocated, Retained},
runtime::{NSObject, ProtocolObject},
};
use objc2_foundation::{CopyingHelper, NSCopying, NSObjectProtocol};
use crate::MTLCounterSampleBuffer;
extern_class!(
/// Sample buffer attachment descriptor for acceleration structure passes.
///
/// Availability: macOS 13.0+, iOS 16.0+
///
/// - `sample_buffer`: The sample buffer to store samples for the
/// acceleration structure pass defined samples. If non-`None`, the sample
/// indices will be used to store samples into the sample buffer. If no
/// sample buffer is provided, no samples will be taken. If any of the
/// sample indices are specified as `MTLCounterDontSample`, no sample will
/// be taken for that action.
/// - `start_of_encoder_sample_index`: Sample index to use to store the
/// sample taken at the start of command encoder processing. Setting the
/// value to `MTLCounterDontSample` omits this sample. On devices where
/// `MTLCounterSamplingPointAtStageBoundary` is unsupported, this index is
/// invalid and must be set to `MTLCounterDontSample` or creation of an
/// acceleration structure pass will fail.
/// - `end_of_encoder_sample_index`: Sample index to use to store the sample
/// taken at the end of command encoder processing. Setting the value to
/// `MTLCounterDontSample` omits this sample. On devices where
/// `MTLCounterSamplingPointAtStageBoundary` is unsupported, this index is
/// invalid and must be set to `MTLCounterDontSample` or creation of an
/// acceleration structure pass will fail.
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLAccelerationStructurePassSampleBufferAttachmentDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MTLAccelerationStructurePassSampleBufferAttachmentDescriptor {}
);
unsafe impl CopyingHelper for MTLAccelerationStructurePassSampleBufferAttachmentDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTLAccelerationStructurePassSampleBufferAttachmentDescriptor {}
);
impl MTLAccelerationStructurePassSampleBufferAttachmentDescriptor {
extern_methods!(
/// The sample buffer to store samples for the acceleration structure
/// pass defined samples. If `Some`, the sample indices will be used to
/// store samples into the sample buffer. If `None`, no samples will be
/// taken. If any sample index is `MTLCounterDontSample`, no sample is
/// taken for that action.
#[unsafe(method(sampleBuffer))]
#[unsafe(method_family = none)]
pub fn sample_buffer(&self) -> Option<Retained<ProtocolObject<dyn MTLCounterSampleBuffer>>>;
/// Set the sample buffer used to store samples for encoder-defined
/// samples. See getter for behavior when `None` or when indices are
/// `MTLCounterDontSample`.
#[unsafe(method(setSampleBuffer:))]
#[unsafe(method_family = none)]
pub fn set_sample_buffer(
&self,
sample_buffer: Option<&ProtocolObject<dyn MTLCounterSampleBuffer>>,
);
/// Sample index used to store the sample taken at the start of command
/// encoder processing. Set to `MTLCounterDontSample` to omit.
/// On devices where `MTLCounterSamplingPointAtStageBoundary` is
/// unsupported, this must be `MTLCounterDontSample` or pass creation
/// will fail.
#[unsafe(method(startOfEncoderSampleIndex))]
#[unsafe(method_family = none)]
pub fn start_of_encoder_sample_index(&self) -> usize;
#[unsafe(method(setStartOfEncoderSampleIndex:))]
#[unsafe(method_family = none)]
pub fn set_start_of_encoder_sample_index(
&self,
value: usize,
);
/// Sample index used to store the sample taken at the end of command
/// encoder processing. Set to `MTLCounterDontSample` to omit.
/// On devices where `MTLCounterSamplingPointAtStageBoundary` is
/// unsupported, this must be `MTLCounterDontSample` or pass creation
/// will fail.
#[unsafe(method(endOfEncoderSampleIndex))]
#[unsafe(method_family = none)]
pub fn end_of_encoder_sample_index(&self) -> usize;
#[unsafe(method(setEndOfEncoderSampleIndex:))]
#[unsafe(method_family = none)]
pub fn set_end_of_encoder_sample_index(
&self,
value: usize,
);
);
}
impl MTLAccelerationStructurePassSampleBufferAttachmentDescriptor {
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>;
);
}