addRenderContext()
Adds and returns a render context to a LayerRenderer.Drawable that draws any content required by the compositor.
Declaration
func addRenderContext() -> LayerRenderer.Drawable.RenderContextDiscussion
Call renderContext.drawMaskOnStencilAttachment(self:commandEncoder:value:) on the returned LayerRenderer.Drawable.RenderContext to render only the necessary pixels. You can only use the LayerRenderer.Drawable.RenderContext API in the context of layered layout rendering or on platforms that only render one view, such as the Simulator. The RenderContext uses the deviceAnchor set in cp_drawable_set_device_anchor. Set the deviceAnchor in the layer renderer drawable before calling addRenderContext(commandBuffer:).