MTLFunction

Trait MTLFunction 

Source
pub unsafe trait MTLFunction:
    NSObjectProtocol
    + Send
    + Sync {
Show 13 methods // Provided methods fn label(&self) -> Option<Retained<NSString>> where Self: Sized + Message { ... } fn setLabel(&self, label: Option<&NSString>) where Self: Sized + Message { ... } fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>> where Self: Sized + Message { ... } fn functionType(&self) -> MTLFunctionType where Self: Sized + Message { ... } fn patchType(&self) -> MTLPatchType where Self: Sized + Message { ... } fn patchControlPointCount(&self) -> NSInteger where Self: Sized + Message { ... } fn vertexAttributes(&self) -> Option<Retained<NSArray<MTLVertexAttribute>>> where Self: Sized + Message { ... } fn stageInputAttributes(&self) -> Option<Retained<NSArray<MTLAttribute>>> where Self: Sized + Message { ... } fn name(&self) -> Retained<NSString> where Self: Sized + Message { ... } fn functionConstantsDictionary( &self, ) -> Retained<NSDictionary<NSString, MTLFunctionConstant>> where Self: Sized + Message { ... } unsafe fn newArgumentEncoderWithBufferIndex( &self, buffer_index: NSUInteger, ) -> Retained<ProtocolObject<dyn MTLArgumentEncoder>> where Self: Sized + Message { ... } unsafe fn newArgumentEncoderWithBufferIndex_reflection( &self, buffer_index: NSUInteger, reflection: Option<&mut Option<Retained<MTLAutoreleasedArgument>>>, ) -> Retained<ProtocolObject<dyn MTLArgumentEncoder>> where Self: Sized + Message { ... } fn options(&self) -> MTLFunctionOptions where Self: Sized + Message { ... }
}
Available on crate feature MTLLibrary only.
Expand description

A handle to intermediate code used as inputs for either a MTLComputePipelineState or a MTLRenderPipelineState.

MTLFunction is a single vertex shader, fragment shader, or compute function. A Function can only be used with the device that it was created against.

See also Apple’s documentation

Provided Methods§

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 device(&self) -> Retained<ProtocolObject<dyn MTLDevice>>
where Self: Sized + Message,

Available on crate feature MTLDevice only.

The device this resource was created against. This resource can only be used with this device.

Source

fn functionType(&self) -> MTLFunctionType
where Self: Sized + Message,

The overall kind of entry point: compute, vertex, or fragment.

Source

fn patchType(&self) -> MTLPatchType
where Self: Sized + Message,

Returns the patch type. MTLPatchTypeNone if it is not a post tessellation vertex shader.

Source

fn patchControlPointCount(&self) -> NSInteger
where Self: Sized + Message,

Returns the number of patch control points if it was specified in the shader. Returns -1 if it was not specified.

Source

fn vertexAttributes(&self) -> Option<Retained<NSArray<MTLVertexAttribute>>>
where Self: Sized + Message,

Source

fn stageInputAttributes(&self) -> Option<Retained<NSArray<MTLAttribute>>>
where Self: Sized + Message,

Returns an array describing the attributes

Source

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

The name of the function in the shading language.

Source

fn functionConstantsDictionary( &self, ) -> Retained<NSDictionary<NSString, MTLFunctionConstant>>
where Self: Sized + Message,

A dictionary containing information about all function contents, keyed by the constant names.

Source

unsafe fn newArgumentEncoderWithBufferIndex( &self, buffer_index: NSUInteger, ) -> Retained<ProtocolObject<dyn MTLArgumentEncoder>>
where Self: Sized + Message,

Available on crate feature MTLArgumentEncoder only.

Creates an argument encoder which will encode arguments matching the layout of the argument buffer at the given bind point index.

§Safety

bufferIndex might not be bounds-checked.

Source

unsafe fn newArgumentEncoderWithBufferIndex_reflection( &self, buffer_index: NSUInteger, reflection: Option<&mut Option<Retained<MTLAutoreleasedArgument>>>, ) -> Retained<ProtocolObject<dyn MTLArgumentEncoder>>
where Self: Sized + Message,

👎Deprecated: Use MTLDevice’s newArgumentEncoderWithBufferBinding: instead
Available on crate features MTLArgument and MTLArgumentEncoder only.

Creates an argument encoder which will encode arguments matching the layout of the argument buffer at the given bind point index.

§Safety

bufferIndex might not be bounds-checked.

Source

fn options(&self) -> MTLFunctionOptions
where Self: Sized + Message,

Available on crate feature MTLFunctionDescriptor only.

The options this function was created with.

Trait Implementations§

Source§

impl ProtocolType for dyn MTLFunction

Source§

const NAME: &'static str = "MTLFunction"

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 MTLFunction
where T: ?Sized + Message + MTLFunction,

Implementations on Foreign Types§

Source§

impl<T> MTLFunction for ProtocolObject<T>
where T: ?Sized + MTLFunction,

Implementors§