Skip to content

Commit aec4ef7

Browse files
committed
資源釋放調整
Metal仍處於不可用 有可能SDK功能Metal管線有問題?
1 parent 731bbda commit aec4ef7

19 files changed

+2172
-118
lines changed

Frameworks/ParsecSDK.framework

Submodule ParsecSDK.framework deleted from bb33669

Frameworks/ParsecSDK.framework/Headers/parsec.h

Lines changed: 1568 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleName</key>
6+
<string>ParsecSDK</string>
7+
<key>DTXcode</key>
8+
<string>1020</string>
9+
<key>DTSDKBuild</key>
10+
<string>16E226</string>
11+
<key>CFBundleDevelopmentRegion</key>
12+
<string>en</string>
13+
<key>CFBundleVersion</key>
14+
<string>1</string>
15+
<key>BuildMachineOSBuild</key>
16+
<string>18E226</string>
17+
<key>CFBundlePackageType</key>
18+
<string>FMWK</string>
19+
<key>CFBundleShortVersionString</key>
20+
<string>1.0</string>
21+
<key>CFBundleSupportedPlatforms</key>
22+
<array>
23+
<string>iPhoneOS</string>
24+
</array>
25+
<key>CFBundleInfoDictionaryVersion</key>
26+
<string>6.0</string>
27+
<key>CFBundleExecutable</key>
28+
<string>ParsecSDK</string>
29+
<key>DTCompiler</key>
30+
<string>com.apple.compilers.llvm.clang.1_0</string>
31+
<key>UIRequiredDeviceCapabilities</key>
32+
<array>
33+
<string>arm64</string>
34+
</array>
35+
<key>MinimumOSVersion</key>
36+
<string>9.3</string>
37+
<key>CFBundleIdentifier</key>
38+
<string>PSC.ParsecSDK</string>
39+
<key>UIDeviceFamily</key>
40+
<array>
41+
<integer>1</integer>
42+
<integer>2</integer>
43+
</array>
44+
<key>DTPlatformVersion</key>
45+
<string>12.2</string>
46+
<key>DTXcodeBuild</key>
47+
<string>10E125</string>
48+
</dict>
49+
</plist>
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
framework module ParsecSDK {
2+
umbrella header "parsec.h"
3+
4+
export *
5+
module * { export * }
6+
}
7+
5.41 MB
Binary file not shown.

OpenParsec.xcodeproj/project.pbxproj

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@
2626
27B23A222B1B979C00B52F14 /* ParsecMetalRenderer.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B23A212B1B979C00B52F14 /* ParsecMetalRenderer.swift */; };
2727
27B23A242B1B98EF00B52F14 /* ParsecMetalViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B23A232B1B98EF00B52F14 /* ParsecMetalViewController.swift */; };
2828
27B8D564292DC7A000A324AD /* CParsec.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27B8D563292DC7A000A324AD /* CParsec.swift */; };
29-
27B8D571292DCA5B00A324AD /* ParsecSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 27B8D56F292DCA5800A324AD /* ParsecSDK.framework */; settings = {ATTRIBUTES = (Required, ); }; };
30-
27B8D572292DCA5B00A324AD /* ParsecSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 27B8D56F292DCA5800A324AD /* ParsecSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
3129
27E61A92292965FC00FF6563 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E61A91292965FC00FF6563 /* AppDelegate.swift */; };
3230
27E61A94292965FC00FF6563 /* SceneDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E61A93292965FC00FF6563 /* SceneDelegate.swift */; };
3331
27E61A96292965FC00FF6563 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 27E61A95292965FC00FF6563 /* ContentView.swift */; };
@@ -41,6 +39,9 @@
4139
84480EBE2ADC4FDA007DE5F1 /* GameController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 84480EBD2ADC4FDA007DE5F1 /* GameController.swift */; };
4240
CE02CB082F14482F003714A3 /* shader.metal in Sources */ = {isa = PBXBuildFile; fileRef = CE02CB072F144824003714A3 /* shader.metal */; };
4341
CE02CB0A2F14C95C003714A3 /* RenderCenter.swift in Sources */ = {isa = PBXBuildFile; fileRef = CE02CB092F14C955003714A3 /* RenderCenter.swift */; };
42+
CEC7D21E2F16AC0F006FBF99 /* Metal.m in Sources */ = {isa = PBXBuildFile; fileRef = CEC7D21D2F16AC0B006FBF99 /* Metal.m */; };
43+
CEC7D2292F16D045006FBF99 /* ParsecSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CEC7D2282F16D045006FBF99 /* ParsecSDK.framework */; };
44+
CEC7D22A2F16D0B1006FBF99 /* ParsecSDK.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = CEC7D2282F16D045006FBF99 /* ParsecSDK.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
4445
FC16A7AD29A97BDA00BB70A7 /* Shared.swift in Sources */ = {isa = PBXBuildFile; fileRef = FC16A7AC29A97BDA00BB70A7 /* Shared.swift */; };
4546
/* End PBXBuildFile section */
4647

@@ -51,7 +52,7 @@
5152
dstPath = "";
5253
dstSubfolderSpec = 10;
5354
files = (
54-
27B8D572292DCA5B00A324AD /* ParsecSDK.framework in Embed Frameworks */,
55+
CEC7D22A2F16D0B1006FBF99 /* ParsecSDK.framework in Embed Frameworks */,
5556
);
5657
name = "Embed Frameworks";
5758
runOnlyForDeploymentPostprocessing = 0;
@@ -80,7 +81,6 @@
8081
27B23A212B1B979C00B52F14 /* ParsecMetalRenderer.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParsecMetalRenderer.swift; sourceTree = "<group>"; };
8182
27B23A232B1B98EF00B52F14 /* ParsecMetalViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ParsecMetalViewController.swift; sourceTree = "<group>"; };
8283
27B8D563292DC7A000A324AD /* CParsec.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CParsec.swift; sourceTree = "<group>"; };
83-
27B8D56F292DCA5800A324AD /* ParsecSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ParsecSDK.framework; path = Frameworks/ParsecSDK.framework; sourceTree = SOURCE_ROOT; };
8484
27E61A8E292965FC00FF6563 /* OpenParsec.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = OpenParsec.app; sourceTree = BUILT_PRODUCTS_DIR; };
8585
27E61A91292965FC00FF6563 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
8686
27E61A93292965FC00FF6563 /* SceneDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SceneDelegate.swift; sourceTree = "<group>"; };
@@ -96,6 +96,9 @@
9696
84480EBD2ADC4FDA007DE5F1 /* GameController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GameController.swift; sourceTree = "<group>"; };
9797
CE02CB072F144824003714A3 /* shader.metal */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.metal; path = shader.metal; sourceTree = "<group>"; };
9898
CE02CB092F14C955003714A3 /* RenderCenter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RenderCenter.swift; sourceTree = "<group>"; };
99+
CEC7D21C2F16ABEC006FBF99 /* Metal.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Metal.h; sourceTree = "<group>"; };
100+
CEC7D21D2F16AC0B006FBF99 /* Metal.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Metal.m; sourceTree = "<group>"; };
101+
CEC7D2282F16D045006FBF99 /* ParsecSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = ParsecSDK.framework; path = "/Users/user/Downloads/parsec-sdk-6.0/sdk/ios/ParsecSDK.framework"; sourceTree = "<absolute>"; };
99102
FC16A7AC29A97BDA00BB70A7 /* Shared.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Shared.swift; sourceTree = "<group>"; };
100103
/* End PBXFileReference section */
101104

@@ -104,7 +107,7 @@
104107
isa = PBXFrameworksBuildPhase;
105108
buildActionMask = 2147483647;
106109
files = (
107-
27B8D571292DCA5B00A324AD /* ParsecSDK.framework in Frameworks */,
110+
CEC7D2292F16D045006FBF99 /* ParsecSDK.framework in Frameworks */,
108111
);
109112
runOnlyForDeploymentPostprocessing = 0;
110113
};
@@ -114,7 +117,7 @@
114117
27B8D56A292DC98B00A324AD /* Frameworks */ = {
115118
isa = PBXGroup;
116119
children = (
117-
27B8D56F292DCA5800A324AD /* ParsecSDK.framework */,
120+
CEC7D2282F16D045006FBF99 /* ParsecSDK.framework */,
118121
);
119122
path = Frameworks;
120123
sourceTree = "<group>";
@@ -147,6 +150,8 @@
147150
27E61A97292965FD00FF6563 /* Assets.xcassets */,
148151
27899AC5292FE2A9001ACA33 /* audio.c */,
149152
27899AC6292FE2A9001ACA33 /* audio.h */,
153+
CEC7D21C2F16ABEC006FBF99 /* Metal.h */,
154+
CEC7D21D2F16AC0B006FBF99 /* Metal.m */,
150155
27E61A95292965FC00FF6563 /* ContentView.swift */,
151156
27B8D563292DC7A000A324AD /* CParsec.swift */,
152157
27AD365F2B19731800C8A607 /* ExUI.swift */,
@@ -280,6 +285,7 @@
280285
27E61A94292965FC00FF6563 /* SceneDelegate.swift in Sources */,
281286
27A267352B1AEAB700F34C63 /* SettingsHandler.swift in Sources */,
282287
27AD36602B19731800C8A607 /* ExUI.swift in Sources */,
288+
CEC7D21E2F16AC0F006FBF99 /* Metal.m in Sources */,
283289
27899AC7292FE2A9001ACA33 /* audio.c in Sources */,
284290
27E61AA62929817700FF6563 /* LoginView.swift in Sources */,
285291
27B8D564292DC7A000A324AD /* CParsec.swift in Sources */,

OpenParsec.xcodeproj/xcshareddata/xcschemes/OpenParsec.xcscheme

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@
3939
ignoresPersistentStateOnLaunch = "NO"
4040
debugDocumentVersioning = "YES"
4141
debugServiceExtension = "internal"
42-
enableGPUValidationMode = "1"
42+
showGraphicsOverview = "Yes"
43+
logGraphicsOverview = "Yes"
4344
allowLocationSimulation = "YES">
4445
<BuildableProductRunnable
4546
runnableDebuggingMode = "0">

OpenParsec/AppDelegate.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate
66
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions:[UIApplication.LaunchOptionsKey: Any]?) -> Bool
77
{
88
// Override point for customization after application launch.
9-
UTMViewControllerPatches.patchAll()
9+
//UTMViewControllerPatches.patchAll()
1010
return true
1111
}
1212

@@ -26,6 +26,6 @@ class AppDelegate: UIResponder, UIApplicationDelegate
2626

2727
func applicationWillTerminate(_ application: UIApplication)
2828
{
29-
CParsec.destroy()
29+
//CParsec.destroy()
3030
}
3131
}

OpenParsec/CParsec.swift

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,19 @@ protocol ParsecService {
141141

142142
func connect(_ peerID: String) -> ParsecStatus
143143
func disconnect()
144+
145+
func destroy()
146+
147+
func getOutputs(maxCount: Int) -> [ParsecDecoder]
148+
144149
func getStatus() -> ParsecStatus
145150
func getStatusEx(_ pcs: inout ParsecClientStatus) -> ParsecStatus
146151
func setFrame(_ width: CGFloat, _ height: CGFloat, _ scale: CGFloat)
147152
func renderGLFrame(timeout: UInt32)
148153

149154
// Metal
150155
func renderMetalFrame(queue:MTLCommandQueue,
151-
texture: MTLTexture, preRender: ParsecPreRenderCallback?,opaque: UnsafeMutableRawPointer? ,timeout: UInt32) -> ParsecStatus
156+
texture:MTLTexture ,timeout: UInt32) -> ParsecStatus
152157

153158

154159
func setMuted(_ muted: Bool)
@@ -188,7 +193,6 @@ class CParsec
188193
return parsecImpl.mouseInfo
189194
}
190195

191-
192196

193197
static var parsecImpl: ParsecService!
194198

@@ -199,7 +203,7 @@ class CParsec
199203

200204
static func destroy()
201205
{
202-
206+
parsecImpl.destroy()
203207
}
204208

205209
static func connect(_ peerID: String) -> ParsecStatus
@@ -212,6 +216,11 @@ class CParsec
212216
parsecImpl.disconnect()
213217
}
214218

219+
static func getOutput(maxCount: Int) -> [ParsecDecoder]
220+
{
221+
return parsecImpl.getOutputs(maxCount: maxCount)
222+
}
223+
215224
static func getStatus() -> ParsecStatus
216225
{
217226
return parsecImpl.getStatus()
@@ -233,10 +242,9 @@ class CParsec
233242
}
234243

235244
static func renderMetalFrame(
236-
queue:MTLCommandQueue,
237-
texture: MTLTexture,
238-
preRender: ParsecPreRenderCallback? = nil,
239-
opaque: UnsafeMutableRawPointer? = nil,
245+
queue: MTLCommandQueue,
246+
texture:MTLTexture,
247+
240248
timeout: UInt32 = 16
241249
) -> ParsecStatus {
242250

@@ -245,7 +253,6 @@ class CParsec
245253
.renderMetalFrame(
246254
queue:queue,
247255
texture:texture,
248-
preRender:preRender, opaque: opaque,
249256
timeout: timeout
250257
)
251258
}

OpenParsec/MainView.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,8 @@ struct MainView: View
588588

589589
var status = CParsec.connect(who.id)
590590

591+
592+
591593
// 初始化 ParsecRenderCenter (如果尚未初始化)
592594
ParsecRenderCenter.shared.start()
593595

0 commit comments

Comments
 (0)