pub struct CommandQueue(/* private fields */);Expand description
MTL4 command queue with explicit residency management.
C++ equivalent: MTL4::CommandQueue
CommandQueue in Metal 4 provides explicit control over residency sets and command buffer submission.
Implementations§
Source§impl CommandQueue
impl CommandQueue
Sourcepub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>
Create a CommandQueue from a raw pointer.
Sourcepub fn device(&self) -> Option<Device>
pub fn device(&self) -> Option<Device>
Get the device.
C++ equivalent: MTL::Device* device() const
Sourcepub fn add_residency_set(&self, residency_set: &ResidencySet)
pub fn add_residency_set(&self, residency_set: &ResidencySet)
Add a residency set.
C++ equivalent: void addResidencySet(const MTL::ResidencySet*)
Sourcepub fn add_residency_sets(&self, residency_sets: &[&ResidencySet])
pub fn add_residency_sets(&self, residency_sets: &[&ResidencySet])
Add multiple residency sets.
C++ equivalent: void addResidencySets(const MTL::ResidencySet* const[], NS::UInteger count)
Sourcepub fn remove_residency_set(&self, residency_set: &ResidencySet)
pub fn remove_residency_set(&self, residency_set: &ResidencySet)
Remove a residency set.
C++ equivalent: void removeResidencySet(const MTL::ResidencySet*)
Sourcepub fn remove_residency_sets(&self, residency_sets: &[&ResidencySet])
pub fn remove_residency_sets(&self, residency_sets: &[&ResidencySet])
Remove multiple residency sets.
C++ equivalent: void removeResidencySets(const MTL::ResidencySet* const[], NS::UInteger count)
Sourcepub fn new_command_buffer(&self) -> Option<CommandBuffer>
pub fn new_command_buffer(&self) -> Option<CommandBuffer>
Create a new MTL4 command buffer.
C++ equivalent: MTL4::CommandBuffer* newCommandBuffer()
The returned command buffer must be used with begin_command_buffer()
and end_command_buffer() to record commands.
Sourcepub fn commit(&self, command_buffers: &[&CommandBuffer])
pub fn commit(&self, command_buffers: &[&CommandBuffer])
Commit command buffers for execution.
C++ equivalent: void commit(const MTL4::CommandBuffer* const[], NS::UInteger count)
Sourcepub fn commit_with_options(
&self,
command_buffers: &[&CommandBuffer],
options: &CommitOptions,
)
pub fn commit_with_options( &self, command_buffers: &[&CommandBuffer], options: &CommitOptions, )
Commit command buffers with options.
C++ equivalent: void commit(const MTL4::CommandBuffer* const[], NS::UInteger, const MTL4::CommitOptions*)
Sourcepub fn signal_event(&self, event: &Event, value: u64)
pub fn signal_event(&self, event: &Event, value: u64)
Signal an event with a value.
C++ equivalent: void signalEvent(const MTL::Event*, uint64_t value)
Sourcepub fn wait_for_event(&self, event: &Event, value: u64)
pub fn wait_for_event(&self, event: &Event, value: u64)
Wait for an event to reach a value.
C++ equivalent: void wait(const MTL::Event*, uint64_t value)
Sourcepub fn signal_drawable(&self, drawable: &Drawable)
pub fn signal_drawable(&self, drawable: &Drawable)
Signal a drawable for presentation.
C++ equivalent: void signalDrawable(const MTL::Drawable*)
Sourcepub fn wait_for_drawable(&self, drawable: &Drawable)
pub fn wait_for_drawable(&self, drawable: &Drawable)
Wait for a drawable.
C++ equivalent: void wait(const MTL::Drawable*)
Sourcepub unsafe fn copy_buffer_mappings_from_buffer(
&self,
source_buffer: *const c_void,
destination_buffer: *const c_void,
operations: *const c_void,
count: UInteger,
)
pub unsafe fn copy_buffer_mappings_from_buffer( &self, source_buffer: *const c_void, destination_buffer: *const c_void, operations: *const c_void, count: UInteger, )
Copy buffer mappings from one buffer to another.
C++ equivalent: void copyBufferMappingsFromBuffer(const MTL::Buffer*, const MTL::Buffer*, const MTL4::CopySparseBufferMappingOperation*, NS::UInteger)
§Safety
The operations pointer must be valid and point to count operations.
Sourcepub unsafe fn copy_texture_mappings_from_texture(
&self,
source_texture: *const c_void,
destination_texture: *const c_void,
operations: *const c_void,
count: UInteger,
)
pub unsafe fn copy_texture_mappings_from_texture( &self, source_texture: *const c_void, destination_texture: *const c_void, operations: *const c_void, count: UInteger, )
Copy texture mappings from one texture to another.
C++ equivalent: void copyTextureMappingsFromTexture(const MTL::Texture*, const MTL::Texture*, const MTL4::CopySparseTextureMappingOperation*, NS::UInteger)
§Safety
The operations pointer must be valid and point to count operations.
Sourcepub unsafe fn update_buffer_mappings(
&self,
buffer: *const c_void,
heap: *const c_void,
operations: *const c_void,
count: UInteger,
)
pub unsafe fn update_buffer_mappings( &self, buffer: *const c_void, heap: *const c_void, operations: *const c_void, count: UInteger, )
Update buffer mappings for a sparse buffer.
C++ equivalent: void updateBufferMappings(const MTL::Buffer*, const MTL::Heap*, const MTL4::UpdateSparseBufferMappingOperation*, NS::UInteger)
§Safety
The operations pointer must be valid and point to count operations.
Sourcepub unsafe fn update_texture_mappings(
&self,
texture: *const c_void,
heap: *const c_void,
operations: *const c_void,
count: UInteger,
)
pub unsafe fn update_texture_mappings( &self, texture: *const c_void, heap: *const c_void, operations: *const c_void, count: UInteger, )
Update texture mappings for a sparse texture.
C++ equivalent: void updateTextureMappings(const MTL::Texture*, const MTL::Heap*, const MTL4::UpdateSparseTextureMappingOperation*, NS::UInteger)
§Safety
The operations pointer must be valid and point to count operations.