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 { ... }
}MTLCommandEncoder only.Expand description
MTLCommandEncoder is the common interface for objects that write commands into MTLCommandBuffers.
See also Apple’s documentation
Provided Methods§
Sourcefn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>
Available on crate feature MTLDevice only.
fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>
MTLDevice only.The device this resource was created against.
Sourcefn endEncoding(&self)
fn endEncoding(&self)
Declare that all command generation from this encoder is complete, and detach from the MTLCommandBuffer.
Sourcefn barrierAfterQueueStages_beforeStages(
&self,
after_queue_stages: MTLStages,
before_stages: MTLStages,
)
fn barrierAfterQueueStages_beforeStages( &self, after_queue_stages: MTLStages, before_stages: MTLStages, )
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:
MTLStagesmask 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:
MTLStagesmask that represents the stages of work that wait. This argument applies to work you encode in the current command encoder.
Sourcefn insertDebugSignpost(&self, string: &NSString)
fn insertDebugSignpost(&self, string: &NSString)
Inserts a debug string into the command buffer. This does not change any API behavior, but can be useful when debugging.
Sourcefn pushDebugGroup(&self, string: &NSString)
fn pushDebugGroup(&self, string: &NSString)
Push a new named string onto a stack of string labels.
Sourcefn popDebugGroup(&self)
fn popDebugGroup(&self)
Pop the latest named string off of the stack.