objc2_metal/generated/
MTLResourceStatePass.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10extern_class!(
11    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlresourcestatepasssamplebufferattachmentdescriptor?language=objc)
12    #[unsafe(super(NSObject))]
13    #[derive(Debug, PartialEq, Eq, Hash)]
14    pub struct MTLResourceStatePassSampleBufferAttachmentDescriptor;
15);
16
17extern_conformance!(
18    unsafe impl NSCopying for MTLResourceStatePassSampleBufferAttachmentDescriptor {}
19);
20
21unsafe impl CopyingHelper for MTLResourceStatePassSampleBufferAttachmentDescriptor {
22    type Result = Self;
23}
24
25extern_conformance!(
26    unsafe impl NSObjectProtocol for MTLResourceStatePassSampleBufferAttachmentDescriptor {}
27);
28
29impl MTLResourceStatePassSampleBufferAttachmentDescriptor {
30    extern_methods!(
31        #[cfg(feature = "MTLCounters")]
32        /// The sample buffer to store samples for the resourceState-pass defined samples.
33        /// If sampleBuffer is non-nil, the sample indices will be used to store samples into
34        /// the sample buffer.  If no sample buffer is provided, no samples will be taken.
35        /// If any of the sample indices are specified as MTLCounterDontSample, no sample
36        /// will be taken for that action.
37        #[unsafe(method(sampleBuffer))]
38        #[unsafe(method_family = none)]
39        pub fn sampleBuffer(&self) -> Option<Retained<ProtocolObject<dyn MTLCounterSampleBuffer>>>;
40
41        #[cfg(feature = "MTLCounters")]
42        /// Setter for [`sampleBuffer`][Self::sampleBuffer].
43        #[unsafe(method(setSampleBuffer:))]
44        #[unsafe(method_family = none)]
45        pub fn setSampleBuffer(
46            &self,
47            sample_buffer: Option<&ProtocolObject<dyn MTLCounterSampleBuffer>>,
48        );
49
50        /// The sample index to use to store the sample taken at the start of
51        /// command encoder processing.  Setting the value to MTLCounterDontSample will cause
52        /// this sample to be omitted.
53        ///
54        /// On devices where MTLCounterSamplingPointAtStageBoundary is unsupported,
55        /// this sample index is invalid and must be set to MTLCounterDontSample or creation of a resourceState pass will fail.
56        #[unsafe(method(startOfEncoderSampleIndex))]
57        #[unsafe(method_family = none)]
58        pub fn startOfEncoderSampleIndex(&self) -> NSUInteger;
59
60        /// Setter for [`startOfEncoderSampleIndex`][Self::startOfEncoderSampleIndex].
61        ///
62        /// # Safety
63        ///
64        /// This might not be bounds-checked.
65        #[unsafe(method(setStartOfEncoderSampleIndex:))]
66        #[unsafe(method_family = none)]
67        pub unsafe fn setStartOfEncoderSampleIndex(
68            &self,
69            start_of_encoder_sample_index: NSUInteger,
70        );
71
72        /// The sample index to use to store the sample taken at the end of
73        /// Command encoder processing.  Setting the value to MTLCounterDontSample will cause
74        /// this sample to be omitted.
75        ///
76        /// On devices where MTLCounterSamplingPointAtStageBoundary is unsupported,
77        /// this sample index is invalid and must be set to MTLCounterDontSample or creation of a resourceState pass will fail.
78        #[unsafe(method(endOfEncoderSampleIndex))]
79        #[unsafe(method_family = none)]
80        pub fn endOfEncoderSampleIndex(&self) -> NSUInteger;
81
82        /// Setter for [`endOfEncoderSampleIndex`][Self::endOfEncoderSampleIndex].
83        ///
84        /// # Safety
85        ///
86        /// This might not be bounds-checked.
87        #[unsafe(method(setEndOfEncoderSampleIndex:))]
88        #[unsafe(method_family = none)]
89        pub unsafe fn setEndOfEncoderSampleIndex(&self, end_of_encoder_sample_index: NSUInteger);
90    );
91}
92
93/// Methods declared on superclass `NSObject`.
94impl MTLResourceStatePassSampleBufferAttachmentDescriptor {
95    extern_methods!(
96        #[unsafe(method(init))]
97        #[unsafe(method_family = init)]
98        pub fn init(this: Allocated<Self>) -> Retained<Self>;
99
100        #[unsafe(method(new))]
101        #[unsafe(method_family = new)]
102        pub fn new() -> Retained<Self>;
103    );
104}
105
106impl DefaultRetained for MTLResourceStatePassSampleBufferAttachmentDescriptor {
107    #[inline]
108    fn default_retained() -> Retained<Self> {
109        Self::new()
110    }
111}
112
113extern_class!(
114    /// [Apple's documentation](https://developer.apple.com/documentation/metal/mtlresourcestatepasssamplebufferattachmentdescriptorarray?language=objc)
115    #[unsafe(super(NSObject))]
116    #[derive(Debug, PartialEq, Eq, Hash)]
117    pub struct MTLResourceStatePassSampleBufferAttachmentDescriptorArray;
118);
119
120extern_conformance!(
121    unsafe impl NSObjectProtocol for MTLResourceStatePassSampleBufferAttachmentDescriptorArray {}
122);
123
124impl MTLResourceStatePassSampleBufferAttachmentDescriptorArray {
125    extern_methods!(
126        /// # Safety
127        ///
128        /// `attachmentIndex` might not be bounds-checked.
129        #[unsafe(method(objectAtIndexedSubscript:))]
130        #[unsafe(method_family = none)]
131        pub unsafe fn objectAtIndexedSubscript(
132            &self,
133            attachment_index: NSUInteger,
134        ) -> Retained<MTLResourceStatePassSampleBufferAttachmentDescriptor>;
135
136        /// # Safety
137        ///
138        /// `attachmentIndex` might not be bounds-checked.
139        #[unsafe(method(setObject:atIndexedSubscript:))]
140        #[unsafe(method_family = none)]
141        pub unsafe fn setObject_atIndexedSubscript(
142            &self,
143            attachment: Option<&MTLResourceStatePassSampleBufferAttachmentDescriptor>,
144            attachment_index: NSUInteger,
145        );
146    );
147}
148
149/// Methods declared on superclass `NSObject`.
150impl MTLResourceStatePassSampleBufferAttachmentDescriptorArray {
151    extern_methods!(
152        #[unsafe(method(init))]
153        #[unsafe(method_family = init)]
154        pub fn init(this: Allocated<Self>) -> Retained<Self>;
155
156        #[unsafe(method(new))]
157        #[unsafe(method_family = new)]
158        pub fn new() -> Retained<Self>;
159    );
160}
161
162impl DefaultRetained for MTLResourceStatePassSampleBufferAttachmentDescriptorArray {
163    #[inline]
164    fn default_retained() -> Retained<Self> {
165        Self::new()
166    }
167}
168
169extern_class!(
170    /// MTLResourceStatePassDescriptor represents a collection of attachments to be used to create a concrete resourceState command encoder
171    ///
172    /// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlresourcestatepassdescriptor?language=objc)
173    #[unsafe(super(NSObject))]
174    #[derive(Debug, PartialEq, Eq, Hash)]
175    pub struct MTLResourceStatePassDescriptor;
176);
177
178extern_conformance!(
179    unsafe impl NSCopying for MTLResourceStatePassDescriptor {}
180);
181
182unsafe impl CopyingHelper for MTLResourceStatePassDescriptor {
183    type Result = Self;
184}
185
186extern_conformance!(
187    unsafe impl NSObjectProtocol for MTLResourceStatePassDescriptor {}
188);
189
190impl MTLResourceStatePassDescriptor {
191    extern_methods!(
192        /// Create an autoreleased default frame buffer descriptor
193        #[unsafe(method(resourceStatePassDescriptor))]
194        #[unsafe(method_family = none)]
195        pub fn resourceStatePassDescriptor() -> Retained<MTLResourceStatePassDescriptor>;
196
197        /// An array of sample buffers and associated sample indices.
198        #[unsafe(method(sampleBufferAttachments))]
199        #[unsafe(method_family = none)]
200        pub fn sampleBufferAttachments(
201            &self,
202        ) -> Retained<MTLResourceStatePassSampleBufferAttachmentDescriptorArray>;
203    );
204}
205
206/// Methods declared on superclass `NSObject`.
207impl MTLResourceStatePassDescriptor {
208    extern_methods!(
209        #[unsafe(method(init))]
210        #[unsafe(method_family = init)]
211        pub fn init(this: Allocated<Self>) -> Retained<Self>;
212
213        #[unsafe(method(new))]
214        #[unsafe(method_family = new)]
215        pub fn new() -> Retained<Self>;
216    );
217}
218
219impl DefaultRetained for MTLResourceStatePassDescriptor {
220    #[inline]
221    fn default_retained() -> Retained<Self> {
222        Self::new()
223    }
224}