pub struct IOCommandBuffer(/* private fields */);Expand description
Command buffer for IO operations.
C++ equivalent: MTL::IOCommandBuffer
Implementations§
Source§impl IOCommandBuffer
impl IOCommandBuffer
Sourcepub fn add_barrier(&self)
pub fn add_barrier(&self)
Add a barrier.
C++ equivalent: void addBarrier()
Sourcepub fn copy_status_to_buffer(&self, buffer: &Buffer, offset: UInteger)
pub fn copy_status_to_buffer(&self, buffer: &Buffer, offset: UInteger)
Copy the status to a buffer.
C++ equivalent: void copyStatusToBuffer(const Buffer*, NS::UInteger)
Sourcepub fn error(&self) -> Option<Error>
pub fn error(&self) -> Option<Error>
Get the error, if any.
C++ equivalent: NS::Error* error() const
Sourcepub fn set_label(&self, label: &str)
pub fn set_label(&self, label: &str)
Set the label.
C++ equivalent: void setLabel(const NS::String*)
Sourcepub fn load_buffer(
&self,
buffer: &Buffer,
offset: UInteger,
size: UInteger,
source_handle: &IOFileHandle,
source_handle_offset: UInteger,
)
pub fn load_buffer( &self, buffer: &Buffer, offset: UInteger, size: UInteger, source_handle: &IOFileHandle, source_handle_offset: UInteger, )
Load data from a file into a buffer.
C++ equivalent: void loadBuffer(const Buffer*, NS::UInteger, NS::UInteger, const IOFileHandle*, NS::UInteger)
Sourcepub unsafe fn load_bytes(
&self,
pointer: *mut c_void,
size: UInteger,
source_handle: &IOFileHandle,
source_handle_offset: UInteger,
)
pub unsafe fn load_bytes( &self, pointer: *mut c_void, size: UInteger, source_handle: &IOFileHandle, source_handle_offset: UInteger, )
Load data from a file into memory.
§Safety
The pointer must point to valid memory of at least size bytes.
C++ equivalent: void loadBytes(const void*, NS::UInteger, const IOFileHandle*, NS::UInteger)
Sourcepub fn load_texture(
&self,
texture: &Texture,
slice: UInteger,
level: UInteger,
size: Size,
source_bytes_per_row: UInteger,
source_bytes_per_image: UInteger,
destination_origin: Origin,
source_handle: &IOFileHandle,
source_handle_offset: UInteger,
)
pub fn load_texture( &self, texture: &Texture, slice: UInteger, level: UInteger, size: Size, source_bytes_per_row: UInteger, source_bytes_per_image: UInteger, destination_origin: Origin, source_handle: &IOFileHandle, source_handle_offset: UInteger, )
Load data from a file into a texture.
C++ equivalent: void loadTexture(const Texture*, NS::UInteger, NS::UInteger, Size, NS::UInteger, NS::UInteger, Origin, const IOFileHandle*, NS::UInteger)
Sourcepub fn pop_debug_group(&self)
pub fn pop_debug_group(&self)
Pop a debug group.
C++ equivalent: void popDebugGroup()
Sourcepub fn push_debug_group(&self, name: &str)
pub fn push_debug_group(&self, name: &str)
Push a debug group.
C++ equivalent: void pushDebugGroup(const NS::String*)
Sourcepub fn signal_event(&self, event: &SharedEvent, value: u64)
pub fn signal_event(&self, event: &SharedEvent, value: u64)
Signal a shared event.
C++ equivalent: void signalEvent(const SharedEvent*, uint64_t)
Sourcepub fn try_cancel(&self)
pub fn try_cancel(&self)
Try to cancel the command buffer.
C++ equivalent: void tryCancel()
Sourcepub fn wait(&self, event: &SharedEvent, value: u64)
pub fn wait(&self, event: &SharedEvent, value: u64)
Wait for a shared event to reach a value.
C++ equivalent: void wait(const SharedEvent*, uint64_t)
Sourcepub fn wait_until_completed(&self)
pub fn wait_until_completed(&self)
Wait until the command buffer completes.
C++ equivalent: void waitUntilCompleted()
Sourcepub unsafe fn add_completed_handler_ptr(&self, block: *const c_void)
pub unsafe fn add_completed_handler_ptr(&self, block: *const c_void)
Add a completed handler (raw block pointer).
§Safety
The block pointer must be a valid Objective-C block.
C++ equivalent: void addCompletedHandler(const IOCommandBufferHandler)
Sourcepub fn add_completed_handler<F>(&self, handler: F)
pub fn add_completed_handler<F>(&self, handler: F)
Add a handler to be called when the IO command buffer completes.
C++ equivalent: void addCompletedHandler(const IOCommandBufferHandler)
The handler is called with a reference to the completed IO command buffer.