metalDisplayLink(_:needsUpdate:)
A method the system calls to notify your app when it plans to update the display.
Declaration
func metalDisplayLink(_ link: CAMetalDisplayLink, needsUpdate update: CAMetalDisplayLink.Update)Parameters
- link:
A Metal display link instance the system notifies.
- update:
An update instance that contains the time the system intends to update the display, a Cametaldrawable instance, and a deadline to call its Present() method.
Discussion
In this method’s implementation, perform your app’s rendering on the layer or texture of the update instance’s drawable property. Before calling present(), encode all your Metal commands to the link parameter’s MTLDevice. The GPU has additional time to complete running your commands before the frame displays on screen, determined by the value of the link parameter’s preferredFrameLatency property.