Skip to main content

ComputeCommandEncoderRef

Struct ComputeCommandEncoderRef 

Source
pub struct ComputeCommandEncoderRef(/* private fields */);
Expand description

A borrowed reference to a ComputeCommandEncoder.

Implementations§

Source§

impl ComputeCommandEncoderRef

Source

pub fn set_compute_pipeline_state(&self, state: &ComputePipelineStateRef)

Source

pub fn set_buffer( &self, index: NSUInteger, buffer: Option<&BufferRef>, offset: NSUInteger, )

Source

pub fn set_buffers( &self, start_index: NSUInteger, data: &[Option<&BufferRef>], offsets: &[NSUInteger], )

Source

pub fn set_texture(&self, index: NSUInteger, texture: Option<&TextureRef>)

Source

pub fn set_textures( &self, start_index: NSUInteger, data: &[Option<&TextureRef>], )

Source

pub fn set_sampler_state( &self, index: NSUInteger, sampler: Option<&SamplerStateRef>, )

Source

pub fn set_sampler_states( &self, start_index: NSUInteger, data: &[Option<&SamplerStateRef>], )

Source

pub fn set_sampler_state_with_lod( &self, index: NSUInteger, sampler: Option<&SamplerStateRef>, lod_clamp: Range<f32>, )

Source

pub fn set_bytes( &self, index: NSUInteger, length: NSUInteger, bytes: *const c_void, )

Source

pub fn set_visible_function_table( &self, buffer_index: NSUInteger, visible_function_table: Option<&VisibleFunctionTableRef>, )

Source

pub fn set_visible_function_tables( &self, buffer_start_index: NSUInteger, visible_function_tables: &[&VisibleFunctionTableRef], )

Source

pub fn dispatch_thread_groups( &self, thread_groups_count: MTLSize, threads_per_threadgroup: MTLSize, )

Source

pub fn dispatch_threads( &self, threads_per_grid: MTLSize, threads_per_thread_group: MTLSize, )

Source

pub fn dispatch_thread_groups_indirect( &self, buffer: &BufferRef, offset: NSUInteger, threads_per_threadgroup: MTLSize, )

Source

pub fn set_threadgroup_memory_length( &self, at_index: NSUInteger, size: NSUInteger, )

Source

pub fn memory_barrier_with_resources(&self, resources: &[&ResourceRef])

Encodes a barrier so that changes to a set of resources made by commands encoded before the barrier are completed before further commands are executed.

Availability: iOS 12.0+, macOS 10.14+

§Arguments
  • resources: A slice of resources.
Source

pub fn use_resource(&self, resource: &ResourceRef, usage: MTLResourceUsage)

Specifies that a resource in an argument buffer can be safely used by a compute pass.

Availability: iOS 11.0+, macOS 10.13+

§Arguments
  • resource: A specific resource within an argument buffer.
  • usage: The options that describe how the resource will be used by a compute function.
Source

pub fn use_resources(&self, resources: &[&ResourceRef], usage: MTLResourceUsage)

Specifies that an array of resources in an argument buffer can be safely used by a compute pass.

Availability: iOS 11.0+, macOS 10.13+

See https://developer.apple.com/documentation/metal/mtlcomputecommandencoder/2866561-useresources

§Arguments
  • resources: A slice of resources within an argument buffer.
  • usage: The options that describe how the array of resources will be used by a compute function.
Source

pub fn use_heap(&self, heap: &HeapRef)

Specifies that a heap containing resources in an argument buffer can be safely used by a compute pass.

Availability: iOS 11.0+, macOS 10.13+

See https://developer.apple.com/documentation/metal/mtlcomputecommandencoder/2866530-useheap

§Arguments
  • heap: A heap that contains resources within an argument buffer.
Source

pub fn use_heaps(&self, heaps: &[&HeapRef])

Specifies that an array of heaps containing resources in an argument buffer can be safely used by a compute pass.

Availability: iOS 11.0+, macOS 10.13+

§Arguments
  • heaps: A slice of heaps that contains resources within an argument buffer.
Source

pub fn update_fence(&self, fence: &FenceRef)

Source

pub fn wait_for_fence(&self, fence: &FenceRef)

Source

pub fn set_acceleration_structure( &self, index: NSUInteger, accel: Option<&AccelerationStructureRef>, )

Only available in (macos(11.0), ios(14.0))

Source

pub fn set_intersection_function_table( &self, index: NSUInteger, table: Option<&IntersectionFunctionTableRef>, )

Only available in (macos(11.0), ios(14.0))

Source

pub fn sample_counters_in_buffer( &self, sample_buffer: &CounterSampleBufferRef, sample_index: NSUInteger, with_barrier: bool, )

Methods from Deref<Target = CommandEncoderRef>§

Source

pub fn label(&self) -> &str

Source

pub fn set_label(&self, label: &str)

Source

pub fn end_encoding(&self)

Source

pub fn insert_debug_signpost(&self, name: &str)

Source

pub fn push_debug_group(&self, name: &str)

Source

pub fn pop_debug_group(&self)

Trait Implementations§

Source§

impl AsMut<ComputeCommandEncoderRef> for ComputeCommandEncoder

Source§

fn as_mut(&mut self) -> &mut ComputeCommandEncoderRef

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl AsRef<ComputeCommandEncoderRef> for ComputeCommandEncoder

Source§

fn as_ref(&self) -> &ComputeCommandEncoderRef

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<ComputeCommandEncoderRef> for ComputeCommandEncoder

Source§

fn borrow(&self) -> &ComputeCommandEncoderRef

Immutably borrows from an owned value. Read more
Source§

impl BorrowMut<ComputeCommandEncoderRef> for ComputeCommandEncoder

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl Debug for ComputeCommandEncoderRef

Source§

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

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

impl Deref for ComputeCommandEncoderRef

Source§

type Target = CommandEncoderRef

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl ForeignTypeRef for ComputeCommandEncoderRef

Source§

type CType = MTLComputeCommandEncoder

The raw C type.
Source§

unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self

Constructs a shared instance of this type from its raw type. Read more
Source§

unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self

Constructs a mutable reference of this type from its raw type. Read more
Source§

fn as_ptr(&self) -> *mut Self::CType

Returns a raw pointer to the wrapped value.
Source§

impl Message for ComputeCommandEncoderRef

Source§

unsafe fn send_message<A, R>( &self, sel: Sel, args: A, ) -> Result<R, MessageError>
where Self: Sized, A: MessageArguments, R: Any,

Sends a message to self with the given selector and arguments. Read more
Source§

fn verify_message<A, R>(&self, sel: Sel) -> Result<(), MessageError>
where Self: Sized, A: EncodeArguments, R: Encode,

Verifies that the argument and return types match the encoding of the method for the given selector. Read more
Source§

impl Send for ComputeCommandEncoderRef

Source§

impl Sync for ComputeCommandEncoderRef

Source§

impl ToOwned for ComputeCommandEncoderRef

Source§

type Owned = ComputeCommandEncoder

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> ComputeCommandEncoder

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

fn clone_into(&self, target: &mut Self::Owned)

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

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> 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.