         }
         
         let orientation: CGImagePropertyOrientation = .downMirrored
+        
         self.setupPixelBufferPoolIfNecessary(pixelBuffer, orientation: orientation)
-        if let pixelBufferPool = self._pixelBufferPool, let texture = self._texture {
-            if let pixelBufferOutput = self.createPixelBufferOutput(withPixelBuffer: pixelBuffer,
-                                                                    orientation: orientation,
-                                                                    pixelBufferPool: pixelBufferPool,
-                                                                    texture: texture) {
+        if let pixelBufferPool = self._pixelBufferPool {
+            if let pixelBufferOutput = self._ciContext?.createPixelBuffer(withTexture: texture, withOrientation: orientation, pixelBufferPool: pixelBufferPool) {
                 self._videoBufferOutput = pixelBufferOutput
             }
         }

@available(iOS 11.0, *)
extension NextLevelBufferRenderer {
    
    private func createPixelBufferOutput(withPixelBuffer pixelBuffer: CVPixelBuffer,
                                         orientation: CGImagePropertyOrientation,
                                         pixelBufferPool: CVPixelBufferPool,
                                         texture: MTLTexture) -> CVPixelBuffer? {
        // allocate a pixel buffer and render into it
        var updatedPixelBuffer: CVPixelBuffer? = nil
        if CVPixelBufferPoolCreatePixelBuffer(kCFAllocatorDefault, pixelBufferPool, &updatedPixelBuffer) == kCVReturnSuccess {
            if let updatedPixelBuffer = updatedPixelBuffer {
                // update orientation to match Metal's origin
                let ciImage = CIImage(mtlTexture: texture, options: nil)
                if let orientedImage = ciImage?.oriented(orientation) {
                    CVPixelBufferLockBaseAddress(updatedPixelBuffer, CVPixelBufferLockFlags(rawValue: 0))
                    self._ciContext?.render(orientedImage, to: updatedPixelBuffer)
                    CVPixelBufferUnlockBaseAddress(updatedPixelBuffer, CVPixelBufferLockFlags(rawValue: 0))
                    return updatedPixelBuffer
                }
            }
        }
        return nil
    }
    
    #if USE_ARKIT
    
    /// SCNSceneRendererDelegate hook for rendering

@available(iOS 11.0, *)
extension NextLevelBufferRenderer {
    
    fileprivate func setupContextIfNecessary() {
        guard self._ciContext == nil else {
            return
        }
