An object that contains the graphics functions and configuration state used in a render pass.
- iOS 8.0+
- macOS 10.11+
- UIKit for Mac 13.0+Beta
- tvOS 9.0+
MTLRender protocol defines the interface for a lightweight object used to encode the state for a configured graphics rendering pipeline.
MTLRender to encode commands for a rendering pass, specify a
MTLRender object that defines the graphics state, including vertex and fragment shader functions, before issuing any draw calls. Because creating a pipeline state object can require an expensive evaluation of graphics state and a possible compilation of the specified graphics shader functions, you usually create these pipeline state objects early in the development of your app and reuse them throughout its lifetime.
Do not use standard allocation and initialization techniques to create a
MTLRender object. To create a
MTLRender object, first create a
MTLRender object that describes the desired state of the pipeline. Then call one of these
Call either the
Render Pipeline State With Descriptor: error:
newmethod to synchronously create a
Render Pipeline State With Descriptor: options: reflection: error:
MTLRenderobject and compile the graphics state, including graphics shader code.
Call either the
Render Pipeline State With Descriptor: completion Handler:
newmethod to asynchronously create a
Render Pipeline State With Descriptor: options: completion Handler:
MTLRenderobject and compile the graphics state, including graphics shader code. The completion handler is the last operation executed during creation of the pipeline state object.
new methods of
MTLDevice also obtain reflection data in a
MTLRender object that reveals details of the arguments of the vertex and fragment functions. (In
new, the reflection data is returned in the completion handler.) Obtain reflection data only if it will be used.