     /// A type representing a core image context using the real-time rendering with Metal.
     fileprivate struct _MetalBasedCIContext {
         lazy var context: CIContext! = { () -> CIContext! in
-            guard let device = MTLCreateSystemDefaultDevice() else { return nil }
+            guard let device = MTLCreateSystemDefaultDevice() else { return _openGLESCIContext.context }
             return CIContext(mtlDevice: device)
         }()
     }

    }
}

private var _autoCIContext    = UIImage._AutomaticCIContext()
private var _metalCIContext   = UIImage._MetalBasedCIContext()
private var _openGLESCIContex = UIImage._OpenGLESBasedCIContext()

/// Get the context of core image with the given render destination.
private func _ciContext(of dest: UIImage.RenderDestination) -> CIContext! {

        case .metal:
            return _metalCIContext.context
        case .openGLES:
            return _openGLESCIContext.context
        }
    default: return nil
    }
