objc2_metal/generated/MTLDataType.rs
1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use objc2::__framework_prelude::*;
4
5use crate::*;
6
7/// An enumeration of the different data types in Metal.
8///
9/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtldatatype?language=objc)
10// NS_ENUM
11#[repr(transparent)]
12#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
13pub struct MTLDataType(pub NSUInteger);
14impl MTLDataType {
15 /// Represents no data type.
16 #[doc(alias = "MTLDataTypeNone")]
17 pub const None: Self = Self(0);
18 /// Represents a struct data type.
19 #[doc(alias = "MTLDataTypeStruct")]
20 pub const Struct: Self = Self(1);
21 /// Represents an array data type.
22 #[doc(alias = "MTLDataTypeArray")]
23 pub const Array: Self = Self(2);
24 /// Represents a data type consisting of a single floating-point value.
25 #[doc(alias = "MTLDataTypeFloat")]
26 pub const Float: Self = Self(3);
27 /// Represents a data type consisting of a vector of two floating-point values.
28 #[doc(alias = "MTLDataTypeFloat2")]
29 pub const Float2: Self = Self(4);
30 /// Represents a data type consisting of a vector of three floating-point values.
31 #[doc(alias = "MTLDataTypeFloat3")]
32 pub const Float3: Self = Self(5);
33 /// Represents a data type consisting of a vector of four floating-point values.
34 #[doc(alias = "MTLDataTypeFloat4")]
35 pub const Float4: Self = Self(6);
36 /// Represents a data type consisting of a 2x2 floating-point matrix.
37 #[doc(alias = "MTLDataTypeFloat2x2")]
38 pub const Float2x2: Self = Self(7);
39 /// Represents a data type consisting of a 2x3 floating-point matrix.
40 #[doc(alias = "MTLDataTypeFloat2x3")]
41 pub const Float2x3: Self = Self(8);
42 /// Represents a data type consisting of a 2x4 floating-point matrix.
43 #[doc(alias = "MTLDataTypeFloat2x4")]
44 pub const Float2x4: Self = Self(9);
45 /// Represents a data type consisting of a 3x2 floating-point matrix.
46 #[doc(alias = "MTLDataTypeFloat3x2")]
47 pub const Float3x2: Self = Self(10);
48 /// Represents a data type consisting of a 3x3 floating-point matrix.
49 #[doc(alias = "MTLDataTypeFloat3x3")]
50 pub const Float3x3: Self = Self(11);
51 /// Represents a data type consisting of a 3x4 floating-point matrix.
52 #[doc(alias = "MTLDataTypeFloat3x4")]
53 pub const Float3x4: Self = Self(12);
54 /// Represents a data type consisting of a 4x2 floating-point matrix.
55 #[doc(alias = "MTLDataTypeFloat4x2")]
56 pub const Float4x2: Self = Self(13);
57 /// Represents a data type consisting of a 4x3 floating-point matrix.
58 #[doc(alias = "MTLDataTypeFloat4x3")]
59 pub const Float4x3: Self = Self(14);
60 /// Represents a data type consisting of a 4x4 floating-point matrix.
61 #[doc(alias = "MTLDataTypeFloat4x4")]
62 pub const Float4x4: Self = Self(15);
63 /// Represents a data type consisting of a half-precision floating-point value.
64 #[doc(alias = "MTLDataTypeHalf")]
65 pub const Half: Self = Self(16);
66 /// Represents a data type consisting of a vector of two half-precision floating-point values.
67 #[doc(alias = "MTLDataTypeHalf2")]
68 pub const Half2: Self = Self(17);
69 /// Represents a data type consisting of a vector of three half-precision floating-point values.
70 #[doc(alias = "MTLDataTypeHalf3")]
71 pub const Half3: Self = Self(18);
72 /// Represents a data type consisting of a vector of four half-precision floating-point values.
73 #[doc(alias = "MTLDataTypeHalf4")]
74 pub const Half4: Self = Self(19);
75 /// Represents a data type consisting of a 2x2 half-precision floating-point matrix.
76 #[doc(alias = "MTLDataTypeHalf2x2")]
77 pub const Half2x2: Self = Self(20);
78 /// Represents a data type consisting of a 2x3 half-precision floating-point matrix.
79 #[doc(alias = "MTLDataTypeHalf2x3")]
80 pub const Half2x3: Self = Self(21);
81 /// Represents a data type consisting of a 2x4 half-precision floating-point matrix.
82 #[doc(alias = "MTLDataTypeHalf2x4")]
83 pub const Half2x4: Self = Self(22);
84 /// Represents a data type consisting of a 3x2 half-precision floating-point matrix.
85 #[doc(alias = "MTLDataTypeHalf3x2")]
86 pub const Half3x2: Self = Self(23);
87 /// Represents a data type consisting of a 3x3 half-precision floating-point matrix.
88 #[doc(alias = "MTLDataTypeHalf3x3")]
89 pub const Half3x3: Self = Self(24);
90 /// Represents a data type consisting of a 3x4 half-precision floating-point matrix.
91 #[doc(alias = "MTLDataTypeHalf3x4")]
92 pub const Half3x4: Self = Self(25);
93 /// Represents a data type consisting of a 4x2 half-precision floating-point matrix.
94 #[doc(alias = "MTLDataTypeHalf4x2")]
95 pub const Half4x2: Self = Self(26);
96 /// Represents a data type consisting of a 4x3 half-precision floating-point matrix.
97 #[doc(alias = "MTLDataTypeHalf4x3")]
98 pub const Half4x3: Self = Self(27);
99 /// Represents a data type consisting of a 4x4 half-precision floating-point matrix.
100 #[doc(alias = "MTLDataTypeHalf4x4")]
101 pub const Half4x4: Self = Self(28);
102 /// Represents a data type consisting of a single signed integer value.
103 #[doc(alias = "MTLDataTypeInt")]
104 pub const Int: Self = Self(29);
105 /// Represents a data type consisting of a vector of two signed integer values.
106 #[doc(alias = "MTLDataTypeInt2")]
107 pub const Int2: Self = Self(30);
108 /// Represents a data type consisting of a vector of three signed integer values.
109 #[doc(alias = "MTLDataTypeInt3")]
110 pub const Int3: Self = Self(31);
111 /// Represents a data type consisting of a vector of four signed integer values.
112 #[doc(alias = "MTLDataTypeInt4")]
113 pub const Int4: Self = Self(32);
114 /// Represents a data type consisting of a single unsigned integer value.
115 #[doc(alias = "MTLDataTypeUInt")]
116 pub const UInt: Self = Self(33);
117 /// Represents a data type consisting of a vector of two unsigned integer values.
118 #[doc(alias = "MTLDataTypeUInt2")]
119 pub const UInt2: Self = Self(34);
120 /// Represents a data type consisting of a vector of three unsigned integer values.
121 #[doc(alias = "MTLDataTypeUInt3")]
122 pub const UInt3: Self = Self(35);
123 /// Represents a data type consisting of a vector of four unsigned integer values.
124 #[doc(alias = "MTLDataTypeUInt4")]
125 pub const UInt4: Self = Self(36);
126 /// Represents a data type consisting of a single 16-bit signed integer value.
127 #[doc(alias = "MTLDataTypeShort")]
128 pub const Short: Self = Self(37);
129 /// Represents a data type consisting of a vector of two 16-bit signed integer values.
130 #[doc(alias = "MTLDataTypeShort2")]
131 pub const Short2: Self = Self(38);
132 /// Represents a data type consisting of a vector of three 16-bit signed integer values.
133 #[doc(alias = "MTLDataTypeShort3")]
134 pub const Short3: Self = Self(39);
135 /// Represents a data type consisting of a vector of three 16-bit signed integer values.
136 #[doc(alias = "MTLDataTypeShort4")]
137 pub const Short4: Self = Self(40);
138 /// Represents a data type consisting of a single 16-bit unsigned integer value.
139 #[doc(alias = "MTLDataTypeUShort")]
140 pub const UShort: Self = Self(41);
141 /// Represents a data type consisting of a vector of two 16-bit unsigned integer values.
142 #[doc(alias = "MTLDataTypeUShort2")]
143 pub const UShort2: Self = Self(42);
144 /// Represents a data type consisting of a vector of three 16-bit unsigned integer values.
145 #[doc(alias = "MTLDataTypeUShort3")]
146 pub const UShort3: Self = Self(43);
147 /// Represents a data type consisting of a vector of four 16-bit unsigned integer values.
148 #[doc(alias = "MTLDataTypeUShort4")]
149 pub const UShort4: Self = Self(44);
150 /// Represents a data type consisting of a single signed character value.
151 #[doc(alias = "MTLDataTypeChar")]
152 pub const Char: Self = Self(45);
153 /// Represents a data type consisting of a vector of two signed character values.
154 #[doc(alias = "MTLDataTypeChar2")]
155 pub const Char2: Self = Self(46);
156 /// Represents a data type consisting of a vector of three signed character values.
157 #[doc(alias = "MTLDataTypeChar3")]
158 pub const Char3: Self = Self(47);
159 /// Represents a data type consisting of a vector of four signed character values.
160 #[doc(alias = "MTLDataTypeChar4")]
161 pub const Char4: Self = Self(48);
162 /// Represents a data type consisting of a single unsigned character value.
163 #[doc(alias = "MTLDataTypeUChar")]
164 pub const UChar: Self = Self(49);
165 /// Represents a data type consisting of a vector of two unsigned character values.
166 #[doc(alias = "MTLDataTypeUChar2")]
167 pub const UChar2: Self = Self(50);
168 /// Represents a data type consisting of a vector of three unsigned character values.
169 #[doc(alias = "MTLDataTypeUChar3")]
170 pub const UChar3: Self = Self(51);
171 /// Represents a data type consisting of a vector of four unsigned character values.
172 #[doc(alias = "MTLDataTypeUChar4")]
173 pub const UChar4: Self = Self(52);
174 /// Represents a data type consisting of a single boolean value.
175 #[doc(alias = "MTLDataTypeBool")]
176 pub const Bool: Self = Self(53);
177 /// Represents a data type consisting of a vector of two boolean values.
178 #[doc(alias = "MTLDataTypeBool2")]
179 pub const Bool2: Self = Self(54);
180 /// Represents a data type consisting of a vector of three boolean values.
181 #[doc(alias = "MTLDataTypeBool3")]
182 pub const Bool3: Self = Self(55);
183 /// Represents a data type consisting of a vector of four boolean values.
184 #[doc(alias = "MTLDataTypeBool4")]
185 pub const Bool4: Self = Self(56);
186 /// Represents a data type corresponding to a texture object.
187 #[doc(alias = "MTLDataTypeTexture")]
188 pub const Texture: Self = Self(58);
189 /// Represents a data type corresponding to a sampler state object.
190 #[doc(alias = "MTLDataTypeSampler")]
191 pub const Sampler: Self = Self(59);
192 /// Represents a data type corresponding to a pointer.
193 #[doc(alias = "MTLDataTypePointer")]
194 pub const Pointer: Self = Self(60);
195 /// Represents an image block data type consisting of an unsigned 8-bit red channel normalized to the [0-1] range.
196 #[doc(alias = "MTLDataTypeR8Unorm")]
197 pub const R8Unorm: Self = Self(62);
198 /// Represents an image block data type consisting of an signed 8-bit red channel normalized to the [0-1] range.
199 #[doc(alias = "MTLDataTypeR8Snorm")]
200 pub const R8Snorm: Self = Self(63);
201 /// Represents an image block data type consisting of an unsigned 16-bit red channel normalized to the [0-1] range.
202 #[doc(alias = "MTLDataTypeR16Unorm")]
203 pub const R16Unorm: Self = Self(64);
204 /// Represents an image block data type consisting of a signed 16-bit red channel normalized to the [0-1] range.
205 #[doc(alias = "MTLDataTypeR16Snorm")]
206 pub const R16Snorm: Self = Self(65);
207 /// Represents an image block data type consisting of an unsigned 8-bit red channel and a unsigned 8-bit green channel, both normalized to the [0-1] range.
208 #[doc(alias = "MTLDataTypeRG8Unorm")]
209 pub const RG8Unorm: Self = Self(66);
210 /// Represents an image block data type consisting of a signed 8-bit red channel and a signed 8-bit green channel, both normalized to the [0-1] range.
211 #[doc(alias = "MTLDataTypeRG8Snorm")]
212 pub const RG8Snorm: Self = Self(67);
213 /// Represents an image block data type consisting of an unsigned 16-bit red channel and an unsigned 16-bit green channel, both normalized to the [0-1] range.
214 #[doc(alias = "MTLDataTypeRG16Unorm")]
215 pub const RG16Unorm: Self = Self(68);
216 /// Represents an image block data type consisting of a signed 16-bit red channel and a signed 16-bit green channel, both normalized to the [0-1] range.
217 #[doc(alias = "MTLDataTypeRG16Snorm")]
218 pub const RG16Snorm: Self = Self(69);
219 /// Represents an image block data type consisting of four unsigned 8-bit channels normalized to the [0-1] range.
220 #[doc(alias = "MTLDataTypeRGBA8Unorm")]
221 pub const RGBA8Unorm: Self = Self(70);
222 /// Represents an image block data type consisting of four unsigned 8-bit channels normalized to the [0-1] range and subject to gamma-correction.
223 #[doc(alias = "MTLDataTypeRGBA8Unorm_sRGB")]
224 pub const RGBA8Unorm_sRGB: Self = Self(71);
225 /// Represents an image block data type consisting of four signed 8-bit channels normalized to the [0-1] range.
226 #[doc(alias = "MTLDataTypeRGBA8Snorm")]
227 pub const RGBA8Snorm: Self = Self(72);
228 /// Represents an image block data type consisting of four unsigned 16-bit channels normalized to the [0-1] range.
229 #[doc(alias = "MTLDataTypeRGBA16Unorm")]
230 pub const RGBA16Unorm: Self = Self(73);
231 /// Represents an image block data type consisting of four signed 16-bit channels normalized to the [0-1] range.
232 #[doc(alias = "MTLDataTypeRGBA16Snorm")]
233 pub const RGBA16Snorm: Self = Self(74);
234 /// Represents an image block data type consisting of three unsigned 10-bit channels and one 2-bit unsigned alpha channel, all normalized to the [0-1] range.
235 #[doc(alias = "MTLDataTypeRGB10A2Unorm")]
236 pub const RGB10A2Unorm: Self = Self(75);
237 /// Represents an image block data type consisting of two 11-bit floating-point channels, and one 10-bit floating-point blue channel.
238 #[doc(alias = "MTLDataTypeRG11B10Float")]
239 pub const RG11B10Float: Self = Self(76);
240 /// Represents an image block data type consisting of three 9-bit floating-point channels, and one 5-bit floating-point exponent.
241 #[doc(alias = "MTLDataTypeRGB9E5Float")]
242 pub const RGB9E5Float: Self = Self(77);
243 /// Represents a data type corresponding to a render pipeline state object.
244 #[doc(alias = "MTLDataTypeRenderPipeline")]
245 pub const RenderPipeline: Self = Self(78);
246 /// Represents a data type corresponding to a compute pipeline state object.
247 #[doc(alias = "MTLDataTypeComputePipeline")]
248 pub const ComputePipeline: Self = Self(79);
249 /// Represents a data type corresponding to an indirect command buffer object.
250 #[doc(alias = "MTLDataTypeIndirectCommandBuffer")]
251 pub const IndirectCommandBuffer: Self = Self(80);
252 /// Represents a data type consisting of a signed long integer value.
253 #[doc(alias = "MTLDataTypeLong")]
254 pub const Long: Self = Self(81);
255 /// Represents a data type consisting of a vector of two signed long integer values.
256 #[doc(alias = "MTLDataTypeLong2")]
257 pub const Long2: Self = Self(82);
258 /// Represents a data type consisting of a vector of three signed long integer values.
259 #[doc(alias = "MTLDataTypeLong3")]
260 pub const Long3: Self = Self(83);
261 /// Represents a data type consisting of a vector of four signed long integer values.
262 #[doc(alias = "MTLDataTypeLong4")]
263 pub const Long4: Self = Self(84);
264 /// Represents a data type consisting of an unsigned long integer value.
265 #[doc(alias = "MTLDataTypeULong")]
266 pub const ULong: Self = Self(85);
267 /// Represents a data type consisting of a vector two unsigned long integer values.
268 #[doc(alias = "MTLDataTypeULong2")]
269 pub const ULong2: Self = Self(86);
270 /// Represents a data type consisting of a vector three unsigned long integer values.
271 #[doc(alias = "MTLDataTypeULong3")]
272 pub const ULong3: Self = Self(87);
273 /// Represents a data type consisting of a vector four unsigned long integer values.
274 #[doc(alias = "MTLDataTypeULong4")]
275 pub const ULong4: Self = Self(88);
276 /// Represents a data type corresponding to a visible function table object.
277 #[doc(alias = "MTLDataTypeVisibleFunctionTable")]
278 pub const VisibleFunctionTable: Self = Self(115);
279 /// Represents a data type corresponding to an intersection function table object.
280 #[doc(alias = "MTLDataTypeIntersectionFunctionTable")]
281 pub const IntersectionFunctionTable: Self = Self(116);
282 /// Represents a data type corresponding to a primitive acceleration structure.
283 #[doc(alias = "MTLDataTypePrimitiveAccelerationStructure")]
284 pub const PrimitiveAccelerationStructure: Self = Self(117);
285 /// Represents a data type corresponding to an instance acceleration structure.
286 #[doc(alias = "MTLDataTypeInstanceAccelerationStructure")]
287 pub const InstanceAccelerationStructure: Self = Self(118);
288 /// Represents a data type consisting of a single BFloat value.
289 #[doc(alias = "MTLDataTypeBFloat")]
290 pub const BFloat: Self = Self(121);
291 /// Represents a data type consisting of a vector two BFloat values.
292 #[doc(alias = "MTLDataTypeBFloat2")]
293 pub const BFloat2: Self = Self(122);
294 /// Represents a data type consisting of a vector three BFloat values.
295 #[doc(alias = "MTLDataTypeBFloat3")]
296 pub const BFloat3: Self = Self(123);
297 /// Represents a data type consisting of a vector four BFloat values.
298 #[doc(alias = "MTLDataTypeBFloat4")]
299 pub const BFloat4: Self = Self(124);
300 /// Represents a data type corresponding to a depth-stencil state object.
301 #[doc(alias = "MTLDataTypeDepthStencilState")]
302 pub const DepthStencilState: Self = Self(139);
303 /// Represents a data type corresponding to a machine learning tensor.
304 #[doc(alias = "MTLDataTypeTensor")]
305 pub const Tensor: Self = Self(140);
306}
307
308unsafe impl Encode for MTLDataType {
309 const ENCODING: Encoding = NSUInteger::ENCODING;
310}
311
312unsafe impl RefEncode for MTLDataType {
313 const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
314}