diff --git a/Package.swift b/Package.swift index cd54eec..0cf2670 100644 --- a/Package.swift +++ b/Package.swift @@ -1,9 +1,9 @@ // swift-tools-version:5.3 import PackageDescription -let version = "1.19.2" -let tag = "v1.19.2" -let checksum = "335715c1664f8c2ada476c65a8b35715ee29e36ee19ec3388bd517750fd1fe4f" +let version = "1.21.1" +let tag = "v1.21.1" +let checksum = "5cd765a356fefb457aa2192545fa67c09c37a2d4b42cafb8b5628aa9a20bd5bd" let url = "https://github.com/OpenEmu/OpenEmu-Shaders/releases/download/\(tag)/OpenEmuShaders-\(version).xcframework.zip" let package = Package( diff --git a/Source/MTLPixelConverter.swift b/Source/MTLPixelConverter.swift index 96eec11..db91ff2 100644 --- a/Source/MTLPixelConverter.swift +++ b/Source/MTLPixelConverter.swift @@ -111,10 +111,10 @@ public class MTLPixelConverter: NSObject { ] @objc - public init(device: MTLDevice, library: MTLLibrary) throws { + public init(device: MTLDevice) throws { self.device = device let bundle = Bundle(for: type(of: self)) - self.library = try device.makeDefaultLibrary(bundle: bundle) + library = try device.makeDefaultLibrary(bundle: bundle) var texToTex = [TextureConverter?](repeating: nil, count: Int(OEMTLPixelFormat.count.rawValue)) var bufToTex = [BufferConverter?](repeating: nil, count: Int(OEMTLPixelFormat.count.rawValue)) @@ -152,6 +152,11 @@ public class MTLPixelConverter: NSObject { return bufToTex[Int(sourceFormat.rawValue)] } + @objc + public func textureConverter(withFormat sourceFormat: OEMTLPixelFormat) -> TextureConverter? { + return texToTex[Int(sourceFormat.rawValue)] + } + @objc public func convert(fromTexture src: MTLTexture, sourceFormat: OEMTLPixelFormat, toTexture dst: MTLTexture, commandBuffer: MTLCommandBuffer) { guard let filter = texToTex[Int(sourceFormat.rawValue)] else { diff --git a/Source/OEFilterChain.m b/Source/OEFilterChain.m index 9689dfa..869bc0f 100644 --- a/Source/OEFilterChain.m +++ b/Source/OEFilterChain.m @@ -163,9 +163,7 @@ - (instancetype)initWithDevice:(id)device } assert(err == nil); _loader = [[MTKTextureLoader alloc] initWithDevice:device]; - _converter = [[MTLPixelConverter alloc] initWithDevice:_device - library:_library - error:&err]; + _converter = [[MTLPixelConverter alloc] initWithDevice:_device error:&err]; if (err != nil) { os_log_error(OE_LOG_DEFAULT, "error initializing pixel converter: %{public}@", err.localizedDescription); }