     
     var reader:AVAssetReader?
     var output:AVAssetReaderTrackOutput?
+    var texture:MTLTexture?
+    lazy var commandQueue:MTLCommandQueue = self.context.device.makeCommandQueue()
 
     lazy var renderer:VSRenderer = VSRenderer(device:self.context.device, pixelFormat:self.context.pixelFormat)
     fileprivate lazy var textureCache:CVMetalTextureCache = {

            if let metalTexture = metalTexture, status == kCVReturnSuccess {
                DispatchQueue.main.async {
                    self.context.set(sourceImage: metalTexture)
                }
            } else {
                print("VSVS: failed to create texture")

    public func mtkView(_ view: MTKView, drawableSizeWillChange size: CGSize) {}
    
    public func draw(in view: MTKView) {
        if let texture = self.texture {
            renderer.encode(commandBuffer:commandQueue.makeCommandBuffer(), view:view, texture: texture)?.commit()
        }
    }
}
