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 { ... }
}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§
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. This resource can only be used with this device.
Sourcefn functionType(&self) -> MTLFunctionType
fn functionType(&self) -> MTLFunctionType
The overall kind of entry point: compute, vertex, or fragment.
Sourcefn patchType(&self) -> MTLPatchType
fn patchType(&self) -> MTLPatchType
Returns the patch type. MTLPatchTypeNone if it is not a post tessellation vertex shader.
Sourcefn patchControlPointCount(&self) -> NSInteger
fn patchControlPointCount(&self) -> NSInteger
Returns the number of patch control points if it was specified in the shader. Returns -1 if it was not specified.
fn vertexAttributes(&self) -> Option<Retained<NSArray<MTLVertexAttribute>>>
Sourcefn stageInputAttributes(&self) -> Option<Retained<NSArray<MTLAttribute>>>
fn stageInputAttributes(&self) -> Option<Retained<NSArray<MTLAttribute>>>
Returns an array describing the attributes
Sourcefn functionConstantsDictionary(
&self,
) -> Retained<NSDictionary<NSString, MTLFunctionConstant>>
fn functionConstantsDictionary( &self, ) -> Retained<NSDictionary<NSString, MTLFunctionConstant>>
A dictionary containing information about all function contents, keyed by the constant names.
Sourceunsafe fn newArgumentEncoderWithBufferIndex(
&self,
buffer_index: NSUInteger,
) -> Retained<ProtocolObject<dyn MTLArgumentEncoder>>
Available on crate feature MTLArgumentEncoder only.
unsafe fn newArgumentEncoderWithBufferIndex( &self, buffer_index: NSUInteger, ) -> Retained<ProtocolObject<dyn MTLArgumentEncoder>>
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.
Sourceunsafe fn newArgumentEncoderWithBufferIndex_reflection(
&self,
buffer_index: NSUInteger,
reflection: Option<&mut Option<Retained<MTLAutoreleasedArgument>>>,
) -> Retained<ProtocolObject<dyn MTLArgumentEncoder>>
👎Deprecated: Use MTLDevice’s newArgumentEncoderWithBufferBinding: insteadAvailable on crate features MTLArgument and MTLArgumentEncoder only.
unsafe fn newArgumentEncoderWithBufferIndex_reflection( &self, buffer_index: NSUInteger, reflection: Option<&mut Option<Retained<MTLAutoreleasedArgument>>>, ) -> Retained<ProtocolObject<dyn MTLArgumentEncoder>>
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.
Sourcefn options(&self) -> MTLFunctionOptions
Available on crate feature MTLFunctionDescriptor only.
fn options(&self) -> MTLFunctionOptions
MTLFunctionDescriptor only.The options this function was created with.