MTL4Compiler

Trait MTL4Compiler 

Source
pub unsafe trait MTL4Compiler:
    NSObjectProtocol
    + Send
    + Sync {
Show 23 methods // Provided methods fn device(&self) -> Retained<ProtocolObject<dyn MTLDevice>> where Self: Sized + Message { ... } fn label(&self) -> Option<Retained<NSString>> where Self: Sized + Message { ... } fn pipelineDataSetSerializer( &self, ) -> Option<Retained<ProtocolObject<dyn MTL4PipelineDataSetSerializer>>> where Self: Sized + Message { ... } fn newLibraryWithDescriptor_error( &self, descriptor: &MTL4LibraryDescriptor, ) -> Result<Retained<ProtocolObject<dyn MTLLibrary>>, Retained<NSError>> where Self: Sized + Message { ... } fn newDynamicLibrary_error( &self, library: &ProtocolObject<dyn MTLLibrary>, ) -> Result<Retained<ProtocolObject<dyn MTLDynamicLibrary>>, Retained<NSError>> where Self: Sized + Message { ... } fn newDynamicLibraryWithURL_error( &self, url: &NSURL, ) -> Result<Retained<ProtocolObject<dyn MTLDynamicLibrary>>, Retained<NSError>> where Self: Sized + Message { ... } fn newComputePipelineStateWithDescriptor_compilerTaskOptions_error( &self, descriptor: &MTL4ComputePipelineDescriptor, compiler_task_options: Option<&MTL4CompilerTaskOptions>, ) -> Result<Retained<ProtocolObject<dyn MTLComputePipelineState>>, Retained<NSError>> where Self: Sized + Message { ... } fn newComputePipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_error( &self, descriptor: &MTL4ComputePipelineDescriptor, dynamic_linking_descriptor: Option<&MTL4PipelineStageDynamicLinkingDescriptor>, compiler_task_options: Option<&MTL4CompilerTaskOptions>, ) -> Result<Retained<ProtocolObject<dyn MTLComputePipelineState>>, Retained<NSError>> where Self: Sized + Message { ... } fn newRenderPipelineStateWithDescriptor_compilerTaskOptions_error( &self, descriptor: &MTL4PipelineDescriptor, compiler_task_options: Option<&MTL4CompilerTaskOptions>, ) -> Result<Retained<ProtocolObject<dyn MTLRenderPipelineState>>, Retained<NSError>> where Self: Sized + Message { ... } fn newRenderPipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_error( &self, descriptor: &MTL4PipelineDescriptor, dynamic_linking_descriptor: Option<&MTL4RenderPipelineDynamicLinkingDescriptor>, compiler_task_options: Option<&MTL4CompilerTaskOptions>, ) -> Result<Retained<ProtocolObject<dyn MTLRenderPipelineState>>, Retained<NSError>> where Self: Sized + Message { ... } fn newRenderPipelineStateBySpecializationWithDescriptor_pipeline_error( &self, descriptor: &MTL4PipelineDescriptor, pipeline: &ProtocolObject<dyn MTLRenderPipelineState>, ) -> Result<Retained<ProtocolObject<dyn MTLRenderPipelineState>>, Retained<NSError>> where Self: Sized + Message { ... } fn newBinaryFunctionWithDescriptor_compilerTaskOptions_error( &self, descriptor: &MTL4BinaryFunctionDescriptor, compiler_task_options: Option<&MTL4CompilerTaskOptions>, ) -> Result<Retained<ProtocolObject<dyn MTL4BinaryFunction>>, Retained<NSError>> where Self: Sized + Message { ... } unsafe fn newLibraryWithDescriptor_completionHandler( &self, descriptor: &MTL4LibraryDescriptor, completion_handler: MTLNewLibraryCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>> where Self: Sized + Message { ... } unsafe fn newDynamicLibrary_completionHandler( &self, library: &ProtocolObject<dyn MTLLibrary>, completion_handler: MTLNewDynamicLibraryCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>> where Self: Sized + Message { ... } unsafe fn newDynamicLibraryWithURL_completionHandler( &self, url: &NSURL, completion_handler: MTLNewDynamicLibraryCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>> where Self: Sized + Message { ... } unsafe fn newComputePipelineStateWithDescriptor_compilerTaskOptions_completionHandler( &self, descriptor: &MTL4ComputePipelineDescriptor, compiler_task_options: Option<&MTL4CompilerTaskOptions>, completion_handler: MTLNewComputePipelineStateCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>> where Self: Sized + Message { ... } unsafe fn newComputePipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_completionHandler( &self, descriptor: &MTL4ComputePipelineDescriptor, dynamic_linking_descriptor: Option<&MTL4PipelineStageDynamicLinkingDescriptor>, compiler_task_options: Option<&MTL4CompilerTaskOptions>, completion_handler: MTLNewComputePipelineStateCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>> where Self: Sized + Message { ... } unsafe fn newRenderPipelineStateWithDescriptor_compilerTaskOptions_completionHandler( &self, descriptor: &MTL4PipelineDescriptor, compiler_task_options: Option<&MTL4CompilerTaskOptions>, completion_handler: MTLNewRenderPipelineStateCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>> where Self: Sized + Message { ... } unsafe fn newRenderPipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_completionHandler( &self, descriptor: &MTL4PipelineDescriptor, dynamic_linking_descriptor: Option<&MTL4RenderPipelineDynamicLinkingDescriptor>, compiler_task_options: Option<&MTL4CompilerTaskOptions>, completion_handler: MTLNewRenderPipelineStateCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>> where Self: Sized + Message { ... } unsafe fn newRenderPipelineStateBySpecializationWithDescriptor_pipeline_completionHandler( &self, descriptor: &MTL4PipelineDescriptor, pipeline: &ProtocolObject<dyn MTLRenderPipelineState>, completion_handler: MTLNewRenderPipelineStateCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>> where Self: Sized + Message { ... } unsafe fn newBinaryFunctionWithDescriptor_compilerTaskOptions_completionHandler( &self, descriptor: &MTL4BinaryFunctionDescriptor, compiler_task_options: Option<&MTL4CompilerTaskOptions>, completion_handler: MTL4NewBinaryFunctionCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>> where Self: Sized + Message { ... } fn newMachineLearningPipelineStateWithDescriptor_error( &self, descriptor: &MTL4MachineLearningPipelineDescriptor, ) -> Result<Retained<ProtocolObject<dyn MTL4MachineLearningPipelineState>>, Retained<NSError>> where Self: Sized + Message { ... } unsafe fn newMachineLearningPipelineStateWithDescriptor_completionHandler( &self, descriptor: &MTL4MachineLearningPipelineDescriptor, completion_handler: MTL4NewMachineLearningPipelineStateCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>> where Self: Sized + Message { ... }
}
Available on crate feature MTL4Compiler only.
Expand description

A abstraction for a pipeline state and shader function compiler.

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.

Returns the device that this compiler belongs to.

Source

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

Returns the optional label you specify at creation time.

Source

fn pipelineDataSetSerializer( &self, ) -> Option<Retained<ProtocolObject<dyn MTL4PipelineDataSetSerializer>>>
where Self: Sized + Message,

Available on crate feature MTL4PipelineDataSetSerializer only.

Returns the pipeline data set serializer into which this compiler stores data for all pipelines it creates.

Source

fn newLibraryWithDescriptor_error( &self, descriptor: &MTL4LibraryDescriptor, ) -> Result<Retained<ProtocolObject<dyn MTLLibrary>>, Retained<NSError>>
where Self: Sized + Message,

Available on crate features MTL4LibraryDescriptor and MTLLibrary only.

Creates a new Metal library synchronously.

  • Parameters:

  • descriptor: A description of the library to create.

  • error: An optional parameter into which Metal stores information in case of an error.

  • Returns: a Metal library instance upon success, nil otherwise.

Source

fn newDynamicLibrary_error( &self, library: &ProtocolObject<dyn MTLLibrary>, ) -> Result<Retained<ProtocolObject<dyn MTLDynamicLibrary>>, Retained<NSError>>
where Self: Sized + Message,

Available on crate features MTLDynamicLibrary and MTLLibrary only.

Creates a new dynamic library from a library containing Metal IR code synchronously.

  • Parameters:

  • library: A library from which this compiler creates the new a dynamic library

  • error: An optional parameter into which Metal stores information in case of an error.

  • Returns: A new dynamic Metal library upon success, nil otherwise.

Source

fn newDynamicLibraryWithURL_error( &self, url: &NSURL, ) -> Result<Retained<ProtocolObject<dyn MTLDynamicLibrary>>, Retained<NSError>>
where Self: Sized + Message,

Available on crate feature MTLDynamicLibrary only.

Creates a new dynamic library from the contents of a file at an URL location synchronously.

  • Parameters:

  • url: An URL referencing a file whose contents this compiler uses to build a dynamic library.

  • error: An optional parameter into which Metal stores information in case of an error.

  • Returns: A new dynamic Metal library upon success, nil otherwise.

Source

fn newComputePipelineStateWithDescriptor_compilerTaskOptions_error( &self, descriptor: &MTL4ComputePipelineDescriptor, compiler_task_options: Option<&MTL4CompilerTaskOptions>, ) -> Result<Retained<ProtocolObject<dyn MTLComputePipelineState>>, Retained<NSError>>
where Self: Sized + Message,

Available on crate features MTL4ComputePipeline and MTL4PipelineState and MTLAllocation and MTLComputePipeline only.

Creates a new compute pipeline state object synchronously.

  • Parameters:

  • descriptor: A compute pipeline state descriptor describing the pipeline this compiler creates.

  • compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.

  • error: An optional parameter into which Metal stores information in case of an error.

  • Returns: A new compute pipeline state object upon success, nil otherwise.

Source

fn newComputePipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_error( &self, descriptor: &MTL4ComputePipelineDescriptor, dynamic_linking_descriptor: Option<&MTL4PipelineStageDynamicLinkingDescriptor>, compiler_task_options: Option<&MTL4CompilerTaskOptions>, ) -> Result<Retained<ProtocolObject<dyn MTLComputePipelineState>>, Retained<NSError>>
where Self: Sized + Message,

Available on crate features MTL4ComputePipeline and MTL4LinkingDescriptor and MTL4PipelineState and MTLAllocation and MTLComputePipeline only.

Creates a new compute pipeline state synchronously.

  • Parameters:

  • descriptor: A compute pipeline state descriptor describing the pipeline this compiler creates.

  • dynamicLinkingDescriptor: An optional parameter that provides additional configuration for linking the pipeline state object.

  • compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.

  • error: An optional parameter into which Metal stores information in case of an error.

  • Returns: A new compute pipeline state object upon success, nil otherwise.

Source

fn newRenderPipelineStateWithDescriptor_compilerTaskOptions_error( &self, descriptor: &MTL4PipelineDescriptor, compiler_task_options: Option<&MTL4CompilerTaskOptions>, ) -> Result<Retained<ProtocolObject<dyn MTLRenderPipelineState>>, Retained<NSError>>
where Self: Sized + Message,

Available on crate features MTL4PipelineState and MTLAllocation and MTLRenderPipeline only.

Creates a new render pipeline state synchronously.

Use this method to build any render pipeline type, including render, tile, and mesh render pipeline states. The type of the descriptor you pass indicates the pipeline type this method builds.

Passing in a compute pipeline descriptor to the descriptor parameter produces an error.

  • Parameters:

  • descriptor: A render, tile, or mesh pipeline state descriptor that describes the pipeline to create.

  • compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.

  • error: An optional parameter into which Metal stores information in case of an error.

  • Returns: A new render pipeline state object upon success, nil otherwise.

Source

fn newRenderPipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_error( &self, descriptor: &MTL4PipelineDescriptor, dynamic_linking_descriptor: Option<&MTL4RenderPipelineDynamicLinkingDescriptor>, compiler_task_options: Option<&MTL4CompilerTaskOptions>, ) -> Result<Retained<ProtocolObject<dyn MTLRenderPipelineState>>, Retained<NSError>>
where Self: Sized + Message,

Available on crate features MTL4LinkingDescriptor and MTL4PipelineState and MTLAllocation and MTLRenderPipeline only.

Creates a new render pipeline state synchronously.

Use this method to build any render pipeline type, including render, tile, and mesh render pipeline states. The type of the descriptor you pass indicates the pipeline type this method builds.

Passing in a compute pipeline descriptor to the descriptor parameter produces an error.

  • Parameters:

  • descriptor: A render, tile, or mesh pipeline state descriptor that describes the pipeline to create.

  • dynamicLinkingDescriptor: An optional parameter that provides additional configuration for linking the pipeline state object.

  • compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.

  • error: An optional parameter into which Metal stores information in case of an error.

  • Returns: A new render pipeline state object upon success, nil otherwise.

Source

fn newRenderPipelineStateBySpecializationWithDescriptor_pipeline_error( &self, descriptor: &MTL4PipelineDescriptor, pipeline: &ProtocolObject<dyn MTLRenderPipelineState>, ) -> Result<Retained<ProtocolObject<dyn MTLRenderPipelineState>>, Retained<NSError>>
where Self: Sized + Message,

Available on crate features MTL4PipelineState and MTLAllocation and MTLRenderPipeline only.

Creates a new render pipeline state from another, previously unspecialized, pipeline state.

Metal specializes the pipeline state with new state values the descriptor provides, observing the following rules:

  • The compiler only updates properties that were originally specified as unspecialized. It doesn’t modify other already-specialized properties
  • The compiler sets to their default behavior any unspecialized properties that your passed-in descriptor doesn’t specialize

Additionally, there are some cases where the Metal can’t specialize a pipeline:

  • If the original pipeline state object doesn’t have any unspecialized properties
  • You can’t re-specialize a previously specialized pipeline state object
  • Parameters:

  • descriptor: A render pipeline state descriptor or any type: default, tile, or mesh render pipeline descriptor.

  • pipeline: A render pipeline state containing unspecialized substate.

  • error: An optional parameter into which Metal stores information in case of an error.

  • Returns: a fully-specialized pipeline state object.

Source

fn newBinaryFunctionWithDescriptor_compilerTaskOptions_error( &self, descriptor: &MTL4BinaryFunctionDescriptor, compiler_task_options: Option<&MTL4CompilerTaskOptions>, ) -> Result<Retained<ProtocolObject<dyn MTL4BinaryFunction>>, Retained<NSError>>
where Self: Sized + Message,

Available on crate features MTL4BinaryFunction and MTL4BinaryFunctionDescriptor only.

Creates a new binary visible or intersection function synchronously.

  • Parameters:

  • descriptor: A binary function descriptor to use for creating the binary function.

  • compilerTaskOptions: A descriptor of the compilation itself, providing parameters that influence execution of the compilation process.

  • error: An optional parameter into which Metal stores information in case of an error.

  • Returns: a new binary function upon success, nil otherwise.

Source

unsafe fn newLibraryWithDescriptor_completionHandler( &self, descriptor: &MTL4LibraryDescriptor, completion_handler: MTLNewLibraryCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>>
where Self: Sized + Message,

Available on crate features MTL4CompilerTask and MTL4LibraryDescriptor and MTLLibrary and block2 only.

Creates a new Metal library instance asynchronously.

  • Parameters:

  • descriptor: A description of the library to create.

  • completionHandler: A block Metal calls when it finishes the build task.

  • Returns: a compiler task representing the asynchronous compilation task.

§Safety

completion_handler must be a valid pointer.

Source

unsafe fn newDynamicLibrary_completionHandler( &self, library: &ProtocolObject<dyn MTLLibrary>, completion_handler: MTLNewDynamicLibraryCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>>
where Self: Sized + Message,

Available on crate features MTL4CompilerTask and MTLDynamicLibrary and MTLLibrary and block2 only.

Creates a new dynamic Metal library instance asynchronously.

  • Parameters:

  • library: A library from which this compiler creates the new a dynamic library

  • completionHandler: A block Metal calls when it finishes the build task.

  • Returns: A compiler task representing the asynchronous compilation task.

§Safety

completion_handler must be a valid pointer.

Source

unsafe fn newDynamicLibraryWithURL_completionHandler( &self, url: &NSURL, completion_handler: MTLNewDynamicLibraryCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>>
where Self: Sized + Message,

Available on crate features MTL4CompilerTask and MTLDynamicLibrary and MTLLibrary and block2 only.

Creates a new dynamic library from the contents of a file at an URL location synchronously.

  • Parameters:

  • url: An URL referencing a file whose contents this compiler uses to build a dynamic library.

  • completionHandler: A block Metal calls when it finishes the build task.

  • Returns: a compiler task representing the asynchronous compilation task.

§Safety

completion_handler must be a valid pointer.

Source

unsafe fn newComputePipelineStateWithDescriptor_compilerTaskOptions_completionHandler( &self, descriptor: &MTL4ComputePipelineDescriptor, compiler_task_options: Option<&MTL4CompilerTaskOptions>, completion_handler: MTLNewComputePipelineStateCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>>
where Self: Sized + Message,

Available on crate features MTL4CompilerTask and MTL4ComputePipeline and MTL4PipelineState and MTLAllocation and MTLComputePipeline and MTLLibrary and block2 only.

Creates a new compute pipeline state asynchronously.

  • Parameters:

  • descriptor: A compute pipeline state descriptor, describing the compute pipeline to create.

  • compilerTaskOptions: A descriptor of the compilation itself, providing parameters that influence execution of the compilation process.

  • completionHandler: A block Metal calls when it finishes the build task.

  • Returns: a compiler task representing the asynchronous compilation task.

§Safety

completion_handler must be a valid pointer.

Source

unsafe fn newComputePipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_completionHandler( &self, descriptor: &MTL4ComputePipelineDescriptor, dynamic_linking_descriptor: Option<&MTL4PipelineStageDynamicLinkingDescriptor>, compiler_task_options: Option<&MTL4CompilerTaskOptions>, completion_handler: MTLNewComputePipelineStateCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>>
where Self: Sized + Message,

Available on crate features MTL4CompilerTask and MTL4ComputePipeline and MTL4LinkingDescriptor and MTL4PipelineState and MTLAllocation and MTLComputePipeline and MTLLibrary and block2 only.

Creates a new compute pipeline state asynchronously.

  • Parameters:

  • descriptor: A compute pipeline state descriptor, describing the compute pipeline to create.

  • dynamicLinkingDescriptor: An optional parameter that provides additional configuration for linking the pipeline state object.

  • compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.

  • completionHandler: A block Metal calls when it finishes the build task.

  • Returns: a compiler task representing the asynchronous compilation task.

§Safety

completion_handler must be a valid pointer.

Source

unsafe fn newRenderPipelineStateWithDescriptor_compilerTaskOptions_completionHandler( &self, descriptor: &MTL4PipelineDescriptor, compiler_task_options: Option<&MTL4CompilerTaskOptions>, completion_handler: MTLNewRenderPipelineStateCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>>
where Self: Sized + Message,

Available on crate features MTL4CompilerTask and MTL4PipelineState and MTLAllocation and MTLLibrary and MTLRenderPipeline and block2 only.

Creates a new render pipeline state asynchronously.

Use this method to build any render pipeline type, including render, tile, and mesh render pipeline states. The type of the descriptor you pass indicates the pipeline type this method builds.

Passing in a compute pipeline descriptor to the descriptor parameter produces an error.

  • Parameters:

  • descriptor: A render, tile, or mesh pipeline state descriptor that describes the pipeline to create.

  • compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.

  • completionHandler: A block Metal calls when it finishes the build task.

  • Returns: a compiler task representing the asynchronous compilation task.

§Safety

completion_handler must be a valid pointer.

Source

unsafe fn newRenderPipelineStateWithDescriptor_dynamicLinkingDescriptor_compilerTaskOptions_completionHandler( &self, descriptor: &MTL4PipelineDescriptor, dynamic_linking_descriptor: Option<&MTL4RenderPipelineDynamicLinkingDescriptor>, compiler_task_options: Option<&MTL4CompilerTaskOptions>, completion_handler: MTLNewRenderPipelineStateCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>>
where Self: Sized + Message,

Available on crate features MTL4CompilerTask and MTL4LinkingDescriptor and MTL4PipelineState and MTLAllocation and MTLLibrary and MTLRenderPipeline and block2 only.

Creates a new render pipeline state asynchronously.

Use this method to build any render pipeline type, including render, tile, and mesh render pipeline states. The type of the descriptor you pass indicates the pipeline type this method builds.

Passing in a compute pipeline descriptor to the descriptor parameter produces an error.

  • Parameters:

  • descriptor: A render, tile, or mesh pipeline state descriptor that describes the pipeline to create.

  • dynamicLinkingDescriptor: An optional parameter that provides additional configuration for linking the pipeline state object.

  • compilerTaskOptions: A description of the compilation process itself, providing parameters that influence execution of the compilation process.

  • completionHandler: A block Metal calls when it finishes the build task.

  • Returns: a compiler task representing the asynchronous compilation task.

§Safety

completion_handler must be a valid pointer.

Source

unsafe fn newRenderPipelineStateBySpecializationWithDescriptor_pipeline_completionHandler( &self, descriptor: &MTL4PipelineDescriptor, pipeline: &ProtocolObject<dyn MTLRenderPipelineState>, completion_handler: MTLNewRenderPipelineStateCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>>
where Self: Sized + Message,

Available on crate features MTL4CompilerTask and MTL4PipelineState and MTLAllocation and MTLLibrary and MTLRenderPipeline and block2 only.

Creates a new render pipeline state from another, previously unspecialized, pipeline state

Metal specializes the pipeline state with new state values the descriptor provides, observing the following rules:

  • The compiler only updates properties that were originally specified as unspecialized. It doesn’t modify other already-specialized properties
  • The compiler sets to their default behavior any unspecialized properties that your passed-in descriptor doesn’t specialize

Additionally, there are some cases where the Metal can’t specialize a pipeline:

  • If the original pipeline state object doesn’t have any unspecialized properties
  • You can’t re-specialize a previosuly specialized pipeline state object
  • Parameters:

  • descriptor: A render pipeline state descriptor or any type: default, tile, or mesh render pipeline descriptor.

  • pipeline: A render pipeline state containing unspecialized substate.

  • completionHandler: A block Metal calls when it finishes the build task.

  • Returns: a compiler task representing the asynchronous compilation task.

§Safety

completion_handler must be a valid pointer.

Source

unsafe fn newBinaryFunctionWithDescriptor_compilerTaskOptions_completionHandler( &self, descriptor: &MTL4BinaryFunctionDescriptor, compiler_task_options: Option<&MTL4CompilerTaskOptions>, completion_handler: MTL4NewBinaryFunctionCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>>
where Self: Sized + Message,

Available on crate features MTL4BinaryFunction and MTL4BinaryFunctionDescriptor and MTL4CompilerTask and block2 only.

Creates a new binary visible/intersection function asynchronously.

  • Parameters:
  • descriptor: a binary function descriptor used to create the binary function.
  • compilerTaskOptions: a descriptor of the compilation itself, providing parameters to influence execution of this compilation, but not the resulting object.
  • completionHandler: a callback used on task completion.
  • Returns: a compiler task indicating the asynchronous compilation job.
§Safety

completion_handler must be a valid pointer.

Source

fn newMachineLearningPipelineStateWithDescriptor_error( &self, descriptor: &MTL4MachineLearningPipelineDescriptor, ) -> Result<Retained<ProtocolObject<dyn MTL4MachineLearningPipelineState>>, Retained<NSError>>
where Self: Sized + Message,

Available on crate features MTL4MachineLearningPipeline and MTL4PipelineState and MTLAllocation only.

Creates a new ML pipeline state with descriptor.

  • Parameters:

  • descriptor: A machine learning pipeline state descriptor to use for creating the new pipeline state.

  • error: An optional parameter into which Metal stores information in case of an error.

  • Returns: A machine learning pipeline state if operation is successful, otherwise nil.

Source

unsafe fn newMachineLearningPipelineStateWithDescriptor_completionHandler( &self, descriptor: &MTL4MachineLearningPipelineDescriptor, completion_handler: MTL4NewMachineLearningPipelineStateCompletionHandler, ) -> Retained<ProtocolObject<dyn MTL4CompilerTask>>
where Self: Sized + Message,

Available on crate features MTL4CompilerTask and MTL4MachineLearningPipeline and MTL4PipelineState and MTLAllocation and block2 only.

Creates a new machine learning pipeline state asynchronously.

  • Parameters:

  • descriptor: A machine learning pipeline state descriptor to use for creating the new pipeline state.

  • completionHandler: A block Metal calls when it finishes the build task.

  • Returns: a compiler task representing the asynchronous compilation task.

§Safety

completion_handler must be a valid pointer.

Trait Implementations§

Source§

impl ProtocolType for dyn MTL4Compiler

Source§

const NAME: &'static str = "MTL4Compiler"

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

Implementations on Foreign Types§

Source§

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

Implementors§