MTLCommandEncoder

Trait MTLCommandEncoder 

Source
pub unsafe trait MTLCommandEncoder: NSObjectProtocol {
    // Provided methods
    fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>
       where Self: Sized + Message { ... }
    fn label(&self) -> Option<Retained<NSString>>
       where Self: Sized + Message { ... }
    fn setLabel(&self, label: Option<&NSString>)
       where Self: Sized + Message { ... }
    fn endEncoding(&self)
       where Self: Sized + Message { ... }
    fn barrierAfterQueueStages_beforeStages(
        &self,
        after_queue_stages: MTLStages,
        before_stages: MTLStages,
    )
       where Self: Sized + Message { ... }
    fn insertDebugSignpost(&self, string: &NSString)
       where Self: Sized + Message { ... }
    fn pushDebugGroup(&self, string: &NSString)
       where Self: Sized + Message { ... }
    fn popDebugGroup(&self)
       where Self: Sized + Message { ... }
}
Available on crate feature MTLCommandEncoder only.
Expand description

MTLCommandEncoder is the common interface for objects that write commands into MTLCommandBuffers.

See also Apple’s documentation

Provided Methods§

Source

fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>
where Self: Sized + Message,

Available on crate feature MTLDevice only.

The device this resource was created against.

Source

fn label(&self) -> Option<Retained<NSString>>
where Self: Sized + Message,

A string to help identify this object.

Source

fn setLabel(&self, label: Option<&NSString>)
where Self: Sized + Message,

Setter for label.

This is copied when set.

Source

fn endEncoding(&self)
where Self: Sized + Message,

Declare that all command generation from this encoder is complete, and detach from the MTLCommandBuffer.

Source

fn barrierAfterQueueStages_beforeStages( &self, after_queue_stages: MTLStages, before_stages: MTLStages, )
where Self: Sized + Message,

Encodes a consumer barrier on work you commit to the same command queue.

Encode a barrier that guarantees that any subsequent work you encode in the current command encoder that corresponds to the beforeStages stages doesn’t proceed until Metal completes all work prior to the current command encoder corresponding to the afterQueueStages stages, completes.

Metal can reorder the exact point where it applies the barrier, so use this method for synchronizing between different passes.

If you need to synchronize work within a pass that you encode with an instance of a subclass of MTLCommandEncoder, use memory barriers instead. For subclasses of MTL4CommandEncoder, use encoder barriers.

You can specify afterQueueStages and beforeStages that contain MTLStages unrelated to the current command encoder.

  • Parameters:
  • afterQueueStages: MTLStages mask that represents the stages of work to wait for. This argument applies to work corresponding to these stages you encode in prior command encoders, and not for the current encoder.
  • beforeStages: MTLStages mask that represents the stages of work that wait. This argument applies to work you encode in the current command encoder.
Source

fn insertDebugSignpost(&self, string: &NSString)
where Self: Sized + Message,

Inserts a debug string into the command buffer. This does not change any API behavior, but can be useful when debugging.

Source

fn pushDebugGroup(&self, string: &NSString)
where Self: Sized + Message,

Push a new named string onto a stack of string labels.

Source

fn popDebugGroup(&self)
where Self: Sized + Message,

Pop the latest named string off of the stack.

Trait Implementations§

Source§

impl ProtocolType for dyn MTLCommandEncoder

Source§

const NAME: &'static str = "MTLCommandEncoder"

The name of the Objective-C protocol that this type represents. Read more
Source§

fn protocol() -> Option<&'static AnyProtocol>

Get a reference to the Objective-C protocol object that this type represents. Read more
Source§

impl<T> ImplementedBy<T> for dyn MTLCommandEncoder

Implementations on Foreign Types§

Source§

impl<T> MTLCommandEncoder for ProtocolObject<T>

Implementors§