Skip to content

Commit bac1b68

Browse files
ccbrownkvark
authored andcommitted
add new_buffer_with_bytes_no_copy
1 parent 08cc15a commit bac1b68

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Diff for: src/device.rs

+15
Original file line numberDiff line numberDiff line change
@@ -1899,6 +1899,21 @@ impl DeviceRef {
18991899
}
19001900
}
19011901

1902+
pub fn new_buffer_with_bytes_no_copy(
1903+
&self,
1904+
bytes: *const std::ffi::c_void,
1905+
length: NSUInteger,
1906+
options: MTLResourceOptions,
1907+
deallocator: Option<&Block<(*const std::ffi::c_void, NSUInteger), ()>>,
1908+
) -> Buffer {
1909+
unsafe {
1910+
msg_send![self, newBufferWithBytesNoCopy:bytes
1911+
length:length
1912+
options:options
1913+
deallocator:deallocator]
1914+
}
1915+
}
1916+
19021917
pub fn new_buffer_with_data(
19031918
&self,
19041919
bytes: *const std::ffi::c_void,

0 commit comments

Comments
 (0)