setComputePipelineState(_:)
Configures the compute encoder with a pipeline state for subsequent kernel calls.
Declaration
func setComputePipelineState(_ state: any MTLComputePipelineState)Parameters
- state:
An Mtlcomputepipelinestate instance.
Discussion
Create your pipeline state through one of the MTLDevice methods in Creating Compute Pipeline States.
A compute pipeline state provides information Metal uses to compile and run encoded commands. You can change the pipeline state at any time, allowing you to encode multiple kernel calls in a single command buffer. Changing the pipeline state doesn’t affect any previously encoded commands.