Skip to content

Commit c7e27e2

Browse files
committed
Mark Metal as automatically safe
1 parent ff3f8e1 commit c7e27e2

File tree

4 files changed

+100
-792
lines changed

4 files changed

+100
-792
lines changed

examples/metal/default_xcode_game/renderer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ fn load_pipeline_state(
167167
}
168168

169169
fn load_vertex_descriptor() -> Retained<MTLVertexDescriptor> {
170-
let vertex_descriptor = unsafe { MTLVertexDescriptor::new() };
170+
let vertex_descriptor = MTLVertexDescriptor::new();
171171

172172
unsafe {
173173
let attributes = vertex_descriptor.attributes();
@@ -201,7 +201,7 @@ fn load_vertex_descriptor() -> Retained<MTLVertexDescriptor> {
201201
fn load_depth_state(
202202
device: &ProtocolObject<dyn MTLDevice>,
203203
) -> Retained<ProtocolObject<dyn MTLDepthStencilState>> {
204-
let depth_state_desc = unsafe { MTLDepthStencilDescriptor::new() };
204+
let depth_state_desc = MTLDepthStencilDescriptor::new();
205205
depth_state_desc.setDepthCompareFunction(MTLCompareFunction::Less);
206206
depth_state_desc.setDepthWriteEnabled(true);
207207
device

framework-crates/objc2-metal/src/lib.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@
5353
//!
5454
//! It is yet unclear whether Metal APIs are bounds-checked on the CPU side or
5555
//! not, so APIs that take offsets / lengths are often unsafe.
56+
//!
57+
//! ## Threading
58+
//!
59+
//! TODO.
60+
//!
61+
//! ## Resource allocation and memory management
62+
//!
63+
//! TODO.
64+
//!
65+
//! ## Type safety
66+
//!
67+
//! TODO.
5668
#![recursion_limit = "256"]
5769
#![allow(non_snake_case)]
5870
#![no_std]

0 commit comments

Comments
 (0)