objc2_metal/generated/
MTL4PipelineState.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6use objc2_foundation::*;
7
8use crate::*;
9
10#[repr(transparent)]
15#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
16pub struct MTL4ShaderReflection(pub NSUInteger);
17bitflags::bitflags! {
18 impl MTL4ShaderReflection: NSUInteger {
19#[doc(alias = "MTL4ShaderReflectionNone")]
21 const None = 0;
22#[doc(alias = "MTL4ShaderReflectionBindingInfo")]
24 const BindingInfo = 1<<0;
25#[doc(alias = "MTL4ShaderReflectionBufferTypeInfo")]
27 const BufferTypeInfo = 1<<1;
28 }
29}
30
31unsafe impl Encode for MTL4ShaderReflection {
32 const ENCODING: Encoding = NSUInteger::ENCODING;
33}
34
35unsafe impl RefEncode for MTL4ShaderReflection {
36 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
37}
38
39#[repr(transparent)]
44#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
45pub struct MTL4AlphaToOneState(pub NSInteger);
46impl MTL4AlphaToOneState {
47 #[doc(alias = "MTL4AlphaToOneStateDisabled")]
49 pub const Disabled: Self = Self(0);
50 #[doc(alias = "MTL4AlphaToOneStateEnabled")]
52 pub const Enabled: Self = Self(1);
53}
54
55unsafe impl Encode for MTL4AlphaToOneState {
56 const ENCODING: Encoding = NSInteger::ENCODING;
57}
58
59unsafe impl RefEncode for MTL4AlphaToOneState {
60 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
61}
62
63#[repr(transparent)]
68#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
69pub struct MTL4AlphaToCoverageState(pub NSInteger);
70impl MTL4AlphaToCoverageState {
71 #[doc(alias = "MTL4AlphaToCoverageStateDisabled")]
73 pub const Disabled: Self = Self(0);
74 #[doc(alias = "MTL4AlphaToCoverageStateEnabled")]
76 pub const Enabled: Self = Self(1);
77}
78
79unsafe impl Encode for MTL4AlphaToCoverageState {
80 const ENCODING: Encoding = NSInteger::ENCODING;
81}
82
83unsafe impl RefEncode for MTL4AlphaToCoverageState {
84 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
85}
86
87#[repr(transparent)]
92#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
93pub struct MTL4BlendState(pub NSInteger);
94impl MTL4BlendState {
95 #[doc(alias = "MTL4BlendStateDisabled")]
97 pub const Disabled: Self = Self(0);
98 #[doc(alias = "MTL4BlendStateEnabled")]
100 pub const Enabled: Self = Self(1);
101 #[doc(alias = "MTL4BlendStateUnspecialized")]
105 pub const Unspecialized: Self = Self(2);
106}
107
108unsafe impl Encode for MTL4BlendState {
109 const ENCODING: Encoding = NSInteger::ENCODING;
110}
111
112unsafe impl RefEncode for MTL4BlendState {
113 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
114}
115
116#[repr(transparent)]
121#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
122pub struct MTL4IndirectCommandBufferSupportState(pub NSInteger);
123impl MTL4IndirectCommandBufferSupportState {
124 #[doc(alias = "MTL4IndirectCommandBufferSupportStateDisabled")]
126 pub const Disabled: Self = Self(0);
127 #[doc(alias = "MTL4IndirectCommandBufferSupportStateEnabled")]
129 pub const Enabled: Self = Self(1);
130}
131
132unsafe impl Encode for MTL4IndirectCommandBufferSupportState {
133 const ENCODING: Encoding = NSInteger::ENCODING;
134}
135
136unsafe impl RefEncode for MTL4IndirectCommandBufferSupportState {
137 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
138}
139
140extern_class!(
141 #[unsafe(super(NSObject))]
147 #[derive(Debug, PartialEq, Eq, Hash)]
148 pub struct MTL4PipelineOptions;
149);
150
151extern_conformance!(
152 unsafe impl NSCopying for MTL4PipelineOptions {}
153);
154
155unsafe impl CopyingHelper for MTL4PipelineOptions {
156 type Result = Self;
157}
158
159extern_conformance!(
160 unsafe impl NSObjectProtocol for MTL4PipelineOptions {}
161);
162
163impl MTL4PipelineOptions {
164 extern_methods!(
165 #[cfg(feature = "MTLPipeline")]
166 #[unsafe(method(shaderValidation))]
168 #[unsafe(method_family = none)]
169 pub fn shaderValidation(&self) -> MTLShaderValidation;
170
171 #[cfg(feature = "MTLPipeline")]
172 #[unsafe(method(setShaderValidation:))]
174 #[unsafe(method_family = none)]
175 pub fn setShaderValidation(&self, shader_validation: MTLShaderValidation);
176
177 #[unsafe(method(shaderReflection))]
179 #[unsafe(method_family = none)]
180 pub fn shaderReflection(&self) -> MTL4ShaderReflection;
181
182 #[unsafe(method(setShaderReflection:))]
184 #[unsafe(method_family = none)]
185 pub fn setShaderReflection(&self, shader_reflection: MTL4ShaderReflection);
186 );
187}
188
189impl MTL4PipelineOptions {
191 extern_methods!(
192 #[unsafe(method(init))]
193 #[unsafe(method_family = init)]
194 pub fn init(this: Allocated<Self>) -> Retained<Self>;
195
196 #[unsafe(method(new))]
197 #[unsafe(method_family = new)]
198 pub fn new() -> Retained<Self>;
199 );
200}
201
202impl DefaultRetained for MTL4PipelineOptions {
203 #[inline]
204 fn default_retained() -> Retained<Self> {
205 Self::new()
206 }
207}
208
209extern_class!(
210 #[unsafe(super(NSObject))]
214 #[derive(Debug, PartialEq, Eq, Hash)]
215 pub struct MTL4PipelineDescriptor;
216);
217
218extern_conformance!(
219 unsafe impl NSCopying for MTL4PipelineDescriptor {}
220);
221
222unsafe impl CopyingHelper for MTL4PipelineDescriptor {
223 type Result = Self;
224}
225
226extern_conformance!(
227 unsafe impl NSObjectProtocol for MTL4PipelineDescriptor {}
228);
229
230impl MTL4PipelineDescriptor {
231 extern_methods!(
232 #[unsafe(method(label))]
236 #[unsafe(method_family = none)]
237 pub fn label(&self) -> Option<Retained<NSString>>;
238
239 #[unsafe(method(setLabel:))]
243 #[unsafe(method_family = none)]
244 pub fn setLabel(&self, label: Option<&NSString>);
245
246 #[unsafe(method(options))]
248 #[unsafe(method_family = none)]
249 pub fn options(&self) -> Option<Retained<MTL4PipelineOptions>>;
250
251 #[unsafe(method(setOptions:))]
253 #[unsafe(method_family = none)]
254 pub fn setOptions(&self, options: Option<&MTL4PipelineOptions>);
255 );
256}
257
258impl MTL4PipelineDescriptor {
260 extern_methods!(
261 #[unsafe(method(init))]
262 #[unsafe(method_family = init)]
263 pub fn init(this: Allocated<Self>) -> Retained<Self>;
264
265 #[unsafe(method(new))]
266 #[unsafe(method_family = new)]
267 pub fn new() -> Retained<Self>;
268 );
269}
270
271impl DefaultRetained for MTL4PipelineDescriptor {
272 #[inline]
273 fn default_retained() -> Retained<Self> {
274 Self::new()
275 }
276}