Skip to content

Commit

Permalink
chore: Version 1.21.1
Browse files Browse the repository at this point in the history
  • Loading branch information
stuartcarnie committed May 18, 2022
1 parent c1ef44b commit aff4575
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
6 changes: 3 additions & 3 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -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(
Expand Down
9 changes: 7 additions & 2 deletions Source/MTLPixelConverter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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 {
Expand Down
4 changes: 1 addition & 3 deletions Source/OEFilterChain.m
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ - (instancetype)initWithDevice:(id<MTLDevice>)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);
}
Expand Down

0 comments on commit aff4575

Please sign in to comment.