diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index a6a53820..9783673d 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -28,18 +28,6 @@ dependencies = [ "cpufeatures", ] -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.3" @@ -64,12 +52,6 @@ dependencies = [ "alloc-no-stdlib", ] -[[package]] -name = "allocator-api2" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" - [[package]] name = "android-tzdata" version = "0.1.1" @@ -119,27 +101,12 @@ dependencies = [ "x11rb", ] -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - [[package]] name = "ascii" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d92bec98840b8f03a5ff5413de5293bfcd8bf96467cf5452609f939ec6f5de16" -[[package]] -name = "ash" -version = "0.38.0+1.3.281" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" -dependencies = [ - "libloading", -] - [[package]] name = "async-broadcast" version = "0.7.1" @@ -352,21 +319,6 @@ version = "0.22.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" -[[package]] -name = "bit-set" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0481a0e032742109b1133a095184ee93d88f3dc9e0d28a5d033dc77a073f44f" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2c54ff287cfc0a34f38a6b832ea1bd8e448a330b3e40a50859e6488bee07f22" - [[package]] name = "bitflags" version = "1.3.2" @@ -689,16 +641,6 @@ dependencies = [ "objc", ] -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - [[package]] name = "color_quant" version = "1.1.0" @@ -716,37 +658,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "com" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" -dependencies = [ - "com_macros", -] - -[[package]] -name = "com_macros" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" -dependencies = [ - "com_macros_support", - "proc-macro2", - "syn 1.0.109", -] - -[[package]] -name = "com_macros_support" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "combine" version = "4.6.7" @@ -945,17 +856,6 @@ dependencies = [ "syn 2.0.79", ] -[[package]] -name = "d3d12" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdbd1f579714e3c809ebd822c81ef148b1ceaeb3d535352afc73fd0c4c6a0017" -dependencies = [ - "bitflags 2.6.0", - "libloading", - "winapi", -] - [[package]] name = "darling" version = "0.20.10" @@ -1130,15 +1030,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "document-features" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" -dependencies = [ - "litrs", -] - [[package]] name = "downcast-rs" version = "1.2.1" @@ -1689,17 +1580,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "gl_generator" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" -dependencies = [ - "khronos_api", - "log", - "xml-rs", -] - [[package]] name = "glib" version = "0.15.12" @@ -1764,27 +1644,6 @@ dependencies = [ "regex-syntax 0.8.5", ] -[[package]] -name = "glow" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" -dependencies = [ - "js-sys", - "slotmap", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "glutin_wgl_sys" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e1951bbd9434a81aa496fe59ccc2235af3820d27b85f9314e279609211e2c" -dependencies = [ - "gl_generator", -] - [[package]] name = "gobject-sys" version = "0.15.10" @@ -1796,58 +1655,6 @@ dependencies = [ "system-deps 6.2.2", ] -[[package]] -name = "gpu-alloc" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" -dependencies = [ - "bitflags 2.6.0", - "gpu-alloc-types", -] - -[[package]] -name = "gpu-alloc-types" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" -dependencies = [ - "bitflags 2.6.0", -] - -[[package]] -name = "gpu-allocator" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd4240fc91d3433d5e5b0fc5b67672d771850dc19bbee03c1381e19322803d7" -dependencies = [ - "log", - "presser", - "thiserror", - "winapi", - "windows 0.52.0", -] - -[[package]] -name = "gpu-descriptor" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c08c1f623a8d0b722b8b99f821eb0ba672a1618f0d3b16ddbee1cedd2dd8557" -dependencies = [ - "bitflags 2.6.0", - "gpu-descriptor-types", - "hashbrown 0.14.5", -] - -[[package]] -name = "gpu-descriptor-types" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" -dependencies = [ - "bitflags 2.6.0", -] - [[package]] name = "gtk" version = "0.15.5" @@ -1947,37 +1754,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash", - "allocator-api2", -] - [[package]] name = "hashbrown" version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" -[[package]] -name = "hassle-rs" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" -dependencies = [ - "bitflags 2.6.0", - "com", - "libc", - "libloading", - "thiserror", - "widestring", - "winapi", -] - [[package]] name = "heck" version = "0.3.3" @@ -2017,12 +1799,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hexf-parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" - [[package]] name = "hmac" version = "0.12.1" @@ -2505,23 +2281,6 @@ dependencies = [ "serde_json", ] -[[package]] -name = "khronos-egl" -version = "6.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" -dependencies = [ - "libc", - "libloading", - "pkg-config", -] - -[[package]] -name = "khronos_api" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" - [[package]] name = "kuchikiki" version = "0.8.2" @@ -2584,12 +2343,6 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" -[[package]] -name = "litrs" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" - [[package]] name = "lock_api" version = "0.4.12" @@ -2718,21 +2471,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "metal" -version = "0.29.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" -dependencies = [ - "bitflags 2.6.0", - "block", - "core-graphics-types", - "foreign-types 0.5.0", - "log", - "objc", - "paste", -] - [[package]] name = "mime" version = "0.3.17" @@ -2767,27 +2505,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "naga" -version = "22.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bd5a652b6faf21496f2cfd88fc49989c8db0825d1f6746b1a71a6ede24a63ad" -dependencies = [ - "arrayvec", - "bit-set", - "bitflags 2.6.0", - "cfg_aliases 0.1.1", - "codespan-reporting", - "hexf-parse", - "indexmap 2.6.0", - "log", - "rustc-hash", - "spirv", - "termcolor", - "thiserror", - "unicode-xid", -] - [[package]] name = "native-dialog" version = "0.7.0" @@ -2803,7 +2520,7 @@ dependencies = [ "objc-foundation", "objc_id", "once_cell", - "raw-window-handle 0.5.2", + "raw-window-handle", "thiserror", "versions", "wfd", @@ -2836,7 +2553,7 @@ checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" dependencies = [ "bitflags 1.3.2", "jni-sys", - "ndk-sys 0.3.0", + "ndk-sys", "num_enum", "thiserror", ] @@ -2856,15 +2573,6 @@ dependencies = [ "jni-sys", ] -[[package]] -name = "ndk-sys" -version = "0.5.0+25.2.9519653" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" -dependencies = [ - "jni-sys", -] - [[package]] name = "new_debug_unreachable" version = "1.0.6" @@ -3186,7 +2894,6 @@ dependencies = [ "tokio-util", "ts-rs", "walkdir", - "wgpu", "winreg 0.52.0", "zip", "zip-extract", @@ -3333,12 +3040,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - [[package]] name = "pathdiff" version = "0.2.2" @@ -3596,12 +3297,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" -[[package]] -name = "presser" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" - [[package]] name = "proc-macro-crate" version = "1.3.1" @@ -3660,12 +3355,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "profiling" -version = "1.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afbdc74edc00b6f6a218ca6a5364d6226a259d4b8ea1af4a0ea063f27e179f4d" - [[package]] name = "quick-xml" version = "0.31.0" @@ -3783,24 +3472,12 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "range-alloc" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" - [[package]] name = "raw-window-handle" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" -[[package]] -name = "raw-window-handle" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" - [[package]] name = "rayon" version = "1.10.0" @@ -3885,12 +3562,6 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" -[[package]] -name = "renderdoc-sys" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" - [[package]] name = "reqwest" version = "0.11.27" @@ -4002,7 +3673,7 @@ dependencies = [ "objc", "objc-foundation", "objc_id", - "raw-window-handle 0.5.2", + "raw-window-handle", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -4030,12 +3701,6 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rustc-serialize" version = "0.3.25" @@ -4410,15 +4075,6 @@ dependencies = [ "autocfg", ] -[[package]] -name = "slotmap" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbff4acf519f630b3a3ddcfaea6c06b42174d9a44bc70c620e9ed1649d58b82a" -dependencies = [ - "version_check", -] - [[package]] name = "smallvec" version = "1.13.2" @@ -4469,15 +4125,6 @@ version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" -[[package]] -name = "spirv" -version = "0.3.0+sdk-1.3.268.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" -dependencies = [ - "bitflags 2.6.0", -] - [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -4696,12 +4343,12 @@ dependencies = [ "log", "ndk", "ndk-context", - "ndk-sys 0.3.0", + "ndk-sys", "objc", "once_cell", "parking_lot", "png", - "raw-window-handle 0.5.2", + "raw-window-handle", "scopeguard", "serde", "tao-macros", @@ -4774,7 +4421,7 @@ dependencies = [ "percent-encoding", "plist", "rand 0.8.5", - "raw-window-handle 0.5.2", + "raw-window-handle", "regex", "reqwest 0.11.27", "rfd", @@ -4870,7 +4517,7 @@ dependencies = [ "http 0.2.12", "http-range", "rand 0.8.5", - "raw-window-handle 0.5.2", + "raw-window-handle", "serde", "serde_json", "tauri-utils", @@ -4892,7 +4539,7 @@ dependencies = [ "gtk", "percent-encoding", "rand 0.8.5", - "raw-window-handle 0.5.2", + "raw-window-handle", "tauri-runtime", "tauri-utils", "uuid", @@ -5364,18 +5011,6 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" -[[package]] -name = "unicode-width" -version = "0.1.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" - -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - [[package]] name = "untrusted" version = "0.9.0" @@ -5764,112 +5399,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "wgpu" -version = "22.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d1c4ba43f80542cf63a0a6ed3134629ae73e8ab51e4b765a67f3aa062eb433" -dependencies = [ - "arrayvec", - "cfg_aliases 0.1.1", - "document-features", - "js-sys", - "log", - "naga", - "parking_lot", - "profiling", - "raw-window-handle 0.6.2", - "smallvec", - "static_assertions", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "wgpu-core", - "wgpu-hal", - "wgpu-types", -] - -[[package]] -name = "wgpu-core" -version = "22.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0348c840d1051b8e86c3bcd31206080c5e71e5933dabd79be1ce732b0b2f089a" -dependencies = [ - "arrayvec", - "bit-vec", - "bitflags 2.6.0", - "cfg_aliases 0.1.1", - "document-features", - "indexmap 2.6.0", - "log", - "naga", - "once_cell", - "parking_lot", - "profiling", - "raw-window-handle 0.6.2", - "rustc-hash", - "smallvec", - "thiserror", - "wgpu-hal", - "wgpu-types", -] - -[[package]] -name = "wgpu-hal" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bbf4b4de8b2a83c0401d9e5ae0080a2792055f25859a02bf9be97952bbed4f" -dependencies = [ - "android_system_properties", - "arrayvec", - "ash", - "bit-set", - "bitflags 2.6.0", - "block", - "cfg_aliases 0.1.1", - "core-graphics-types", - "d3d12", - "glow", - "glutin_wgl_sys", - "gpu-alloc", - "gpu-allocator", - "gpu-descriptor", - "hassle-rs", - "js-sys", - "khronos-egl", - "libc", - "libloading", - "log", - "metal", - "naga", - "ndk-sys 0.5.0+25.2.9519653", - "objc", - "once_cell", - "parking_lot", - "profiling", - "range-alloc", - "raw-window-handle 0.6.2", - "renderdoc-sys", - "rustc-hash", - "smallvec", - "thiserror", - "wasm-bindgen", - "web-sys", - "wgpu-types", - "winapi", -] - -[[package]] -name = "wgpu-types" -version = "22.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc9d91f0e2c4b51434dfa6db77846f2793149d8e73f800fa2e41f52b8eac3c5d" -dependencies = [ - "bitflags 2.6.0", - "js-sys", - "web-sys", -] - [[package]] name = "which" version = "4.4.2" @@ -5882,12 +5411,6 @@ dependencies = [ "rustix", ] -[[package]] -name = "widestring" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" - [[package]] name = "winapi" version = "0.3.9" @@ -5955,16 +5478,6 @@ dependencies = [ "windows-targets 0.48.5", ] -[[package]] -name = "windows" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" -dependencies = [ - "windows-core 0.52.0", - "windows-targets 0.52.6", -] - [[package]] name = "windows" version = "0.56.0" @@ -6562,12 +6075,6 @@ dependencies = [ "windows-sys 0.59.0", ] -[[package]] -name = "xml-rs" -version = "0.8.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" - [[package]] name = "zbus" version = "4.4.0" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 3da95022..3df72381 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -38,7 +38,6 @@ thiserror = "1.0.64" tokio = { version = "1", features = ["full"] } ts-rs = "10.0" walkdir = "2.5.0" -wgpu = "22.1.0" zip = { version = "2.2.0", features = ["deflate-zlib-ng"] } zip-extract = "0.2.1" tempfile = "3.13.0" diff --git a/src-tauri/src/commands/binaries.rs b/src-tauri/src/commands/binaries.rs index a8a7f21e..b20fd8e6 100644 --- a/src-tauri/src/commands/binaries.rs +++ b/src-tauri/src/commands/binaries.rs @@ -651,86 +651,6 @@ pub async fn open_repl( } } -#[derive(Debug, Serialize, Deserialize)] -#[serde(rename_all = "camelCase")] -struct GPUTestOutput { - error: String, - error_cause: String, - success: bool, -} - -pub async fn run_game_gpu_test( - config_lock: &tokio::sync::MutexGuard<'_, LauncherConfig>, - app_handle: tauri::AppHandle, -) -> Result, CommandError> { - let config_info = common_prelude(config_lock)?; - - let exec_info = get_exec_location(&config_info, "gk")?; - let gpu_test_result_path = &match app_handle.path_resolver().app_data_dir() { - None => { - return Err(CommandError::BinaryExecution( - "Could not determine path to save GPU test results".to_owned(), - )) - } - Some(path) => path, - }; - create_dir(gpu_test_result_path)?; - let gpu_test_result_path = &gpu_test_result_path.join("gpu-test-result.json"); - - log::info!( - "Running GPU test on game version {:?} and storing in folder: {:?}", - &config_info.active_version, - gpu_test_result_path - ); - - let mut command = Command::new(exec_info.executable_path); - command - .args([ - "-v".to_string(), - "--gpu-test".to_string(), - "opengl".to_string(), - "--gpu-test-out-path".to_string(), - gpu_test_result_path.to_string_lossy().into_owned(), - ]) - .current_dir(exec_info.executable_dir); - #[cfg(windows)] - { - command.creation_flags(0x08000000); - } - let output = command.output().await?; - match output.status.code() { - Some(code) => { - if code == 0 { - // Parse the JSON file - // Read the file - let content = match std::fs::read_to_string(gpu_test_result_path) { - Ok(content) => content, - Err(err) => { - log::error!("Unable to read {}: {}", gpu_test_result_path.display(), err); - return Ok(None); - } - }; - - // Serialize from json - match serde_json::from_str::(&content) { - Ok(test_results) => { - return Ok(Some(test_results.success)); - } - Err(err) => { - log::error!("Unable to parse {}: {}", &content, err); - return Ok(None); - } - } - } else { - return Ok(None); - } - } - None => { - return Ok(None); - } - } -} - fn generate_launch_game_string( config_info: &CommonConfigData, game_name: String, diff --git a/src-tauri/src/commands/config.rs b/src-tauri/src/commands/config.rs index ebc6c382..b17a0411 100644 --- a/src-tauri/src/commands/config.rs +++ b/src-tauri/src/commands/config.rs @@ -228,18 +228,13 @@ pub async fn is_opengl_requirement_met( } // Do it the new way! log::info!("Checking for OpenGL support via `gk`"); - let test_result = super::binaries::run_game_gpu_test(&config_lock, app_handle).await?; - match test_result { - Some(result) => { - config_lock - .set_opengl_requirement_met(Some(result)) - .map_err(|_| { - CommandError::Configuration("Unable to persist opengl requirement change".to_owned()) - })?; - Ok(Some(result)) - } - None => Ok(None), - } + let test_result = crate::util::game_tests::run_game_gpu_test(&config_lock, &app_handle).await?; + config_lock + .set_opengl_requirement_met(Some(test_result.success)) + .map_err(|_| { + CommandError::Configuration("Unable to persist opengl requirement change".to_owned()) + })?; + Ok(Some(test_result.success)) } #[tauri::command] diff --git a/src-tauri/src/commands/support.rs b/src-tauri/src/commands/support.rs index 884176fe..c8c5296c 100644 --- a/src-tauri/src/commands/support.rs +++ b/src-tauri/src/commands/support.rs @@ -25,9 +25,8 @@ use super::CommandError; #[derive(Default, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] pub struct GPUInfo { - pub name: String, - pub driver_info: String, - pub driver_name: String, + pub opengl_test_passed: bool, + pub renderer_name: String, } #[derive(Default, Debug, Serialize, Deserialize)] @@ -79,7 +78,7 @@ pub struct SupportPackage { pub os_name_long: String, pub os_kernel_ver: String, pub disk_info: Vec, - pub gpu_info: Vec, + pub gpu_info: Option, pub game_info: PerGameInfo, pub launcher_version: String, pub extractor_binary_exists: bool, @@ -339,16 +338,27 @@ pub async fn generate_support_package( )) } - let gpu_info_instance = wgpu::Instance::default(); - for a in gpu_info_instance.enumerate_adapters(wgpu::Backends::all()) { - let info = a.get_info(); - let gpu_info = GPUInfo { - name: info.name, - driver_name: info.driver, - driver_info: info.driver_info, - }; - package.gpu_info.push(gpu_info); - } + let test_result = crate::util::game_tests::run_game_gpu_test(&config_lock, &app_handle).await; + match test_result { + Ok(result) => { + let gpu_info = GPUInfo { + opengl_test_passed: result.success, + renderer_name: format!( + "{}:{}", + result + .gpu_renderer_string + .unwrap_or("unknown renderer".to_string()), + result + .gpu_vendor_string + .unwrap_or("unknown vendor".to_string()) + ), + }; + package.gpu_info = Some(gpu_info); + } + Err(_) => { + package.gpu_info = None; + } + }; // Create zip file let save_path = Path::new(&user_path); diff --git a/src-tauri/src/util.rs b/src-tauri/src/util.rs index 5be9f9e5..85017fcf 100644 --- a/src-tauri/src/util.rs +++ b/src-tauri/src/util.rs @@ -1,5 +1,6 @@ pub mod file; pub mod game_milestones; +pub mod game_tests; pub mod network; pub mod os; pub mod process; diff --git a/src-tauri/src/util/game_tests.rs b/src-tauri/src/util/game_tests.rs new file mode 100644 index 00000000..8cbae7af --- /dev/null +++ b/src-tauri/src/util/game_tests.rs @@ -0,0 +1,186 @@ +#[cfg(target_os = "windows")] +use std::os::windows::process::CommandExt; +use std::{ + path::{Path, PathBuf}, + process::Command, +}; + +use semver::Version; +use serde::{Deserialize, Serialize}; + +use crate::{commands::CommandError, config::LauncherConfig, util::file::create_dir}; + +// TODO - duplicate code, cleanup later + +struct CommonConfigData { + install_path: std::path::PathBuf, + active_version: String, + active_version_folder: String, + tooling_version: Version, +} + +fn common_prelude( + config: &tokio::sync::MutexGuard, +) -> Result { + let install_path = match &config.installation_dir { + None => { + return Err(CommandError::BinaryExecution( + "No installation directory set, can't perform operation".to_owned(), + )) + } + Some(path) => Path::new(path), + }; + + let active_version = config + .active_version + .as_ref() + .ok_or(CommandError::BinaryExecution( + "No active version set, can't perform operation".to_owned(), + ))?; + + let active_version_folder = + config + .active_version_folder + .as_ref() + .ok_or(CommandError::BinaryExecution( + "No active version folder set, can't perform operation".to_owned(), + ))?; + + let tooling_version = Version::parse(active_version.strip_prefix('v').unwrap_or(&active_version)) + .unwrap_or(Version::new(0, 1, 35)); // assume new format if none can be found + + Ok(CommonConfigData { + install_path: install_path.to_path_buf(), + active_version: active_version.clone(), + active_version_folder: active_version_folder.clone(), + tooling_version: tooling_version, + }) +} + +fn bin_ext(filename: &str) -> String { + if cfg!(windows) { + return format!("{filename}.exe"); + } + filename.to_string() +} + +struct ExecutableLocation { + executable_dir: PathBuf, + executable_path: PathBuf, +} + +fn get_exec_location( + config_info: &CommonConfigData, + executable_name: &str, +) -> Result { + let exec_dir = config_info + .install_path + .join("versions") + .join(&config_info.active_version_folder) + .join(&config_info.active_version); + let exec_path = exec_dir.join(bin_ext(executable_name)); + if !exec_path.exists() { + log::error!( + "Could not find the required binary '{}', can't perform operation", + exec_path.to_string_lossy() + ); + return Err(CommandError::BinaryExecution(format!( + "Could not find the required binary '{}', can't perform operation", + exec_path.to_string_lossy() + ))); + } + Ok(ExecutableLocation { + executable_dir: exec_dir, + executable_path: exec_path, + }) +} + +#[derive(Debug, Serialize, Deserialize)] +#[serde(rename_all = "camelCase")] +pub struct GPUTestOutput { + pub error: String, + pub error_cause: String, + pub success: bool, + pub gpu_renderer_string: Option, + pub gpu_vendor_string: Option, +} + +pub async fn run_game_gpu_test( + config_lock: &tokio::sync::MutexGuard<'_, LauncherConfig>, + app_handle: &tauri::AppHandle, +) -> Result { + let config_info = common_prelude(config_lock)?; + + let exec_info = get_exec_location(&config_info, "gk")?; + let gpu_test_result_path = &match app_handle.path_resolver().app_data_dir() { + None => { + return Err(CommandError::BinaryExecution( + "Could not determine path to save GPU test results".to_owned(), + )) + } + Some(path) => path, + }; + create_dir(gpu_test_result_path)?; + let gpu_test_result_path = &gpu_test_result_path.join("gpu-test-result.json"); + + log::info!( + "Running GPU test on game version {:?} and storing in folder: {:?}", + &config_info.active_version, + gpu_test_result_path + ); + + let mut command = Command::new(exec_info.executable_path); + command + .args([ + "-v".to_string(), + "--gpu-test".to_string(), + "opengl".to_string(), + "--gpu-test-out-path".to_string(), + gpu_test_result_path.to_string_lossy().into_owned(), + ]) + .current_dir(exec_info.executable_dir); + #[cfg(windows)] + { + command.creation_flags(0x08000000); + } + let output = command.output()?; + match output.status.code() { + Some(code) => { + if code == 0 { + // Parse the JSON file + // Read the file + let content = match std::fs::read_to_string(gpu_test_result_path) { + Ok(content) => content, + Err(err) => { + log::error!("Unable to read {}: {}", gpu_test_result_path.display(), err); + return Err(CommandError::BinaryExecution( + "Unable to read gpu test result".to_owned(), + )); + } + }; + + // Serialize from json + match serde_json::from_str::(&content) { + Ok(test_results) => { + return Ok(test_results); + } + Err(err) => { + log::error!("Unable to parse {}: {}", &content, err); + return Err(CommandError::BinaryExecution( + "Unable to parse GPU test result".to_owned(), + )); + } + } + } else { + return Err(CommandError::BinaryExecution( + "GPU Test failed with a non-zero exit code".to_owned(), + )); + } + } + None => { + return Err(CommandError::BinaryExecution( + "GPU test failed, no exit-code returned".to_owned(), + )) + } + } +}