File tree 13 files changed +30
-35
lines changed
13 files changed +30
-35
lines changed Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " metal-rs"
3
- version = " 0.10.2 "
3
+ version = " 0.10.3 "
4
4
description = " Rust bindings for Metal"
5
5
documentation = " https://docs.rs/crate/metal-rs"
6
6
homepage = " https://github.com/gfx-rs/metal-rs"
@@ -24,7 +24,7 @@ block = "0.1.5"
24
24
foreign-types = " 0.3"
25
25
26
26
[dependencies .objc ]
27
- version = " 0.2.1 "
27
+ version = " 0.2.3 "
28
28
features = [" objc_exception" ]
29
29
30
30
[dev-dependencies ]
Original file line number Diff line number Diff line change 8
8
use :: { Array , MTLTextureType } ;
9
9
10
10
use cocoa:: foundation:: NSUInteger ;
11
- use objc:: runtime:: { Class , YES , NO } ;
11
+ use objc:: runtime:: { YES , NO } ;
12
12
use objc_foundation:: { NSString , INSString } ;
13
13
14
14
#[ repr( u64 ) ]
@@ -320,7 +320,7 @@ foreign_obj_type! {
320
320
impl ArgumentDescriptor {
321
321
pub fn new < ' a > ( ) -> & ' a ArgumentDescriptorRef {
322
322
unsafe {
323
- let class = Class :: get ( " MTLArgumentDescriptor" ) . unwrap ( ) ;
323
+ let class = class ! ( MTLArgumentDescriptor ) ;
324
324
msg_send ! [ class, argumentDescriptor]
325
325
}
326
326
}
Original file line number Diff line number Diff line change 7
7
8
8
use super :: * ;
9
9
10
- use objc:: runtime:: Class ;
11
10
use objc_foundation:: { INSString , NSString } ;
12
11
13
12
pub enum MTLCaptureScope { }
@@ -50,7 +49,7 @@ foreign_obj_type! {
50
49
impl CaptureManager {
51
50
pub fn shared < ' a > ( ) -> & ' a CaptureManagerRef {
52
51
unsafe {
53
- let class = Class :: get ( " MTLCaptureManager" ) . unwrap ( ) ;
52
+ let class = class ! ( MTLCaptureManager ) ;
54
53
msg_send ! [ class, sharedCaptureManager]
55
54
}
56
55
}
Original file line number Diff line number Diff line change 5
5
// http://opensource.org/licenses/MIT>, at your option. This file may not be
6
6
// copied, modified, or distributed except according to those terms.
7
7
8
- use objc:: runtime:: { Class , YES , NO } ;
8
+ use objc:: runtime:: { YES , NO } ;
9
9
10
10
#[ repr( u64 ) ]
11
11
pub enum MTLCompareFunction {
@@ -42,7 +42,7 @@ foreign_obj_type! {
42
42
impl StencilDescriptor {
43
43
pub fn new ( ) -> Self {
44
44
unsafe {
45
- let class = Class :: get ( " MTLStencilDescriptor" ) . unwrap ( ) ;
45
+ let class = class ! ( MTLStencilDescriptor ) ;
46
46
msg_send ! [ class, new]
47
47
}
48
48
}
@@ -134,7 +134,7 @@ foreign_obj_type! {
134
134
impl DepthStencilDescriptor {
135
135
pub fn new ( ) -> Self {
136
136
unsafe {
137
- let class = Class :: get ( " MTLDepthStencilDescriptor" ) . unwrap ( ) ;
137
+ let class = class ! ( MTLDepthStencilDescriptor ) ;
138
138
msg_send ! [ class, new]
139
139
}
140
140
}
Original file line number Diff line number Diff line change 8
8
use super :: * ;
9
9
10
10
use cocoa:: foundation:: NSUInteger ;
11
- use objc:: runtime:: Class ;
12
11
13
12
pub enum MTLHeap { }
14
13
@@ -90,7 +89,7 @@ foreign_obj_type! {
90
89
impl HeapDescriptor {
91
90
pub fn new ( ) -> Self {
92
91
unsafe {
93
- let class = Class :: get ( " MTLHeapDescriptor" ) . unwrap ( ) ;
92
+ let class = class ! ( MTLHeapDescriptor ) ;
94
93
msg_send ! [ class, new]
95
94
}
96
95
}
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ use std::marker::PhantomData;
27
27
use std:: ops:: Deref ;
28
28
use std:: borrow:: { Borrow , ToOwned } ;
29
29
30
- use objc:: runtime:: { Object , Class , YES , NO } ;
30
+ use objc:: runtime:: { Object , YES , NO } ;
31
31
use cocoa:: foundation:: NSSize ;
32
32
use foreign_types:: ForeignType ;
33
33
@@ -159,14 +159,14 @@ impl<T> Array<T> where
159
159
{
160
160
pub fn from_slice ( s : & [ & T :: Ref ] ) -> Self {
161
161
unsafe {
162
- let class = Class :: get ( " NSArray" ) . unwrap ( ) ;
162
+ let class = class ! ( NSArray ) ;
163
163
msg_send ! [ class, arrayWithObjects: s. as_ptr( ) count: s. len( ) ]
164
164
}
165
165
}
166
166
167
167
pub fn from_owned_slice ( s : & [ T ] ) -> Self {
168
168
unsafe {
169
- let class = Class :: get ( " NSArray" ) . unwrap ( ) ;
169
+ let class = class ! ( NSArray ) ;
170
170
msg_send ! [ class, arrayWithObjects: s. as_ptr( ) count: s. len( ) ]
171
171
}
172
172
}
@@ -254,7 +254,7 @@ foreign_obj_type! {
254
254
impl CoreAnimationLayer {
255
255
pub fn new ( ) -> Self {
256
256
unsafe {
257
- let class = Class :: get ( " CAMetalLayer" ) . unwrap ( ) ;
257
+ let class = class ! ( CAMetalLayer ) ;
258
258
msg_send ! [ class, new]
259
259
}
260
260
}
Original file line number Diff line number Diff line change 7
7
8
8
use super :: * ;
9
9
10
- use objc:: runtime:: { Class , Object , YES , NO } ;
10
+ use objc:: runtime:: { Object , YES , NO } ;
11
11
use objc_foundation:: { NSString , INSString , NSArray } ;
12
12
use cocoa:: foundation:: { NSUInteger } ;
13
13
use foreign_types:: ForeignType ;
@@ -123,7 +123,7 @@ foreign_obj_type! {
123
123
impl FunctionConstantValues {
124
124
pub fn new ( ) -> Self {
125
125
unsafe {
126
- let class = Class :: get ( " MTLFunctionConstantValues" ) . unwrap ( ) ;
126
+ let class = class ! ( MTLFunctionConstantValues ) ;
127
127
msg_send ! [ class, new]
128
128
}
129
129
}
@@ -146,7 +146,7 @@ foreign_obj_type! {
146
146
impl CompileOptions {
147
147
pub fn new ( ) -> Self {
148
148
unsafe {
149
- let class = Class :: get ( " MTLCompileOptions" ) . unwrap ( ) ;
149
+ let class = class ! ( MTLCompileOptions ) ;
150
150
msg_send ! [ class, new]
151
151
}
152
152
}
Original file line number Diff line number Diff line change 8
8
use super :: * ;
9
9
10
10
use cocoa:: foundation:: NSUInteger ;
11
- use objc:: runtime:: { Class , YES , NO } ;
11
+ use objc:: runtime:: { YES , NO } ;
12
12
use objc_foundation:: { INSString , NSString } ;
13
13
14
14
#[ repr( u64 ) ]
@@ -109,7 +109,7 @@ foreign_obj_type! {
109
109
impl ComputePipelineDescriptor {
110
110
pub fn new ( ) -> Self {
111
111
unsafe {
112
- let class = Class :: get ( " MTLComputePipelineDescriptor" ) . unwrap ( ) ;
112
+ let class = class ! ( MTLComputePipelineDescriptor ) ;
113
113
msg_send ! [ class, new]
114
114
}
115
115
}
@@ -280,7 +280,7 @@ foreign_obj_type! {
280
280
impl StageInputOutputDescriptor {
281
281
pub fn new < ' a > ( ) -> & ' a StageInputOutputDescriptorRef {
282
282
unsafe {
283
- let class = Class :: get ( " MTLStageInputOutputDescriptor" ) . unwrap ( ) ;
283
+ let class = class ! ( MTLStageInputOutputDescriptor ) ;
284
284
msg_send ! [ class, stageInputOutputDescriptor]
285
285
}
286
286
}
Original file line number Diff line number Diff line change 8
8
use super :: * ;
9
9
10
10
use cocoa:: foundation:: NSUInteger ;
11
- use objc:: runtime:: { Class , Object , YES , NO } ;
11
+ use objc:: runtime:: { Object , YES , NO } ;
12
12
use objc_foundation:: { INSString , NSString } ;
13
13
14
14
use libc;
@@ -203,7 +203,7 @@ impl RenderPipelineReflection {
203
203
fragment_data : * mut libc:: c_void , vertex_desc : * mut libc:: c_void ,
204
204
device : & DeviceRef , options : u64 , flags : u64 ) -> Self
205
205
{
206
- let class = Class :: get ( " MTLRenderPipelineReflection" ) . unwrap ( ) ;
206
+ let class = class ! ( MTLRenderPipelineReflection ) ;
207
207
let this: RenderPipelineReflection = msg_send ! [ class, alloc] ;
208
208
let this_alias: * mut Object = msg_send ! [ this. as_ref( ) , initWithVertexData: vertex_data
209
209
fragmentData: fragment_data
@@ -243,7 +243,7 @@ foreign_obj_type! {
243
243
impl RenderPipelineDescriptor {
244
244
pub fn new ( ) -> Self {
245
245
unsafe {
246
- let class = Class :: get ( " MTLRenderPipelineDescriptor" ) . unwrap ( ) ;
246
+ let class = class ! ( MTLRenderPipelineDescriptor ) ;
247
247
msg_send ! [ class, new]
248
248
}
249
249
}
Original file line number Diff line number Diff line change 7
7
8
8
use super :: * ;
9
9
10
- use objc:: runtime:: Class ;
11
10
use cocoa:: foundation:: NSUInteger ;
12
11
13
12
#[ repr( u64 ) ]
@@ -189,7 +188,7 @@ foreign_obj_type! {
189
188
impl RenderPassColorAttachmentDescriptor {
190
189
pub fn new ( ) -> Self {
191
190
unsafe {
192
- let class = Class :: get ( " MTLRenderPassColorAttachmentDescriptor" ) . unwrap ( ) ;
191
+ let class = class ! ( MTLRenderPassColorAttachmentDescriptor ) ;
193
192
msg_send ! [ class, new]
194
193
}
195
194
}
@@ -289,7 +288,7 @@ foreign_obj_type! {
289
288
impl RenderPassDescriptor {
290
289
pub fn new < ' a > ( ) -> & ' a RenderPassDescriptorRef {
291
290
unsafe {
292
- let class = Class :: get ( " MTLRenderPassDescriptorInternal" ) . unwrap ( ) ;
291
+ let class = class ! ( MTLRenderPassDescriptorInternal ) ;
293
292
msg_send ! [ class, renderPassDescriptor]
294
293
}
295
294
}
Original file line number Diff line number Diff line change 5
5
// http://opensource.org/licenses/MIT>, at your option. This file may not be
6
6
// copied, modified, or distributed except according to those terms.
7
7
8
- use objc:: runtime:: Class ;
9
8
use cocoa:: foundation:: NSUInteger ;
10
9
11
10
use depthstencil:: MTLCompareFunction ;
@@ -56,7 +55,7 @@ foreign_obj_type! {
56
55
impl SamplerDescriptor {
57
56
pub fn new ( ) -> Self {
58
57
unsafe {
59
- let class = Class :: get ( " MTLSamplerDescriptor" ) . unwrap ( ) ;
58
+ let class = class ! ( MTLSamplerDescriptor ) ;
60
59
msg_send ! [ class, new]
61
60
}
62
61
}
Original file line number Diff line number Diff line change 8
8
use super :: * ;
9
9
10
10
use cocoa:: foundation:: { NSUInteger , NSRange } ;
11
- use objc:: runtime:: { Class , YES , NO } ;
11
+ use objc:: runtime:: { YES , NO } ;
12
12
13
13
use libc;
14
14
@@ -47,7 +47,7 @@ foreign_obj_type! {
47
47
impl TextureDescriptor {
48
48
pub fn new ( ) -> Self {
49
49
unsafe {
50
- let class = Class :: get ( " MTLTextureDescriptor" ) . unwrap ( ) ;
50
+ let class = class ! ( MTLTextureDescriptor ) ;
51
51
msg_send ! [ class, new]
52
52
}
53
53
}
Original file line number Diff line number Diff line change 5
5
// http://opensource.org/licenses/MIT>, at your option. This file may not be
6
6
// copied, modified, or distributed except according to those terms.
7
7
8
- use objc:: runtime:: Class ;
9
8
use cocoa:: foundation:: NSUInteger ;
10
9
11
10
use libc;
@@ -86,7 +85,7 @@ foreign_obj_type! {
86
85
impl VertexBufferLayoutDescriptor {
87
86
pub fn new ( ) -> Self {
88
87
unsafe {
89
- let class = Class :: get ( " MTLVertexBufferLayoutDescriptor" ) . unwrap ( ) ;
88
+ let class = class ! ( MTLVertexBufferLayoutDescriptor ) ;
90
89
msg_send ! [ class, new]
91
90
}
92
91
}
@@ -164,7 +163,7 @@ foreign_obj_type! {
164
163
impl VertexAttributeDescriptor {
165
164
pub fn new ( ) -> Self {
166
165
unsafe {
167
- let class = Class :: get ( " MTLVertexAttributeDescriptor" ) . unwrap ( ) ;
166
+ let class = class ! ( MTLVertexAttributeDescriptor ) ;
168
167
msg_send ! [ class, new]
169
168
}
170
169
}
@@ -242,7 +241,7 @@ foreign_obj_type! {
242
241
impl VertexDescriptor {
243
242
pub fn new < ' a > ( ) -> & ' a VertexDescriptorRef {
244
243
unsafe {
245
- let class = Class :: get ( " MTLVertexDescriptor" ) . unwrap ( ) ;
244
+ let class = class ! ( MTLVertexDescriptor ) ;
246
245
msg_send ! [ class, vertexDescriptor]
247
246
}
248
247
}
You can’t perform that action at this time.
0 commit comments