         }
 
         let device = renderer.device
-        let pixelFormat = preferredPixelFormat(on: device)
+        let pixelFormat = preferredPixelFormat
 
         let descriptor = MTLTextureDescriptor.texture2DDescriptor(pixelFormat: pixelFormat, width: width, height: height, mipmapped: true)
         playerTexture = device.makeTexture(descriptor: descriptor)

        }

        let device = renderer.device
        let pixelFormat = preferredPixelFormat(on: device)

        let playerTextureDescriptor = MTLTextureDescriptor.texture2DDescriptor(pixelFormat: pixelFormat, width: width, height: height, mipmapped: true)
        playerTexture = device.makeTexture(descriptor: playerTextureDescriptor)

        self.init(renderer: renderer)
    }

    fileprivate var preferredPixelFormat: MTLPixelFormat {
        if #available(iOS 10, *) {
            return .bgra8Unorm_srgb
        } else {
            return .bgra8Unorm
