MTLRender protocol is used to define the interface for objects that encode graphics rendering state and commands into a command buffer. Your app does not define classes that implement this protocol.
- iOS 8.0+
- macOS 10.11+
- tvOS 8.0+
To perform a rendering pass with a render command encoder:
MTLRenderobject by calling the
makemethod of the
Render Command Encoder(descriptor:)
MTLCommandobject in which you want to encode rendering commands. Do not use standard allocation and initialization techniques to create a
MTLRenderobject. The render command encoder represents a single rendering pass into a specific attachment. Typically, you create a
MTLRenderobject once to describe the attachment and then use it repeatedly as the destination for rendering commands for as many rendering passes as needed.
Pass Attachment Descriptor
setmethod to specify a
Render Pipeline State(_:)
MTLRenderthat defines the state of the graphics rendering pipeline, including vertex and fragment functions. You usually create this
MTLRenderinfrequently—for example, when your app is initialized. When you create a
MTLRender, you have the option to obtain reflection data in
MTLRenderthat reveals details of the vertex and fragment functions and their arguments. Only obtain reflection data if you need it.
Specify resources for input to and output from the vertex and fragment functions. Set the location (index) of each resource in its corresponding argument table.
Specify additional fixed-function state, such as viewport, scissor rectangle, depth test, and stencil test settings.
Draw graphics primitives.
endmethod to terminate the render command encoder.
To render a number of instances of tessellated patches, call any method in the Drawing Tessellated Patches section. These methods can only be called if the vertex function is a post-tessellation vertex function; conversely, you cannot call any method in the Drawing Geometric Primitives section.