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
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use objc2::__framework_prelude::*;
use crate::*;
/// Identify a pixel in an image. MTLOrigin is ususally used as the upper-left corner of a region of a texture.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlorigin?language=objc)
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct MTLOrigin {
pub x: NSUInteger,
pub y: NSUInteger,
pub z: NSUInteger,
}
unsafe impl Encode for MTLOrigin {
const ENCODING: Encoding = Encoding::Struct(
"?",
&[
<NSUInteger>::ENCODING,
<NSUInteger>::ENCODING,
<NSUInteger>::ENCODING,
],
);
}
unsafe impl RefEncode for MTLOrigin {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
impl MTLOrigin {
// TODO: pub fn MTLOriginMake(x: NSUInteger,y: NSUInteger,z: NSUInteger,) -> MTLOrigin;
}
/// A set of dimensions to declare the size of an object, such as an image, texture, threadgroup, or grid.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlsize?language=objc)
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct MTLSize {
pub width: NSUInteger,
pub height: NSUInteger,
pub depth: NSUInteger,
}
unsafe impl Encode for MTLSize {
const ENCODING: Encoding = Encoding::Struct(
"?",
&[
<NSUInteger>::ENCODING,
<NSUInteger>::ENCODING,
<NSUInteger>::ENCODING,
],
);
}
unsafe impl RefEncode for MTLSize {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
impl MTLSize {
// TODO: pub fn MTLSizeMake(width: NSUInteger,height: NSUInteger,depth: NSUInteger,) -> MTLSize;
}
/// Identify a region in an image or texture.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlregion?language=objc)
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct MTLRegion {
pub origin: MTLOrigin,
pub size: MTLSize,
}
unsafe impl Encode for MTLRegion {
const ENCODING: Encoding = Encoding::Struct("?", &[<MTLOrigin>::ENCODING, <MTLSize>::ENCODING]);
}
unsafe impl RefEncode for MTLRegion {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
impl MTLRegion {
// TODO: pub fn MTLRegionMake1D(x: NSUInteger,width: NSUInteger,) -> MTLRegion;
// TODO: pub fn MTLRegionMake2D(x: NSUInteger,y: NSUInteger,width: NSUInteger,height: NSUInteger,) -> MTLRegion;
// TODO: pub fn MTLRegionMake3D(x: NSUInteger,y: NSUInteger,z: NSUInteger,width: NSUInteger,height: NSUInteger,depth: NSUInteger,) -> MTLRegion;
}
/// Identify a sample within a pixel. Origin is top-left with a range [0,1) for both x and y.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlsampleposition?language=objc)
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct MTLSamplePosition {
pub x: c_float,
pub y: c_float,
}
unsafe impl Encode for MTLSamplePosition {
const ENCODING: Encoding = Encoding::Struct("?", &[<c_float>::ENCODING, <c_float>::ENCODING]);
}
unsafe impl RefEncode for MTLSamplePosition {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
impl MTLSamplePosition {
// TODO: pub fn MTLSamplePositionMake(x: c_float,y: c_float,) -> MTLSamplePosition;
}
/// A floating point coordinate in an abstract 2D space.
/// Refer to location of use for concrete information on the space in which the coordinate exists.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlcoordinate2d?language=objc)
pub type MTLCoordinate2D = MTLSamplePosition;
// TODO: pub fn MTLCoordinate2DMake(x: c_float,y: c_float,) -> MTLCoordinate2D;
/// Handle of the GPU resource used for binding resources to argument tables, navigating resource view pools and storing resources in an argument buffer
///
/// MTLResourceID represents a specific GPU resource. This handle can be mutated by modifying textureID or samplerID values to get to individual resource views in a resource view pool.
///
/// See also [Apple's documentation](https://developer.apple.com/documentation/metal/mtlresourceid?language=objc)
#[repr(C)]
#[derive(Clone, Copy, Debug, PartialEq)]
pub struct MTLResourceID {
pub(crate) _impl: u64,
}
unsafe impl Encode for MTLResourceID {
const ENCODING: Encoding = Encoding::Struct("MTLResourceID", &[<u64>::ENCODING]);
}
unsafe impl RefEncode for MTLResourceID {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}