Skip to main content

CommandQueue

Struct CommandQueue 

Source
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

Source

pub unsafe fn from_raw(ptr: *mut c_void) -> Option<Self>

Create a CommandQueue from a raw pointer.

Source

pub fn as_raw(&self) -> *mut c_void

Get the raw pointer.

Source

pub fn device(&self) -> Option<Device>

Get the device.

C++ equivalent: MTL::Device* device() const

Source

pub fn label(&self) -> Option<String>

Get the label.

C++ equivalent: NS::String* label() const

Source

pub fn add_residency_set(&self, residency_set: &ResidencySet)

Add a residency set.

C++ equivalent: void addResidencySet(const MTL::ResidencySet*)

Source

pub fn add_residency_sets(&self, residency_sets: &[&ResidencySet])

Add multiple residency sets.

C++ equivalent: void addResidencySets(const MTL::ResidencySet* const[], NS::UInteger count)

Source

pub fn remove_residency_set(&self, residency_set: &ResidencySet)

Remove a residency set.

C++ equivalent: void removeResidencySet(const MTL::ResidencySet*)

Source

pub fn remove_residency_sets(&self, residency_sets: &[&ResidencySet])

Remove multiple residency sets.

C++ equivalent: void removeResidencySets(const MTL::ResidencySet* const[], NS::UInteger count)

Source

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.

Source

pub fn commit(&self, command_buffers: &[&CommandBuffer])

Commit command buffers for execution.

C++ equivalent: void commit(const MTL4::CommandBuffer* const[], NS::UInteger count)

Source

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*)

Source

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)

Source

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)

Source

pub fn signal_drawable(&self, drawable: &Drawable)

Signal a drawable for presentation.

C++ equivalent: void signalDrawable(const MTL::Drawable*)

Source

pub fn wait_for_drawable(&self, drawable: &Drawable)

Wait for a drawable.

C++ equivalent: void wait(const MTL::Drawable*)

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Clone for CommandQueue

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CommandQueue

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for CommandQueue

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl Referencing for CommandQueue

Source§

fn as_ptr(&self) -> *const c_void

Get the raw pointer to the Objective-C object.
Source§

fn as_mut_ptr(&self) -> *mut c_void

Get the raw mutable pointer to the Objective-C object.
Source§

fn retain(&self) -> Self
where Self: Clone,

Retain the object, incrementing its reference count. Read more
Source§

fn release(&self)

Release the object, decrementing its reference count. Read more
Source§

fn autorelease(&self) -> Self
where Self: Clone,

Autorelease the object. Read more
Source§

fn retain_count(&self) -> usize

Get the retain count of the object. Read more
Source§

impl Send for CommandQueue

Source§

impl Sync for CommandQueue

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.