newRenderPipelineStateBySpecializationWithDescriptor:pipeline:error:
Creates a new render pipeline state from another, previously unspecialized, pipeline state.
Declaration
- (id<MTLRenderPipelineState>) newRenderPipelineStateBySpecializationWithDescriptor:(MTL4PipelineDescriptor *) descriptor pipeline:(id<MTLRenderPipelineState>) pipeline error:(NSError **) error;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.
Return Value
A fully-specialized pipeline state object.
Discussion
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