I am adding a UIView to a MTKView and animating the UIView in the DRAW delegate method of the MTKViewDelegate.
Will this animation be handled by the GPU / Metal? Should the animation be smoother or the same as if I were using UIView.animate?
func draw(in view: MTKView) {
let newdescriptor = self.metalview.currentRenderPassDescriptor
let commandbuffer = self.metalqueue.makeCommandBuffer()
let commandencoder = commandbuffer?.makeRenderCommandEncoder(descriptor: newdescriptor!)
// //////////////////////////// //
timer += 0.01
var currenttime = sin(timer)
uiviewbox.transform = CGAffineTransform(rotationAngle: CGFloat(sin(timer)))
// //////////////////////////// //
commandencoder?.endEncoding()
let thedrawable = self.metalview.currentDrawable
commandbuffer?.present(thedrawable!)
commandbuffer?.commit()
}