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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlblitpasssamplebufferattachmentdescriptor?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLBlitPassSampleBufferAttachmentDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MTLBlitPassSampleBufferAttachmentDescriptor {}
);
unsafe impl CopyingHelper for MTLBlitPassSampleBufferAttachmentDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTLBlitPassSampleBufferAttachmentDescriptor {}
);
impl MTLBlitPassSampleBufferAttachmentDescriptor {
extern_methods!(
#[cfg(feature = "MTLCounters")]
/// The sample buffer to store samples for the blit-pass defined samples.
/// If sampleBuffer is non-nil, 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.
#[unsafe(method(sampleBuffer))]
#[unsafe(method_family = none)]
pub fn sampleBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLCounterSampleBuffer>>>;
#[cfg(feature = "MTLCounters")]
/// Setter for [`sampleBuffer`][Self::sampleBuffer].
#[unsafe(method(setSampleBuffer:))]
#[unsafe(method_family = none)]
pub fn setSampleBuffer(
&self,
sample_buffer: Option<&ProtocolObject<dyn MTLCounterSampleBuffer>>,
);
/// The sample index to use to store the sample taken at the start of
/// command encoder processing. Setting the value to MTLCounterDontSample will cause
/// this sample to be omitted.
///
/// On devices where MTLCounterSamplingPointAtStageBoundary is unsupported,
/// this sample index is invalid and must be set to MTLCounterDontSample or creation of a blit pass will fail.
#[unsafe(method(startOfEncoderSampleIndex))]
#[unsafe(method_family = none)]
pub fn startOfEncoderSampleIndex(&self) -> NSUInteger;
/// Setter for [`startOfEncoderSampleIndex`][Self::startOfEncoderSampleIndex].
///
/// # Safety
///
/// This might not be bounds-checked.
#[unsafe(method(setStartOfEncoderSampleIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn setStartOfEncoderSampleIndex(
&self,
start_of_encoder_sample_index: NSUInteger,
);
/// The sample index to use to store the sample taken at the end of
/// Command encoder processing. Setting the value to MTLCounterDontSample will cause
/// this sample to be omitted.
///
/// On devices where MTLCounterSamplingPointAtStageBoundary is unsupported,
/// this sample index is invalid and must be set to MTLCounterDontSample or creation of a blit pass will fail.
#[unsafe(method(endOfEncoderSampleIndex))]
#[unsafe(method_family = none)]
pub fn endOfEncoderSampleIndex(&self) -> NSUInteger;
/// Setter for [`endOfEncoderSampleIndex`][Self::endOfEncoderSampleIndex].
///
/// # Safety
///
/// This might not be bounds-checked.
#[unsafe(method(setEndOfEncoderSampleIndex:))]
#[unsafe(method_family = none)]
pub unsafe fn setEndOfEncoderSampleIndex(&self, end_of_encoder_sample_index: NSUInteger);
);
}
/// Methods declared on superclass `NSObject`.
impl MTLBlitPassSampleBufferAttachmentDescriptor {
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>;
);
}
impl DefaultRetained for MTLBlitPassSampleBufferAttachmentDescriptor {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern_class!(
/// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlblitpasssamplebufferattachmentdescriptorarray?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLBlitPassSampleBufferAttachmentDescriptorArray;
);
extern_conformance!(
unsafe impl NSObjectProtocol for MTLBlitPassSampleBufferAttachmentDescriptorArray {}
);
impl MTLBlitPassSampleBufferAttachmentDescriptorArray {
extern_methods!(
/// # Safety
///
/// `attachmentIndex` might not be bounds-checked.
#[unsafe(method(objectAtIndexedSubscript:))]
#[unsafe(method_family = none)]
pub unsafe fn objectAtIndexedSubscript(
&self,
attachment_index: NSUInteger,
) -> Retained<MTLBlitPassSampleBufferAttachmentDescriptor>;
/// # Safety
///
/// `attachmentIndex` might not be bounds-checked.
#[unsafe(method(setObject:atIndexedSubscript:))]
#[unsafe(method_family = none)]
pub unsafe fn setObject_atIndexedSubscript(
&self,
attachment: Option<&MTLBlitPassSampleBufferAttachmentDescriptor>,
attachment_index: NSUInteger,
);
);
}
/// Methods declared on superclass `NSObject`.
impl MTLBlitPassSampleBufferAttachmentDescriptorArray {
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>;
);
}
impl DefaultRetained for MTLBlitPassSampleBufferAttachmentDescriptorArray {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}
extern_class!(
/// MTLBlitPassDescriptor represents a collection of attachments to be used to create a concrete blit command encoder
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlblitpassdescriptor?language=objc)
#[unsafe(super(NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
pub struct MTLBlitPassDescriptor;
);
extern_conformance!(
unsafe impl NSCopying for MTLBlitPassDescriptor {}
);
unsafe impl CopyingHelper for MTLBlitPassDescriptor {
type Result = Self;
}
extern_conformance!(
unsafe impl NSObjectProtocol for MTLBlitPassDescriptor {}
);
impl MTLBlitPassDescriptor {
extern_methods!(
/// Create an autoreleased default frame buffer descriptor
#[unsafe(method(blitPassDescriptor))]
#[unsafe(method_family = none)]
pub fn blitPassDescriptor() -> Retained<MTLBlitPassDescriptor>;
/// An array of sample buffers and associated sample indices.
#[unsafe(method(sampleBufferAttachments))]
#[unsafe(method_family = none)]
pub fn sampleBufferAttachments(
&self,
) -> Retained<MTLBlitPassSampleBufferAttachmentDescriptorArray>;
);
}
/// Methods declared on superclass `NSObject`.
impl MTLBlitPassDescriptor {
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>;
);
}
impl DefaultRetained for MTLBlitPassDescriptor {
#[inline]
fn default_retained() -> Retained<Self> {
Self::new()
}
}