diff --git a/Cargo.lock b/Cargo.lock index ee707db..c53d5bb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -26,9 +26,9 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "ahash" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91429305e9f0a25f6205c5b8e0d2db09e0708a7a6df0f42212bb56c32c8ac97a" +checksum = "77c3a9648d43b9cd48db467b3f87fdd6e146bcc88ab0180006cef2179fe11d01" dependencies = [ "cfg-if", "getrandom", @@ -80,12 +80,33 @@ dependencies = [ "jni-sys", "libc", "log", - "ndk", + "ndk 0.7.0", "ndk-context", - "ndk-sys", + "ndk-sys 0.4.1+23.1.7779620", "num_enum 0.6.1", ] +[[package]] +name = "android-activity" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39b801912a977c3fd52d80511fe1c0c8480c6f957f21ae2ce1b92ffe970cf4b9" +dependencies = [ + "android-properties", + "bitflags 2.4.2", + "cc", + "cesu8", + "jni 0.21.1", + "jni-sys", + "libc", + "log", + "ndk 0.8.0", + "ndk-context", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum 0.7.2", + "thiserror", +] + [[package]] name = "android-properties" version = "0.2.2" @@ -109,9 +130,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.75" +version = "1.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +checksum = "080e9890a082662b09c1ad45f567faeeb47f22b5fb23895fbe1e651e718e25ca" [[package]] name = "approx" @@ -147,6 +168,12 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +[[package]] +name = "as-raw-xcb-connection" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" + [[package]] name = "ash" version = "0.37.3+1.3.251" @@ -163,17 +190,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b912285a7c29f3a8f87ca6f55afc48768624e5e33ec17dbd2f2075903f5e35ab" dependencies = [ "ash", - "raw-window-handle", + "raw-window-handle 0.5.2", "raw-window-metal", ] [[package]] name = "ashpd" -version = "0.6.7" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c018490e423efb6f032ef575f873ea57b61d44bec763cfe027b8e8852a027cf" +checksum = "4ac22eda5891cc086690cb6fa10121c0390de0e3b04eb269f2d766b00d3f2d81" dependencies = [ - "async-std", + "async-fs 2.1.0", + "async-net", "enumflags2", "futures-channel", "futures-util", @@ -195,17 +223,6 @@ dependencies = [ "futures-core", ] -[[package]] -name = "async-channel" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81953c529336010edd6d8e358f886d9581267795c61b19475b71314bffa46d35" -dependencies = [ - "concurrent-queue", - "event-listener 2.5.3", - "futures-core", -] - [[package]] name = "async-channel" version = "2.1.1" @@ -213,7 +230,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ca33f4bc4ed1babef42cad36cc1f51fa88be00420404e5b1e80ab1b18f7678c" dependencies = [ "concurrent-queue", - "event-listener 4.0.0", + "event-listener 4.0.3", "event-listener-strategy", "futures-core", "pin-project-lite", @@ -225,11 +242,11 @@ version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ae5ebefcc48e7452b4987947920dac9450be1110cadf34d1b8c116bdbaf97c" dependencies = [ - "async-lock 3.2.0", + "async-lock 3.3.0", "async-task", "concurrent-queue", "fastrand 2.0.1", - "futures-lite 2.1.0", + "futures-lite 2.2.0", "slab", ] @@ -246,18 +263,14 @@ dependencies = [ ] [[package]] -name = "async-global-executor" -version = "2.4.0" +name = "async-fs" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b4353121d5644cdf2beb5726ab752e79a8db1ebb52031770ec47db31d245526" +checksum = "dd1f344136bad34df1f83a47f3fd7f2ab85d75cb8a940af4ccf6d482a84ea01b" dependencies = [ - "async-channel 2.1.1", - "async-executor", - "async-io 2.2.1", - "async-lock 3.2.0", + "async-lock 3.3.0", "blocking", - "futures-lite 2.1.0", - "once_cell", + "futures-lite 2.2.0", ] [[package]] @@ -282,18 +295,18 @@ dependencies = [ [[package]] name = "async-io" -version = "2.2.1" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6d3b15875ba253d1110c740755e246537483f152fa334f91abd7fe84c88b3ff" +checksum = "fb41eb19024a91746eba0773aa5e16036045bbf45733766661099e182ea6a744" dependencies = [ - "async-lock 3.2.0", + "async-lock 3.3.0", "cfg-if", "concurrent-queue", "futures-io", - "futures-lite 2.1.0", + "futures-lite 2.2.0", "parking", - "polling 3.3.1", - "rustix 0.38.28", + "polling 3.3.2", + "rustix 0.38.30", "slab", "tracing", "windows-sys 0.52.0", @@ -310,15 +323,26 @@ dependencies = [ [[package]] name = "async-lock" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7125e42787d53db9dd54261812ef17e937c95a51e4d291373b670342fa44310c" +checksum = "d034b430882f8381900d3fe6f0aaa3ad94f2cb4ac519b429692a1bc2dda4ae7b" dependencies = [ - "event-listener 4.0.0", + "event-listener 4.0.3", "event-listener-strategy", "pin-project-lite", ] +[[package]] +name = "async-net" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" +dependencies = [ + "async-io 2.3.0", + "blocking", + "futures-lite 2.2.0", +] + [[package]] name = "async-process" version = "1.8.1" @@ -332,7 +356,7 @@ dependencies = [ "cfg-if", "event-listener 3.1.0", "futures-lite 1.13.0", - "rustix 0.38.28", + "rustix 0.38.30", "windows-sys 0.48.0", ] @@ -344,7 +368,7 @@ checksum = "5fd55a5ba1179988837d24ab4c7cc8ed6efdeff578ede0416b4225a5fca35bd0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -353,59 +377,33 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e47d90f65a225c4527103a8d747001fc56e375203592b25ad103e1ca13124c5" dependencies = [ - "async-io 2.2.1", + "async-io 2.3.0", "async-lock 2.8.0", "atomic-waker", "cfg-if", "futures-core", "futures-io", - "rustix 0.38.28", + "rustix 0.38.30", "signal-hook-registry", "slab", "windows-sys 0.48.0", ] -[[package]] -name = "async-std" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62565bb4402e926b29953c785397c6dc0391b7b446e45008b0049eb43cec6f5d" -dependencies = [ - "async-channel 1.9.0", - "async-global-executor", - "async-io 1.13.0", - "async-lock 2.8.0", - "crossbeam-utils", - "futures-channel", - "futures-core", - "futures-io", - "futures-lite 1.13.0", - "gloo-timers", - "kv-log-macro", - "log", - "memchr", - "once_cell", - "pin-project-lite", - "pin-utils", - "slab", - "wasm-bindgen-futures", -] - [[package]] name = "async-task" -version = "4.5.0" +version = "4.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4eb2cdb97421e01129ccb49169d8279ed21e829929144f4a22a6e54ac549ca1" +checksum = "fbb36e985947064623dbd357f727af08ffd077f93d696782f3c56365fa2e2799" [[package]] name = "async-trait" -version = "0.1.74" +version = "0.1.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a66537f1bb974b254c98ed142ff995236e81b9d0fe4db0575f46612cb15eb0f9" +checksum = "c980ee35e870bd1a4d2c8294d4c04d0499e67bca1e4b5cefcc693c2fa00caea9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -463,7 +461,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.39", + "syn 2.0.48", "which", ] @@ -476,7 +474,7 @@ dependencies = [ "autocxx-engine", "env_logger 0.9.3", "indexmap 1.9.3", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -503,7 +501,7 @@ dependencies = [ "rustversion", "serde_json", "strum_macros 0.24.3", - "syn 2.0.39", + "syn 2.0.48", "tempfile", "thiserror", "version_check", @@ -519,7 +517,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -536,7 +534,7 @@ dependencies = [ "quote", "serde", "serde_json", - "syn 2.0.39", + "syn 2.0.48", "thiserror", ] @@ -546,7 +544,7 @@ version = "0.66.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2b84e06fc203107bfbad243f4aba2af864eb7db3b1cf46ea0a023b0b433d2a7" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cexpr", "clang-sys", "lazy_static", @@ -557,16 +555,16 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "bindgen" -version = "0.69.1" +version = "0.69.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ffcebc3849946a7170a05992aac39da343a90676ab392c51a4280981d6379c2" +checksum = "a4c69fae65a523209d34240b60abe0c42d33d1045d445c0839d8a4894a736e2d" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cexpr", "clang-sys", "lazy_static", @@ -577,7 +575,7 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -588,9 +586,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.1" +version = "2.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" +checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" [[package]] name = "block" @@ -613,7 +611,16 @@ version = "0.1.0-beta.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" dependencies = [ - "objc-sys", + "objc-sys 0.2.0-beta.2", +] + +[[package]] +name = "block-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" +dependencies = [ + "objc-sys 0.3.2", ] [[package]] @@ -622,8 +629,18 @@ version = "0.2.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" dependencies = [ - "block-sys", - "objc2-encode", + "block-sys 0.1.0-beta.1", + "objc2-encode 2.0.0-pre.2", +] + +[[package]] +name = "block2" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" +dependencies = [ + "block-sys 0.2.1", + "objc2 0.4.1", ] [[package]] @@ -632,12 +649,12 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a37913e8dc4ddcc604f0c6d3bf2887c995153af3611de9e23c352b44c1b9118" dependencies = [ - "async-channel 2.1.1", - "async-lock 3.2.0", + "async-channel", + "async-lock 3.3.0", "async-task", "fastrand 2.0.1", "futures-io", - "futures-lite 2.1.0", + "futures-lite 2.2.0", "piper", "tracing", ] @@ -650,9 +667,9 @@ checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "bytemuck" -version = "1.14.0" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" +checksum = "ed2490600f404f2b94c167e31d3ed1d5f3c225a0f3b80230053b3e0b7b962bd9" dependencies = [ "bytemuck_derive", ] @@ -665,7 +682,7 @@ checksum = "965ab7eb5f8f97d2a083c799f3a1b994fc397b2fe2da5d1da1626ce15a39f2b1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -694,6 +711,32 @@ dependencies = [ "vec_map", ] +[[package]] +name = "calloop" +version = "0.12.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" +dependencies = [ + "bitflags 2.4.2", + "log", + "polling 3.3.2", + "rustix 0.38.30", + "slab", + "thiserror", +] + +[[package]] +name = "calloop-wayland-source" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" +dependencies = [ + "calloop 0.12.4", + "rustix 0.38.30", + "wayland-backend 0.3.2", + "wayland-client 0.31.1", +] + [[package]] name = "cc" version = "1.0.83" @@ -721,9 +764,9 @@ dependencies = [ [[package]] name = "cfg-expr" -version = "0.15.5" +version = "0.15.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03915af431787e6ffdcc74c645077518c6b6e01f80b761e0fbbfa288536311b3" +checksum = "6100bc57b6209840798d95cb2775684849d332f7bd788db2a8c8caf7ef82a41a" dependencies = [ "smallvec", "target-lexicon", @@ -743,27 +786,27 @@ checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" [[package]] name = "chrono" -version = "0.4.31" +version = "0.4.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +checksum = "9f13690e35a5e4ace198e7beea2895d29f3a9cc55015fcebe6336bd2010af9eb" dependencies = [ "android-tzdata", "iana-time-zone", "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] name = "clang-sys" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" dependencies = [ "glob", "libc", - "libloading 0.7.4", + "libloading 0.8.1", ] [[package]] @@ -927,11 +970,11 @@ dependencies = [ [[package]] name = "coreaudio-sys" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3120ebb80a9de008e638ad833d4127d50ea3d3a960ea23ea69bc66d9358a028" +checksum = "7f01585027057ff5f0a5bf276174ae4c1594a2c5bde93d5f46a016d76270f5a9" dependencies = [ - "bindgen 0.69.1", + "bindgen 0.69.2", ] [[package]] @@ -948,7 +991,7 @@ dependencies = [ "js-sys", "libc", "mach2", - "ndk", + "ndk 0.7.0", "ndk-context", "oboe", "once_cell", @@ -961,9 +1004,9 @@ dependencies = [ [[package]] name = "cpufeatures" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" +checksum = "53fe5e26ff1b7aef8bca9c6080520cfb8d9333c7568e1829cef191a9723e5504" dependencies = [ "libc", ] @@ -979,22 +1022,18 @@ dependencies = [ [[package]] name = "crossbeam-queue" -version = "0.3.8" +version = "0.3.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1cfb3ea8a53f37c40dea2c7bedcbd88bdfae54f5e2175d6ecaff1c988353add" +checksum = "df0346b5d5e76ac2fe4e327c5fd1118d6be7c51dfb18f9b7922923f287471e35" dependencies = [ - "cfg-if", "crossbeam-utils", ] [[package]] name = "crossbeam-utils" -version = "0.8.16" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a22b2d63d4d1dc0b7f1b6b2747dd0088008a9be28b6ddf0b1e7d335e3037294" -dependencies = [ - "cfg-if", -] +checksum = "248e3bacc7dc6baa3b21e405ee045c3047101a49145e7e9eca583ab4c2ca5345" [[package]] name = "crunchy" @@ -1023,10 +1062,26 @@ dependencies = [ ] [[package]] -name = "cxx" -version = "1.0.110" +name = "ctrlc" +version = "3.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7129e341034ecb940c9072817cd9007974ea696844fc4dd582dc1653a7fbe2e8" +checksum = "b467862cc8610ca6fc9a1532d7777cee0804e678ab45410897b9396495994a0b" +dependencies = [ + "nix 0.27.1", + "windows-sys 0.52.0", +] + +[[package]] +name = "cursor-icon" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" + +[[package]] +name = "cxx" +version = "1.0.115" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de00f15a6fa069c99b88c5c78c4541d0e7899a33b86f7480e23df2431fce0bc" dependencies = [ "cc", "cxxbridge-flags", @@ -1036,31 +1091,31 @@ dependencies = [ [[package]] name = "cxx-gen" -version = "0.7.110" +version = "0.7.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e0fc77e9f8d61724be90deb42a7e50ba3bf37c7c16dc91cdba821f69a5e0e9" +checksum = "65428c17c352f476b40ac6f497c86f9cb365bff3d35d18af68705d6630546849" dependencies = [ "codespan-reporting", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "cxxbridge-flags" -version = "1.0.110" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06fdd177fc61050d63f67f5bd6351fac6ab5526694ea8e359cd9cd3b75857f44" +checksum = "6f3fed61d56ba497c4efef9144dfdbaa25aa58f2f6b3a7cf441d4591c583745c" [[package]] name = "cxxbridge-macro" -version = "1.0.110" +version = "1.0.115" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "587663dd5fb3d10932c8aecfe7c844db1bcf0aee93eeab08fac13dc1212c2e7f" +checksum = "8908e380a8efd42150c017b0cfa31509fc49b6d47f7cb6b33e93ffb8f4e3661e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1083,7 +1138,7 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1094,7 +1149,7 @@ checksum = "836a9bbc7ad63342d6d6e7b815ccab164bc77a2d95d84bc3117a8c0d5c98e2d5" dependencies = [ "darling_core", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1188,7 +1243,7 @@ checksum = "f95e2801cd355d4a1a3e3953ce6ee5ae9603a5c833455343a8bfe3f44d418246" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1209,7 +1264,7 @@ dependencies = [ "darling", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1227,9 +1282,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.10.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95b3f3e67048839cb0d0781f445682a35113da7121f7c949db0e2be96a4fbece" +checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" dependencies = [ "humantime", "is-terminal", @@ -1273,9 +1328,9 @@ dependencies = [ [[package]] name = "event-listener" -version = "4.0.0" +version = "4.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "770d968249b5d99410d61f5bf89057f3199a077a04d087092f58e7d10692baae" +checksum = "67b215c49b2b248c855fb73579eb1f4f26c38ffdc12973e20e07b91d78d5646e" dependencies = [ "concurrent-queue", "parking", @@ -1288,7 +1343,7 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "958e4d70b6d5e81971bebec42271ec641e7ff4e170a6fa605f2b8a8b65cb97d3" dependencies = [ - "event-listener 4.0.0", + "event-listener 4.0.3", "pin-project-lite", ] @@ -1309,9 +1364,9 @@ checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" [[package]] name = "fdeflate" -version = "0.3.1" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" +checksum = "4f9bfee30e4dedf0ab8b422f03af778d9612b63f502710fc500a334ebe2de645" dependencies = [ "simd-adler32", ] @@ -1377,7 +1432,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -1424,9 +1479,9 @@ dependencies = [ [[package]] name = "futures" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0290714b38af9b4a7b094b8a37086d1b4e61f2df9122c3cad2577669145335" +checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0" dependencies = [ "futures-channel", "futures-core", @@ -1439,9 +1494,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78" dependencies = [ "futures-core", "futures-sink", @@ -1449,15 +1504,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "futures-executor" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f4fb8693db0cf099eadcca0efe2a5a22e4550f98ed16aba6c48700da29597bc" +checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d" dependencies = [ "futures-core", "futures-task", @@ -1466,9 +1521,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1" [[package]] name = "futures-lite" @@ -1487,9 +1542,9 @@ dependencies = [ [[package]] name = "futures-lite" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeee267a1883f7ebef3700f262d2d54de95dfaf38189015a74fdc4e0c7ad8143" +checksum = "445ba825b27408685aaecefd65178908c36c6e96aaf6d8599419d46e624192ba" dependencies = [ "fastrand 2.0.1", "futures-core", @@ -1500,32 +1555,32 @@ dependencies = [ [[package]] name = "futures-macro" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53b153fd91e4b0147f4aced87be237c98248656bb01050b96bf3ee89220a8ddb" +checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48" dependencies = [ "futures-channel", "futures-core", @@ -1550,10 +1605,20 @@ dependencies = [ ] [[package]] -name = "getrandom" -version = "0.2.11" +name = "gethostname" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" +checksum = "0176e0459c2e4a1fe232f984bca6890e681076abb9934f6cea7c326f3fc47818" +dependencies = [ + "libc", + "windows-targets 0.48.5", +] + +[[package]] +name = "getrandom" +version = "0.2.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "190092ea657667030ac6a35e305e62fc4dd69fd98ac98631e5d3a2b1575a12b5" dependencies = [ "cfg-if", "libc", @@ -1575,18 +1640,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - [[package]] name = "half" version = "2.3.1" @@ -1627,9 +1680,9 @@ dependencies = [ [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "5d3d0e0f38255e7fa3cf31335b3a56f05febd18025f4db5ef7a0cfb4f8da651f" [[package]] name = "hex" @@ -1639,11 +1692,11 @@ checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] name = "home" -version = "0.5.5" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" +checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -1660,9 +1713,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "iana-time-zone" -version = "0.1.58" +version = "0.1.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +checksum = "b6a67363e2aa4443928ce15e57ebae94fd8949958fd1223c4cfc0cd473ad7539" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1681,6 +1734,17 @@ dependencies = [ "cc", ] +[[package]] +name = "icrate" +version = "0.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" +dependencies = [ + "block2 0.3.0", + "dispatch", + "objc2 0.4.1", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1782,20 +1846,20 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" dependencies = [ - "hermit-abi 0.3.3", + "hermit-abi 0.3.4", "libc", "windows-sys 0.48.0", ] [[package]] name = "is-terminal" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" +checksum = "0bad00257d07be169d870ab665980b06cdb366d792ad690bf2e76876dc503455" dependencies = [ - "hermit-abi 0.3.3", - "rustix 0.38.28", - "windows-sys 0.48.0", + "hermit-abi 0.3.4", + "rustix 0.38.30", + "windows-sys 0.52.0", ] [[package]] @@ -1850,6 +1914,22 @@ dependencies = [ "walkdir", ] +[[package]] +name = "jni" +version = "0.21.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" +dependencies = [ + "cesu8", + "cfg-if", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", + "windows-sys 0.45.0", +] + [[package]] name = "jni-sys" version = "0.3.0" @@ -1867,22 +1947,13 @@ dependencies = [ [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.67" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +checksum = "9a1d36f1235bc969acba30b7f5990b864423a6068a10f7c90ae8f0112e3a59d1" dependencies = [ "wasm-bindgen", ] -[[package]] -name = "kv-log-macro" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0de8b303297635ad57c9f5059fd9cee7a47f8e8daa09df0fcd07dd39fb22977f" -dependencies = [ - "log", -] - [[package]] name = "lazy_static" version = "1.4.0" @@ -1897,9 +1968,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.150" +version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" [[package]] name = "libloading" @@ -1927,7 +1998,7 @@ version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3af92c55d7d839293953fcd0fda5ecfe93297cfde6ffbdec13b41d99c0ba6607" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "redox_syscall 0.4.1", ] @@ -1938,7 +2009,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0434617020ddca18b86067912970c55410ca654cdafd775480322f50b857a8c4" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "cc", "convert_case 0.6.0", "cookie-factory", @@ -1977,9 +2048,9 @@ checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" [[package]] name = "lock_api" @@ -1996,15 +2067,12 @@ name = "log" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" -dependencies = [ - "value-bag", -] [[package]] name = "mach2" -version = "0.4.1" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d0d1830bcd151a6fc4aea1369af235b36c1528fe976b8ff678683c9995eade8" +checksum = "19b955cdeb2a02b9117f121ce63aa52d08ade45de53e48fe6a38b39c10f6f709" dependencies = [ "libc", ] @@ -2020,9 +2088,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" [[package]] name = "memmap2" @@ -2042,6 +2110,15 @@ dependencies = [ "libc", ] +[[package]] +name = "memmap2" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe751422e4a8caa417e13c3ea66452215d7d63e19e604f4980461212f3ae1322" +dependencies = [ + "libc", +] + [[package]] name = "memoffset" version = "0.6.5" @@ -2060,6 +2137,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "miette" version = "5.10.0" @@ -2080,7 +2166,7 @@ checksum = "49e7bc1560b95a3c4a25d03de42fe76ca718ab92d1a22a55b9b4cf67b3ae635c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2128,9 +2214,24 @@ checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" dependencies = [ "bitflags 1.3.2", "jni-sys", - "ndk-sys", + "ndk-sys 0.4.1+23.1.7779620", "num_enum 0.5.11", - "raw-window-handle", + "raw-window-handle 0.5.2", + "thiserror", +] + +[[package]] +name = "ndk" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" +dependencies = [ + "bitflags 2.4.2", + "jni-sys", + "log", + "ndk-sys 0.5.0+25.2.9519653", + "num_enum 0.7.2", + "raw-window-handle 0.6.0", "thiserror", ] @@ -2149,6 +2250,15 @@ 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 = "nix" version = "0.24.3" @@ -2187,6 +2297,17 @@ dependencies = [ "pin-utils", ] +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.4.2", + "cfg-if", + "libc", +] + [[package]] name = "nom" version = "7.1.3" @@ -2244,13 +2365,22 @@ dependencies = [ "num_enum_derive 0.6.1", ] +[[package]] +name = "num_enum" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" +dependencies = [ + "num_enum_derive 0.7.2", +] + [[package]] name = "num_enum_derive" version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", @@ -2262,10 +2392,22 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", +] + +[[package]] +name = "num_enum_derive" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "681030a937600a36906c185595136d26abfebb4aa9c65701cefcaf8578bb982b" +dependencies = [ + "proc-macro-crate 2.0.1", + "proc-macro2", + "quote", + "syn 2.0.48", ] [[package]] @@ -2283,15 +2425,31 @@ version = "0.2.0-beta.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" +[[package]] +name = "objc-sys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7c71324e4180d0899963fc83d9d241ac39e699609fc1025a850aadac8257459" + [[package]] name = "objc2" version = "0.3.0-beta.3.patch-leaks.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7e01640f9f2cb1220bbe80325e179e532cb3379ebcd1bf2279d703c19fe3a468" dependencies = [ - "block2", - "objc-sys", - "objc2-encode", + "block2 0.2.0-alpha.6", + "objc-sys 0.2.0-beta.2", + "objc2-encode 2.0.0-pre.2", +] + +[[package]] +name = "objc2" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" +dependencies = [ + "objc-sys 0.3.2", + "objc2-encode 3.0.0", ] [[package]] @@ -2300,9 +2458,15 @@ version = "2.0.0-pre.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" dependencies = [ - "objc-sys", + "objc-sys 0.2.0-beta.2", ] +[[package]] +name = "objc2-encode" +version = "3.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" + [[package]] name = "oboe" version = "0.5.0" @@ -2310,7 +2474,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8868cc237ee02e2d9618539a23a8d228b9bb3fc2e7a5b11eed3831de77c395d0" dependencies = [ "jni 0.20.0", - "ndk", + "ndk 0.7.0", "ndk-context", "num-derive", "num-traits", @@ -2332,6 +2496,28 @@ version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" +[[package]] +name = "openxr" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7d5c194407c4fb5d3bf08c34ae57f3ea6cc9d9cfbe0594ce066896c809d9215" +dependencies = [ + "libc", + "libloading 0.7.4", + "ndk-context", + "openxr-sys", +] + +[[package]] +name = "openxr-sys" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa8f022053ecd7989d86f867b4fb8c3520347612b9d637e217077a0d6b4a6634" +dependencies = [ + "jni 0.19.0", + "libc", +] + [[package]] name = "orbclient" version = "0.3.47" @@ -2455,7 +2641,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2d009c8dd65e890b515a71950f7e4c801523b8894ff33863a40830bf762e9e9" dependencies = [ "anyhow", - "bitflags 2.4.1", + "bitflags 2.4.2", "libc", "libspa", "libspa-sys", @@ -2478,15 +2664,15 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "2900ede94e305130c13ddd391e0ab7cbaeb783945ae07a279c268cb05109c6cb" [[package]] name = "png" -version = "0.17.10" +version = "0.17.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" +checksum = "1f6c3c3e617595665b8ea2ff95a86066be38fb121ff920a9c0eb282abcd1da5a" dependencies = [ "bitflags 1.3.2", "crc32fast", @@ -2513,14 +2699,14 @@ dependencies = [ [[package]] name = "polling" -version = "3.3.1" +version = "3.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf63fa624ab313c11656b4cda960bfc46c410187ad493c41f6ba2d8c1e991c9e" +checksum = "545c980a3880efd47b2e262f6a4bb6daad6555cf3367aa9c4e52895f69537a41" dependencies = [ "cfg-if", "concurrent-queue", "pin-project-lite", - "rustix 0.38.28", + "rustix 0.38.30", "tracing", "windows-sys 0.52.0", ] @@ -2533,12 +2719,12 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "prettyplease" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae005bd773ab59b4725093fd7df83fd7892f7d8eafb48dbd7de6e024e4215f9d" +checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" dependencies = [ "proc-macro2", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -2551,6 +2737,16 @@ dependencies = [ "toml_edit 0.19.15", ] +[[package]] +name = "proc-macro-crate" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97dc5fea232fc28d2f597b37c4876b348a40e33f3b02cc975c8d006d78d94b1a" +dependencies = [ + "toml_datetime", + "toml_edit 0.20.2", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -2577,9 +2773,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.70" +version = "1.0.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" +checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" dependencies = [ "unicode-ident", ] @@ -2604,9 +2800,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.33" +version = "1.0.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" +checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" dependencies = [ "proc-macro2", ] @@ -2647,6 +2843,12 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" +[[package]] +name = "raw-window-handle" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42a9830a0e1b9fb145ebb365b8bc4ccd75f290f98c0247deafbbe2c75cefb544" + [[package]] name = "raw-window-metal" version = "0.3.2" @@ -2656,7 +2858,7 @@ dependencies = [ "cocoa", "core-graphics 0.23.1", "objc", - "raw-window-handle", + "raw-window-handle 0.5.2", ] [[package]] @@ -2679,9 +2881,9 @@ dependencies = [ [[package]] name = "regex" -version = "1.10.2" +version = "1.10.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" dependencies = [ "aho-corasick", "memchr", @@ -2691,9 +2893,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" dependencies = [ "aho-corasick", "memchr", @@ -2756,14 +2958,14 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.28" +version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72e572a5e8ca657d7366229cdde4bd14c4eb5499a9573d4d366fe1b599daa316" +checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.1", + "bitflags 2.4.2", "errno", "libc", - "linux-raw-sys 0.4.12", + "linux-raw-sys 0.4.13", "windows-sys 0.52.0", ] @@ -2818,40 +3020,53 @@ dependencies = [ "log", "memmap2 0.5.10", "smithay-client-toolkit 0.16.1", - "tiny-skia", + "tiny-skia 0.8.4", +] + +[[package]] +name = "sctk-adwaita" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82b2eaf3a5b264a521b988b2e73042e742df700c4f962cde845d1541adb46550" +dependencies = [ + "ab_glyph", + "log", + "memmap2 0.9.4", + "smithay-client-toolkit 0.18.0", + "tiny-skia 0.11.3", ] [[package]] name = "semver" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0" [[package]] name = "serde" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "870026e60fa08c69f064aa766c10f10b1d62db9ccd4d0abb206472bee0ce3b32" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.196" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "33c85360c95e7d137454dc81d9a4ed2b8efd8fbe19cee57357b32b9771fccb67" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.112" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "4d1bd37ce2324cf3bf85e5a25f96eb4baf0d5aa6eba43e7ae8958870c4ec48ed" dependencies = [ "itoa", "ryu", @@ -2860,29 +3075,29 @@ dependencies = [ [[package]] name = "serde_repr" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3081f5ffbb02284dda55132aa26daecedd7372a42417bbbab6f14ab7d6bb9145" +checksum = "0b2e6b945e9d3df726b65d6ee24060aff8e3533d431f677a9695db04eff9dfdb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] name = "serde_spanned" -version = "0.6.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12022b835073e5b11e90a14f86838ceb1c8fb0325b72416845c487ac0fa95e80" +checksum = "eb3622f419d1296904700073ea6cc23ad690adbd66f13ea683df73298736f0c1" dependencies = [ "serde", ] [[package]] name = "serde_yaml" -version = "0.9.27" +version = "0.9.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cc7a1570e38322cfe4154732e5110f887ea57e22b76f4bfd32b5bdd3368666c" +checksum = "b1bf28c79a99f70ee1f1d83d10c875d2e70618417fda01ad1785e027579d9d38" dependencies = [ "indexmap 2.1.0", "itoa", @@ -2925,9 +3140,9 @@ dependencies = [ [[package]] name = "shlex" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook-registry" @@ -2970,9 +3185,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.11.2" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" +checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" [[package]] name = "smithay-client-toolkit" @@ -2981,7 +3196,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "870427e30b8f2cbe64bf43ec4b86e88fe39b0a84b3f15efd9c9c2d020bc86eb9" dependencies = [ "bitflags 1.3.2", - "calloop", + "calloop 0.10.6", "dlib", "lazy_static", "log", @@ -3000,7 +3215,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1476c3d89bb67079264b88aaf4f14358353318397e083b7c4e8c14517f55de7" dependencies = [ "bitflags 1.3.2", - "calloop", + "calloop 0.10.6", "dlib", "lazy_static", "log", @@ -3008,15 +3223,49 @@ dependencies = [ "nix 0.26.4", "pkg-config", "thiserror", - "wayland-backend", + "wayland-backend 0.1.2", "wayland-client 0.30.2", "wayland-cursor 0.30.0", "wayland-protocols 0.30.1", - "wayland-protocols-wlr", + "wayland-protocols-wlr 0.1.0", "wayland-scanner 0.30.1", "xkbcommon", ] +[[package]] +name = "smithay-client-toolkit" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60e3d9941fa3bacf7c2bf4b065304faa14164151254cd16ce1b1bc8fc381600f" +dependencies = [ + "bitflags 2.4.2", + "calloop 0.12.4", + "calloop-wayland-source", + "cursor-icon", + "libc", + "log", + "memmap2 0.9.4", + "rustix 0.38.30", + "thiserror", + "wayland-backend 0.3.2", + "wayland-client 0.31.1", + "wayland-csd-frame", + "wayland-cursor 0.31.0", + "wayland-protocols 0.31.0", + "wayland-protocols-wlr 0.2.0", + "wayland-scanner 0.31.0", + "xkeysym", +] + +[[package]] +name = "smol_str" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6845563ada680337a52d43bb0b29f396f2d911616f6573012645b9e3d048a49" +dependencies = [ + "serde", +] + [[package]] name = "socket2" version = "0.4.10" @@ -3071,7 +3320,7 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -3087,9 +3336,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.39" +version = "2.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23e78b90f2fcf45d3e842032ce32e3f2d1545ba6636271dcbf24fa306d87be7a" +checksum = "0f3531638e407dfc0814761abb7c00a5b54992b849452a0646b7f65c9f770f3f" dependencies = [ "proc-macro2", "quote", @@ -3111,50 +3360,50 @@ dependencies = [ [[package]] name = "target-lexicon" -version = "0.12.12" +version = "0.12.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c39fd04924ca3a864207c66fc2cd7d22d7c016007f9ce846cbb9326331930a" +checksum = "69758bda2e78f098e4ccb393021a0963bb3442eac05f135c30f61b7370bbafae" [[package]] name = "tempfile" -version = "3.8.1" +version = "3.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "01ce4141aa927a6d1bd34a041795abd0db1cccba5d5f24b009f694bdf3a1f3fa" dependencies = [ "cfg-if", "fastrand 2.0.1", "redox_syscall 0.4.1", - "rustix 0.38.28", - "windows-sys 0.48.0", + "rustix 0.38.30", + "windows-sys 0.52.0", ] [[package]] name = "termcolor" -version = "1.4.0" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1bc3d3f05aff0403e8ac0d92ced918ec05b666a43f83297ccef5bea8a3d449" +checksum = "06794f8f6c5c898b3275aebefa6b8a1cb24cd2c6c79397ab15774837a0bc5755" dependencies = [ "winapi-util", ] [[package]] name = "thiserror" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" +checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.50" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" +checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -3178,7 +3427,21 @@ dependencies = [ "bytemuck", "cfg-if", "png", - "tiny-skia-path", + "tiny-skia-path 0.8.4", +] + +[[package]] +name = "tiny-skia" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6a067b809476893fce6a254cf285850ff69c847e6cfbade6a20b655b6c7e80d" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "log", + "tiny-skia-path 0.11.3", ] [[package]] @@ -3192,6 +3455,17 @@ dependencies = [ "strict-num", ] +[[package]] +name = "tiny-skia-path" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5de35e8a90052baaaf61f171680ac2f8e925a1e43ea9d2e3a00514772250e541" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -3209,21 +3483,21 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "toml" -version = "0.8.8" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1a195ec8c9da26928f773888e0742ca3ca1040c6cd859c919c9f59c1954ab35" +checksum = "185d8ab0dfbb35cf1399a6344d8484209c088f75f8f68230da55d48d95d43e3d" dependencies = [ "serde", "serde_spanned", "toml_datetime", - "toml_edit 0.21.0", + "toml_edit 0.20.2", ] [[package]] name = "toml_datetime" -version = "0.6.5" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3550f4e9685620ac18a50ed434eb3aec30db8ba93b0287467bca5826ea25baf1" +checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" dependencies = [ "serde", ] @@ -3241,9 +3515,9 @@ dependencies = [ [[package]] name = "toml_edit" -version = "0.21.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34d383cd00a163b4a5b85053df514d45bc330f6de7737edfe0a93311d1eaa03" +checksum = "396e4d48bbb2b7554c944bde63101b5ae446cff6ec4a24227428f15eb72ef338" dependencies = [ "indexmap 2.1.0", "serde", @@ -3271,7 +3545,7 @@ checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -3297,19 +3571,20 @@ checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "uds_windows" -version = "1.0.2" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce65604324d3cce9b966701489fbd0cf318cb1f7bd9dd07ac9a4ee6fb791930d" +checksum = "89daebc3e6fd160ac4aa9fc8b3bf71e1f74fbf92367ae71fb83a037e8bf164b9" dependencies = [ + "memoffset 0.9.0", "tempfile", "winapi", ] [[package]] name = "unicode-bidi" -version = "0.3.14" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f2528f27a9eb2b21e69c95319b30bd0efd85d09c379741b0f78ea1d86be2416" +checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" [[package]] name = "unicode-ident" @@ -3340,9 +3615,9 @@ checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" [[package]] name = "unsafe-libyaml" -version = "0.2.9" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28467d3e1d3c6586d8f25fa243f544f5800fec42d97032474e17222c2b75cfa" +checksum = "ab4c90930b95a82d00dc9e9ac071b4991924390d46cbd0dfe566148667605e4b" [[package]] name = "url" @@ -3356,12 +3631,6 @@ dependencies = [ "serde", ] -[[package]] -name = "value-bag" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72e1902dde2bd6441347de2b70b7f5d59bf157c6c62f0c44572607a1d55bbe" - [[package]] name = "vec_map" version = "0.8.2" @@ -3391,9 +3660,8 @@ dependencies = [ [[package]] name = "vulkano" -version = "0.34.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70f4278f76307b3c388679234b397b4f90de29cdba53873c26b624ed82653d75" +version = "0.34.0" +source = "git+https://github.com/vulkano-rs/vulkano?rev=94f50f1#94f50f18bd25971ea123adb8b5782ad65a8f085c" dependencies = [ "ahash", "ash", @@ -3409,7 +3677,7 @@ dependencies = [ "parking_lot", "proc-macro2", "quote", - "raw-window-handle", + "raw-window-handle 0.6.0", "regex", "serde", "serde_json", @@ -3422,52 +3690,48 @@ dependencies = [ [[package]] name = "vulkano-macros" version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52be622d364272fd77e298e7f68e8547ae66e7687cb86eb85335412cee7e3965" +source = "git+https://github.com/vulkano-rs/vulkano?rev=94f50f1#94f50f18bd25971ea123adb8b5782ad65a8f085c" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 2.0.1", "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.48", ] [[package]] name = "vulkano-shaders" version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1f63401297565d74afb96e9add12587d8e46235140cee325a8eb6ba4602f4ee" +source = "git+https://github.com/vulkano-rs/vulkano?rev=94f50f1#94f50f18bd25971ea123adb8b5782ad65a8f085c" dependencies = [ "ahash", "heck", "proc-macro2", "quote", "shaderc", - "syn 2.0.39", + "syn 2.0.48", "vulkano", ] [[package]] name = "vulkano-util" -version = "0.34.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff1f96a4055a8362c8fa77a17c01da184c6412961cd9572110533ff89e6669a7" +version = "0.34.0" +source = "git+https://github.com/vulkano-rs/vulkano?rev=94f50f1#94f50f18bd25971ea123adb8b5782ad65a8f085c" dependencies = [ "ahash", "vulkano", - "winit", + "winit 0.29.10", ] [[package]] name = "vulkano-win" version = "0.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b26c66e8600327823c15184e096eab37a7491d2f3f52b4956c21d84594fb0183" +source = "git+https://github.com/vulkano-rs/vulkano?rev=94f50f1#94f50f18bd25971ea123adb8b5782ad65a8f085c" dependencies = [ "core-graphics-types", "objc", - "raw-window-handle", + "raw-window-handle 0.5.2", "vulkano", - "winit", + "winit 0.28.7", ] [[package]] @@ -3494,9 +3758,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "b1223296a201415c7fad14792dbefaace9bd52b62d33453ade1c5b5f07555406" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -3504,24 +3768,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "fcdc935b63408d58a32f8cc9738a0bffd8f05cc7c002086c6ef20b7312ad9dcd" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" dependencies = [ "cfg-if", "js-sys", @@ -3531,9 +3795,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "3e4c238561b2d428924c49815533a8b9121c664599558a5d9ec51f8a1740a999" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -3541,22 +3805,22 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "bae1abb6806dc1ad9e560ed242107c0f6c84335f1749dd4e8ddb012ebd5e25a7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.90" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "4d91413b1c31d7539ba5ef2451af3f0b833a005eb27a631cec32bc0635a8602b" [[package]] name = "wayland-backend" @@ -3573,6 +3837,20 @@ dependencies = [ "wayland-sys 0.30.1", ] +[[package]] +name = "wayland-backend" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19152ddd73f45f024ed4534d9ca2594e0ef252c1847695255dae47f34df9fbe4" +dependencies = [ + "cc", + "downcast-rs", + "nix 0.26.4", + "scoped-tls", + "smallvec", + "wayland-sys 0.31.1", +] + [[package]] name = "wayland-client" version = "0.29.5" @@ -3596,12 +3874,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "489c9654770f674fc7e266b3c579f4053d7551df0ceb392f153adb1f9ed06ac8" dependencies = [ "bitflags 1.3.2", - "calloop", + "calloop 0.10.6", "nix 0.26.4", - "wayland-backend", + "wayland-backend 0.1.2", "wayland-scanner 0.30.1", ] +[[package]] +name = "wayland-client" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ca7d52347346f5473bf2f56705f360e8440873052e575e55890c4fa57843ed3" +dependencies = [ + "bitflags 2.4.2", + "nix 0.26.4", + "wayland-backend 0.3.2", + "wayland-scanner 0.31.0", +] + [[package]] name = "wayland-commons" version = "0.29.5" @@ -3614,6 +3904,17 @@ dependencies = [ "wayland-sys 0.29.5", ] +[[package]] +name = "wayland-csd-frame" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" +dependencies = [ + "bitflags 2.4.2", + "cursor-icon", + "wayland-backend 0.3.2", +] + [[package]] name = "wayland-cursor" version = "0.29.5" @@ -3636,6 +3937,17 @@ dependencies = [ "xcursor", ] +[[package]] +name = "wayland-cursor" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a44aa20ae986659d6c77d64d808a046996a932aa763913864dc40c359ef7ad5b" +dependencies = [ + "nix 0.26.4", + "wayland-client 0.31.1", + "xcursor", +] + [[package]] name = "wayland-protocols" version = "0.29.5" @@ -3655,11 +3967,36 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b28101e5ca94f70461a6c2d610f76d85ad223d042dd76585ab23d3422dd9b4d" dependencies = [ "bitflags 1.3.2", - "wayland-backend", + "wayland-backend 0.1.2", "wayland-client 0.30.2", "wayland-scanner 0.30.1", ] +[[package]] +name = "wayland-protocols" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e253d7107ba913923dc253967f35e8561a3c65f914543e46843c88ddd729e21c" +dependencies = [ + "bitflags 2.4.2", + "wayland-backend 0.3.2", + "wayland-client 0.31.1", + "wayland-scanner 0.31.0", +] + +[[package]] +name = "wayland-protocols-plasma" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" +dependencies = [ + "bitflags 2.4.2", + "wayland-backend 0.3.2", + "wayland-client 0.31.1", + "wayland-protocols 0.31.0", + "wayland-scanner 0.31.0", +] + [[package]] name = "wayland-protocols-wlr" version = "0.1.0" @@ -3667,12 +4004,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fce991093320e4a6a525876e6b629ab24da25f9baef0c2e0080ad173ec89588a" dependencies = [ "bitflags 1.3.2", - "wayland-backend", + "wayland-backend 0.1.2", "wayland-client 0.30.2", "wayland-protocols 0.30.1", "wayland-scanner 0.30.1", ] +[[package]] +name = "wayland-protocols-wlr" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" +dependencies = [ + "bitflags 2.4.2", + "wayland-backend 0.3.2", + "wayland-client 0.31.1", + "wayland-protocols 0.31.0", + "wayland-scanner 0.31.0", +] + [[package]] name = "wayland-scanner" version = "0.29.5" @@ -3695,6 +4045,17 @@ dependencies = [ "quote", ] +[[package]] +name = "wayland-scanner" +version = "0.31.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb8e28403665c9f9513202b7e1ed71ec56fde5c107816843fb14057910b2c09c" +dependencies = [ + "proc-macro2", + "quick-xml 0.30.0", + "quote", +] + [[package]] name = "wayland-sys" version = "0.29.5" @@ -3718,10 +4079,32 @@ dependencies = [ ] [[package]] -name = "web-sys" -version = "0.3.66" +name = "wayland-sys" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "15a0c8eaff5216d07f226cb7a549159267f3467b289d9a2e52fd3ef5aae2b7af" +dependencies = [ + "dlib", + "log", + "once_cell", + "pkg-config", +] + +[[package]] +name = "web-sys" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "58cd2333b6e0be7a39605f0e255892fd7418a682d8da8fe042fe25128794d2ed" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" dependencies = [ "js-sys", "wasm-bindgen", @@ -3736,7 +4119,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix 0.38.28", + "rustix 0.38.30", ] [[package]] @@ -3781,11 +4164,11 @@ dependencies = [ [[package]] name = "windows-core" -version = "0.51.1" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.48.5", + "windows-targets 0.52.0", ] [[package]] @@ -3992,7 +4375,7 @@ version = "0.28.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9596d90b45384f5281384ab204224876e8e8bf7d58366d9b795ad99aa9894b94" dependencies = [ - "android-activity", + "android-activity 0.4.3", "bitflags 1.3.2", "cfg_aliases", "core-foundation", @@ -4002,14 +4385,14 @@ dependencies = [ "libc", "log", "mio", - "ndk", - "objc2", + "ndk 0.7.0", + "objc2 0.3.0-beta.3.patch-leaks.3", "once_cell", "orbclient", "percent-encoding", - "raw-window-handle", + "raw-window-handle 0.5.2", "redox_syscall 0.3.5", - "sctk-adwaita", + "sctk-adwaita 0.5.4", "smithay-client-toolkit 0.16.1", "wasm-bindgen", "wayland-client 0.29.5", @@ -4022,10 +4405,58 @@ dependencies = [ ] [[package]] -name = "winnow" -version = "0.5.26" +name = "winit" +version = "0.29.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67b5f0a4e7a27a64c651977932b9dc5667ca7fc31ac44b03ed37a0cf42fdfff" +checksum = "4c824f11941eeae66ec71111cc2674373c772f482b58939bb4066b642aa2ffcf" +dependencies = [ + "ahash", + "android-activity 0.5.1", + "atomic-waker", + "bitflags 2.4.2", + "bytemuck", + "calloop 0.12.4", + "cfg_aliases", + "core-foundation", + "core-graphics 0.23.1", + "cursor-icon", + "icrate", + "js-sys", + "libc", + "log", + "memmap2 0.9.4", + "ndk 0.8.0", + "ndk-sys 0.5.0+25.2.9519653", + "objc2 0.4.1", + "once_cell", + "orbclient", + "percent-encoding", + "raw-window-handle 0.6.0", + "redox_syscall 0.3.5", + "rustix 0.38.30", + "sctk-adwaita 0.8.1", + "smithay-client-toolkit 0.18.0", + "smol_str", + "unicode-segmentation", + "wasm-bindgen", + "wasm-bindgen-futures", + "wayland-backend 0.3.2", + "wayland-client 0.31.1", + "wayland-protocols 0.31.0", + "wayland-protocols-plasma", + "web-sys", + "web-time", + "windows-sys 0.48.0", + "x11-dl", + "x11rb", + "xkbcommon-dl", +] + +[[package]] +name = "winnow" +version = "0.5.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1931d78a9c73861da0134f453bb1f790ce49b2e30eba8410b4b79bac72b46a2d" dependencies = [ "memchr", ] @@ -4053,11 +4484,13 @@ dependencies = [ name = "wlx-overlay-s" version = "0.1.0" dependencies = [ + "anyhow", "ash", "ash-window", "chrono", "cstr", - "env_logger 0.10.1", + "ctrlc", + "env_logger 0.10.2", "fontconfig-rs", "freetype-rs", "futures", @@ -4068,21 +4501,23 @@ dependencies = [ "libc", "log", "once_cell", + "openxr", "ovr_overlay", "png", - "raw-window-handle", + "raw-window-handle 0.5.2", "regex", "rodio", "serde", "serde_yaml", "smallvec", "strum", + "thiserror", "tinyvec", "vulkano", "vulkano-shaders", "vulkano-util", "vulkano-win", - "winit", + "winit 0.29.10", "wlx-capture", ] @@ -4097,6 +4532,27 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "x11rb" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8f25ead8c7e4cba123243a6367da5d3990e0d3affa708ea19dce96356bd9f1a" +dependencies = [ + "as-raw-xcb-connection", + "gethostname", + "libc", + "libloading 0.8.1", + "once_cell", + "rustix 0.38.30", + "x11rb-protocol", +] + +[[package]] +name = "x11rb-protocol" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e63e71c4b8bd9ffec2c963173a4dc4cbde9ee96961d4fcb4429db9929b606c34" + [[package]] name = "xcb" version = "1.3.0" @@ -4134,6 +4590,25 @@ dependencies = [ "memmap2 0.7.1", ] +[[package]] +name = "xkbcommon-dl" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6924668544c48c0133152e7eec86d644a056ca3d09275eb8d5cdb9855f9d8699" +dependencies = [ + "bitflags 2.4.2", + "dlib", + "log", + "once_cell", + "xkeysym", +] + +[[package]] +name = "xkeysym" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "054a8e68b76250b253f671d1268cb7f1ae089ec35e195b2efb2a4e9a836d0621" + [[package]] name = "xml-rs" version = "0.8.19" @@ -4166,7 +4641,7 @@ checksum = "31de390a2d872e4cd04edd71b425e29853f786dc99317ed72d73d6fcf5ebb948" dependencies = [ "async-broadcast", "async-executor", - "async-fs", + "async-fs 1.6.0", "async-io 1.13.0", "async-lock 2.8.0", "async-process", @@ -4205,7 +4680,7 @@ version = "3.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41d1794a946878c0e807f55a397187c11fc7a038ba5d868e7db4f3bd7760bc9d" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "regex", @@ -4226,22 +4701,22 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.7.30" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "306dca4455518f1f31635ec308b6b3e4eb1b11758cefafc782827d0aa7acb5c7" +checksum = "74d4d3961e53fa4c9a25a8637fc2bfaf2595b3d3ae34875568a5cf64787716be" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.30" +version = "0.7.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be912bf68235a88fbefd1b73415cb218405958d1655b2ece9035a19920bdf6ba" +checksum = "9ce1b18ccd8e73a9321186f97e46f9f04b778851177567b1975109d26a08d2a6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.39", + "syn 2.0.48", ] [[package]] @@ -4265,7 +4740,7 @@ version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "934d7a7dfc310d6ee06c87ffe88ef4eca7d3e37bb251dece2ef93da8f17d8ecd" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.3.1", "proc-macro2", "quote", "syn 1.0.109", diff --git a/Cargo.toml b/Cargo.toml index 1ad9598..887232d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,10 +10,12 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] +anyhow = "1.0.79" ash = "^0.37.2" ash-window = "0.12.0" chrono = "0.4.29" cstr = "0.2.11" +ctrlc = { version = "3.4.2", features = ["termination"] } env_logger = "0.10.0" fontconfig-rs = { version = "0.1.1", features = ["dlopen"] } freetype-rs = "0.32.0" @@ -25,7 +27,8 @@ input-linux = "0.6.0" libc = "0.2.147" log = "0.4.20" once_cell = "1.18.0" -ovr_overlay = { features = ["ovr_input", "ovr_system"], path = "../ovr_overlay_oyasumi" } +openxr = { version = "0.17.1", optional = true } +ovr_overlay = { features = ["ovr_input", "ovr_system"], path = "../ovr_overlay_oyasumi", optional = true } png = "0.17.10" raw-window-handle = "0.5.2" regex = "1.9.5" @@ -34,11 +37,17 @@ serde = { version = "1.0.188", features = ["derive"] } serde_yaml = "0.9.25" smallvec = "1.11.0" strum = { version = "0.25.0", features = ["derive"] } +thiserror = "1.0.56" tinyvec = "1.6.0" -vulkano = { version = "0.34.1", features = ["serde"] } -vulkano-shaders = "0.34.0" -vulkano-util = "0.34.1" -vulkano-win = "0.34.0" -winit = "0.28.6" +vulkano = { git = "https://github.com/vulkano-rs/vulkano", rev = "94f50f1" } +vulkano-shaders = { git = "https://github.com/vulkano-rs/vulkano", rev = "94f50f1" } +vulkano-util = { git = "https://github.com/vulkano-rs/vulkano", rev = "94f50f1" } +vulkano-win = { git = "https://github.com/vulkano-rs/vulkano", rev = "94f50f1" } +winit = "0.29.10" wlx-capture = { path = "../wlx-capture" } +[features] +openvr = ["dep:ovr_overlay"] +openxr = ["dep:openxr"] +default = ["openvr", "openxr"] + diff --git a/src/backend/common.rs b/src/backend/common.rs index 8daba1c..e83ea0d 100644 --- a/src/backend/common.rs +++ b/src/backend/common.rs @@ -18,6 +18,13 @@ use crate::{ use super::overlay::{OverlayData, OverlayState}; +pub enum BackendError { + NotSupported, + Shutdown, + Restart, + Fatal, +} + pub struct OverlayContainer where T: Default, @@ -39,11 +46,13 @@ where get_screens_x11() }; - //let watch = create_watch::(&app, &screens); - //overlays.insert(watch.state.id, watch); + let mut watch = create_watch::(&app, &screens); + watch.state.want_visible = false; + overlays.insert(watch.state.id, watch); - //let keyboard = create_keyboard(&app); - //overlays.insert(keyboard.state.id, keyboard); + let mut keyboard = create_keyboard(&app); + keyboard.state.want_visible = false; + overlays.insert(keyboard.state.id, keyboard); let mut first = true; for mut screen in screens { diff --git a/src/backend/mod.rs b/src/backend/mod.rs index 01bfa9a..0101aea 100644 --- a/src/backend/mod.rs +++ b/src/backend/mod.rs @@ -1,5 +1,7 @@ pub mod common; pub mod input; +#[cfg(feature = "openvr")] pub mod openvr; +#[cfg(feature = "openxr")] pub mod openxr; pub mod overlay; diff --git a/src/backend/openvr/lines.rs b/src/backend/openvr/lines.rs index e3378fd..af1f386 100644 --- a/src/backend/openvr/lines.rs +++ b/src/backend/openvr/lines.rs @@ -29,7 +29,7 @@ impl LinePool { let buf = vec![255; 16]; - let texture = command_buffer.texture2d(2, 2, Format::R8G8B8A8_UNORM, buf); + let texture = command_buffer.texture2d(2, 2, Format::R8G8B8A8_UNORM, &buf); command_buffer.build_and_execute_now(); graphics diff --git a/src/backend/openvr/mod.rs b/src/backend/openvr/mod.rs index 991849c..1db4f42 100644 --- a/src/backend/openvr/mod.rs +++ b/src/backend/openvr/mod.rs @@ -1,6 +1,10 @@ use glam::Vec4; use std::{ collections::VecDeque, + sync::{ + atomic::{AtomicBool, Ordering}, + Arc, + }, time::{Duration, Instant}, }; @@ -19,24 +23,27 @@ use crate::{ input::interact, openvr::{input::OpenVrInputSource, lines::LinePool}, }, + graphics::WlxGraphics, state::AppState, }; use self::{input::action_manifest_path, overlay::OpenVrOverlayData}; -use super::common::{OverlayContainer, TaskType}; +use super::common::{BackendError, OverlayContainer, TaskType}; pub mod input; pub mod lines; pub mod overlay; -pub fn openvr_run() { +pub fn openvr_run(running: Arc) -> Result<(), BackendError> { let app_type = EVRApplicationType::VRApplication_Overlay; let Ok(context) = ovr_overlay::Context::init(app_type) else { - log::error!("Failed to initialize OpenVR"); - return; + log::warn!("Will not use OpenVR: Context init failed"); + return Err(BackendError::NotSupported); }; + log::info!("Using OpenVR runtime"); + let mut overlay_mngr = context.overlay_mngr(); //let mut settings_mngr = context.settings_mngr(); let mut input_mngr = context.input_mngr(); @@ -55,19 +62,23 @@ pub fn openvr_run() { InstanceExtensions::from_iter(names.iter().map(|s| s.as_str())) }; - let mut state = AppState::new(instance_extensions, device_extensions_fn); + let mut state = { + let graphics = WlxGraphics::new(instance_extensions, device_extensions_fn); + AppState::from_graphics(graphics) + }; + let mut overlays = OverlayContainer::::new(&mut state); state.hid_provider.set_desktop_extent(overlays.extent); if let Err(e) = input_mngr.set_action_manifest(action_manifest_path()) { log::error!("Failed to set action manifest: {}", e.description()); - return; + return Err(BackendError::Fatal); }; let Ok(mut input_source) = OpenVrInputSource::new(&mut input_mngr) else { log::error!("Failed to initialize input"); - return; + return Err(BackendError::Fatal); }; let Ok(refresh_rate) = system_mngr.get_tracked_device_property::( @@ -75,7 +86,7 @@ pub fn openvr_run() { ETrackedDeviceProperty::Prop_DisplayFrequency_Float, ) else { log::error!("Failed to get display refresh rate"); - return; + return Err(BackendError::Fatal); }; log::info!("HMD running @ {} Hz", refresh_rate); @@ -90,12 +101,17 @@ pub fn openvr_run() { lines.allocate(&mut overlay_mngr, &mut state), ]; - loop { + 'main_loop: loop { + if !running.load(Ordering::Relaxed) { + log::warn!("Received shutdown signal."); + break 'main_loop; + } + while let Some(event) = system_mngr.poll_next_event() { match event.event_type { EVREventType::VREvent_Quit => { - log::info!("Received quit event, shutting down."); - return; + log::warn!("Received quit event, shutting down."); + break 'main_loop; } EVREventType::VREvent_TrackedDeviceActivated | EVREventType::VREvent_TrackedDeviceDeactivated @@ -173,4 +189,9 @@ pub fn openvr_run() { }, )); } + + log::warn!("OpenVR shutdown"); + // context.shutdown() called by Drop + + Ok(()) } diff --git a/src/backend/openxr/input.rs b/src/backend/openxr/input.rs new file mode 100644 index 0000000..1724b2d --- /dev/null +++ b/src/backend/openxr/input.rs @@ -0,0 +1,232 @@ +use glam::{bool, Affine3A, Quat, Vec3}; +use openxr as xr; + +use crate::{backend::input::Pointer, state::AppState}; + +type XrSession = xr::Session; + +pub(super) struct OpenXrInputSource { + action_set: xr::ActionSet, + hands: [OpenXrHand; 2], + pub(super) stage: xr::Space, +} + +pub(super) struct OpenXrHand { + source: OpenXrHandSource, + space: xr::Space, +} + +pub(super) struct OpenXrHandSource { + action_pose: xr::Action, + action_click: xr::Action, + action_grab: xr::Action, + action_scroll: xr::Action, + action_alt_click: xr::Action, + action_show_hide: xr::Action, + action_click_modifier_right: xr::Action, + action_click_modifier_middle: xr::Action, + action_haptics: xr::Action, +} + +impl OpenXrInputSource { + pub fn new(session: XrSession) -> Self { + let mut action_set = session + .instance() + .create_action_set("wlx-overlay-s", "WlxOverlay-S Actions", 0) + .expect("Failed to create action set"); + + let left_source = OpenXrHandSource::new(&mut action_set, "left"); + let right_source = OpenXrHandSource::new(&mut action_set, "right"); + + session.attach_action_sets(&[&action_set]).unwrap(); + + let stage = session + .create_reference_space(xr::ReferenceSpaceType::STAGE, xr::Posef::IDENTITY) + .unwrap(); + + Self { + action_set, + hands: [ + OpenXrHand::new(session.clone(), left_source), + OpenXrHand::new(session, right_source), + ], + stage, + } + } + + pub fn update(&self, session: &XrSession, time: xr::Time, state: &mut AppState) { + session.sync_actions(&[(&self.action_set).into()]).unwrap(); + + for i in 0..2 { + self.hands[i].update( + &mut state.input_state.pointers[i], + &self.stage, + session, + time, + ); + } + } +} + +impl OpenXrHand { + pub(super) fn new(session: XrSession, source: OpenXrHandSource) -> Self { + let space = source + .action_pose + .create_space(session.clone(), xr::Path::NULL, xr::Posef::IDENTITY) + .unwrap(); + + Self { source, space } + } + + pub(super) fn update( + &self, + pointer: &mut Pointer, + stage: &xr::Space, + session: &XrSession, + time: xr::Time, + ) { + let location = self.space.locate(stage, time).unwrap(); + if location + .location_flags + .contains(xr::SpaceLocationFlags::ORIENTATION_VALID) + { + let quat = unsafe { std::mem::transmute::<_, Quat>(location.pose.orientation) }; + let pos = unsafe { std::mem::transmute::<_, Vec3>(location.pose.position) }; + pointer.pose = Affine3A::from_rotation_translation(quat, pos); + } + + pointer.now.click = self + .source + .action_click + .state(session, xr::Path::NULL) + .unwrap() + .current_state; + + pointer.now.grab = self + .source + .action_grab + .state(session, xr::Path::NULL) + .unwrap() + .current_state; + + pointer.now.scroll = self + .source + .action_scroll + .state(session, xr::Path::NULL) + .unwrap() + .current_state + .y; + + pointer.now.alt_click = self + .source + .action_alt_click + .state(session, xr::Path::NULL) + .unwrap() + .current_state; + + pointer.now.show_hide = self + .source + .action_show_hide + .state(session, xr::Path::NULL) + .unwrap() + .current_state; + + pointer.now.click_modifier_right = self + .source + .action_click_modifier_right + .state(session, xr::Path::NULL) + .unwrap() + .current_state; + + pointer.now.click_modifier_middle = self + .source + .action_click_modifier_middle + .state(session, xr::Path::NULL) + .unwrap() + .current_state; + } +} + +// supported action types: Haptic, Posef, Vector2f, f32, bool +impl OpenXrHandSource { + pub(super) fn new(action_set: &mut xr::ActionSet, side: &str) -> Self { + let action_pose = action_set + .create_action::( + &format!("{}_hand", side), + &format!("{} hand pose", side), + &[], + ) + .unwrap(); + + let action_click = action_set + .create_action::( + &format!("{}_click", side), + &format!("{} hand click", side), + &[], + ) + .unwrap(); + let action_grab = action_set + .create_action::( + &format!("{}_grab", side), + &format!("{} hand grab", side), + &[], + ) + .unwrap(); + let action_scroll = action_set + .create_action::( + &format!("{}_scroll", side), + &format!("{} hand scroll", side), + &[], + ) + .unwrap(); + let action_alt_click = action_set + .create_action::( + &format!("{}_alt_click", side), + &format!("{} hand alt click", side), + &[], + ) + .unwrap(); + let action_show_hide = action_set + .create_action::( + &format!("{}_show_hide", side), + &format!("{} hand show/hide", side), + &[], + ) + .unwrap(); + let action_click_modifier_right = action_set + .create_action::( + &format!("{}_click_modifier_right", side), + &format!("{} hand right click modifier", side), + &[], + ) + .unwrap(); + let action_click_modifier_middle = action_set + .create_action::( + &format!("{}_click_modifier_middle", side), + &format!("{} hand middle click modifier", side), + &[], + ) + .unwrap(); + let action_haptics = action_set + .create_action::( + &format!("{}_haptics", side), + &format!("{} hand haptics", side), + &[], + ) + .unwrap(); + + // TODO suggest bindings + + Self { + action_pose, + action_click, + action_grab, + action_scroll, + action_alt_click, + action_show_hide, + action_click_modifier_right, + action_click_modifier_middle, + action_haptics, + } + } +} diff --git a/src/backend/openxr.rs b/src/backend/openxr/lines.rs similarity index 100% rename from src/backend/openxr.rs rename to src/backend/openxr/lines.rs diff --git a/src/backend/openxr/mod.rs b/src/backend/openxr/mod.rs new file mode 100644 index 0000000..35d2a2a --- /dev/null +++ b/src/backend/openxr/mod.rs @@ -0,0 +1,363 @@ +use std::{ + sync::{ + atomic::{AtomicBool, Ordering}, + Arc, + }, + time::Duration, +}; + +use anyhow::{bail, ensure}; +use ash::vk::{self}; +use glam::{Affine3A, Quat, Vec3}; +use openxr as xr; +use vulkano::{ + image::{view::ImageView, ImageCreateInfo, ImageUsage}, + render_pass::{Framebuffer, FramebufferCreateInfo}, + Handle, VulkanObject, +}; + +use crate::{ + backend::{common::OverlayContainer, input::interact, openxr::overlay::OpenXrOverlayData}, + graphics::WlxGraphics, + state::AppState, +}; + +use super::common::BackendError; + +mod input; +mod lines; +mod overlay; + +const VIEW_TYPE: xr::ViewConfigurationType = xr::ViewConfigurationType::PRIMARY_STEREO; +const VIEW_COUNT: u32 = 2; + +pub fn openxr_run(running: Arc) -> Result<(), BackendError> { + let (xr_instance, system) = match init_xr() { + Ok((xr_instance, system)) => (xr_instance, system), + Err(e) => { + log::warn!("Will not use OpenXR: {}", e); + return Err(BackendError::NotSupported); + } + }; + + let environment_blend_mode = xr_instance + .enumerate_environment_blend_modes(system, VIEW_TYPE) + .unwrap()[0]; + log::info!("Using environment blend mode: {:?}", environment_blend_mode); + + let mut state = { + let graphics = WlxGraphics::new_xr(xr_instance.clone(), system); + AppState::from_graphics(graphics) + }; + + let mut overlays = OverlayContainer::::new(&mut state); + + state.hid_provider.set_desktop_extent(overlays.extent); + + let (session, mut frame_wait, mut frame_stream) = unsafe { + xr_instance + .create_session::( + system, + &xr::vulkan::SessionCreateInfo { + instance: state.graphics.instance.handle().as_raw() as _, + physical_device: state.graphics.device.physical_device().handle().as_raw() as _, + device: state.graphics.device.handle().as_raw() as _, + queue_family_index: state.graphics.queue.queue_family_index(), + queue_index: 0, + }, + ) + .unwrap() + }; + + let input_source = input::OpenXrInputSource::new(session.clone()); + + let mut swapchain = None; + let mut session_running = false; + let mut event_storage = xr::EventDataBuffer::new(); + + 'main_loop: loop { + if !running.load(Ordering::Relaxed) { + log::warn!("Received shutdown signal."); + match session.request_exit() { + Ok(_) => log::info!("OpenXR session exit requested."), + Err(xr::sys::Result::ERROR_SESSION_NOT_RUNNING) => break 'main_loop, + Err(e) => { + log::error!("Failed to request OpenXR session exit: {}", e); + break 'main_loop; + } + } + } + + while let Some(event) = xr_instance.poll_event(&mut event_storage).unwrap() { + use xr::Event::*; + match event { + SessionStateChanged(e) => { + // Session state change is where we can begin and end sessions, as well as + // find quit messages! + println!("entered state {:?}", e.state()); + match e.state() { + xr::SessionState::READY => { + session.begin(VIEW_TYPE).unwrap(); + session_running = true; + } + xr::SessionState::STOPPING => { + session.end().unwrap(); + session_running = false; + } + xr::SessionState::EXITING | xr::SessionState::LOSS_PENDING => { + break 'main_loop; + } + _ => {} + } + } + InstanceLossPending(_) => { + break 'main_loop; + } + EventsLost(e) => { + println!("lost {} events", e.lost_event_count()); + } + _ => {} + } + } + + if !session_running { + std::thread::sleep(Duration::from_millis(100)); + continue 'main_loop; + } + + let xr_frame_state = frame_wait.wait().unwrap(); + frame_stream.begin().unwrap(); + + if !xr_frame_state.should_render { + frame_stream + .end( + xr_frame_state.predicted_display_time, + environment_blend_mode, + &[], + ) + .unwrap(); + continue 'main_loop; + } + + state.input_state.pre_update(); + input_source.update(&session, xr_frame_state.predicted_display_time, &mut state); + state.input_state.post_update(); + + let (_, views) = session + .locate_views( + VIEW_TYPE, + xr_frame_state.predicted_display_time, + &input_source.stage, + ) + .unwrap(); + + state.input_state.hmd = hmd_pose_from_views(&views); + + let _pointer_lengths = interact(&mut overlays, &mut state); + + //TODO lines + + overlays + .iter_mut() + .filter(|o| o.state.want_visible) + .for_each(|o| o.render(&mut state)); + + state.hid_provider.on_new_frame(); + + let swapchain = swapchain.get_or_insert_with(|| { + let views = xr_instance + .enumerate_view_configuration_views(system, VIEW_TYPE) + .unwrap(); + debug_assert_eq!(views.len(), VIEW_COUNT as usize); + debug_assert_eq!(views[0], views[1]); + + let resolution = vk::Extent2D { + width: views[0].recommended_image_rect_width, + height: views[0].recommended_image_rect_height, + }; + log::info!( + "Swapchain resolution: {}x{}", + resolution.width, + resolution.height + ); + let swapchain = session + .create_swapchain(&xr::SwapchainCreateInfo { + create_flags: xr::SwapchainCreateFlags::EMPTY, + usage_flags: xr::SwapchainUsageFlags::COLOR_ATTACHMENT + | xr::SwapchainUsageFlags::SAMPLED, + format: state.graphics.native_format as _, + sample_count: 1, + width: resolution.width, + height: resolution.height, + face_count: 1, + array_size: VIEW_COUNT, + mip_count: 1, + }) + .unwrap(); + + // thanks @yshui + let swapchain_images = swapchain + .enumerate_images() + .unwrap() + .into_iter() + .map(|handle| { + let vk_image = vk::Image::from_raw(handle); + let raw_image = unsafe { + vulkano::image::sys::RawImage::from_handle( + state.graphics.device.clone(), + vk_image, + ImageCreateInfo { + format: state.graphics.native_format, + extent: [resolution.width * 2, resolution.height, 1], + usage: ImageUsage::COLOR_ATTACHMENT | ImageUsage::TRANSFER_DST, + ..Default::default() + }, + ) + .unwrap() + }; + // SAFETY: OpenXR guarantees that the image is a swapchain image, thus has memory backing it. + let image = Arc::new(unsafe { raw_image.assume_bound() }); + let view = ImageView::new_default(image).unwrap(); + let fb = Framebuffer::new( + todo!(), + FramebufferCreateInfo { + attachments: vec![view.clone()], + ..Default::default() + }, + ) + .unwrap(); + + XrFramebuffer { + framebuffer: fb, + color: view, + } + }) + .collect(); + + XrSwapchain { + handle: swapchain, + buffers: swapchain_images, + resolution: [resolution.width, resolution.height, 1], + } + }); + + let image_index = swapchain.handle.acquire_image().unwrap(); + } + + Ok(()) +} + +fn init_xr() -> Result<(xr::Instance, xr::SystemId), anyhow::Error> { + let Ok(entry) = (unsafe { xr::Entry::load() }) else { + bail!("OpenXR Loader not found."); + }; + + let Ok(available_extensions) = entry.enumerate_extensions() else { + bail!("Failed to enumerate OpenXR extensions."); + }; + ensure!( + available_extensions.khr_vulkan_enable2, + "Missing KHR_vulkan_enable2 extension." + ); + ensure!( + available_extensions.extx_overlay, + "Missing EXTX_overlay extension." + ); + + let mut enabled_extensions = xr::ExtensionSet::default(); + enabled_extensions.khr_vulkan_enable2 = true; + enabled_extensions.extx_overlay = true; + + #[cfg(not(debug_assertions))] + let layers = []; + #[cfg(debug_assertions)] + let layers = [ + "XR_APILAYER_LUNARG_api_dump", + "XR_APILAYER_LUNARG_standard_validation", + ]; + + let Ok(xr_instance) = entry.create_instance( + &xr::ApplicationInfo { + application_name: "wlx-overlay-s", + application_version: 0, + engine_name: "wlx-overlay-s", + engine_version: 0, + }, + &enabled_extensions, + &layers, + ) else { + bail!("Failed to create OpenXR instance."); + }; + + let Ok(instance_props) = xr_instance.properties() else { + bail!("Failed to query OpenXR instance properties."); + }; + log::info!( + "Using OpenXR runtime: {} {}", + instance_props.runtime_name, + instance_props.runtime_version + ); + + let Ok(system) = xr_instance.system(xr::FormFactor::HEAD_MOUNTED_DISPLAY) else { + bail!("Failed to access OpenXR HMD system."); + }; + + let vk_target_version_xr = xr::Version::new(1, 1, 0); + + let Ok(reqs) = xr_instance.graphics_requirements::(system) else { + bail!("Failed to query OpenXR Vulkan requirements."); + }; + + if vk_target_version_xr < reqs.min_api_version_supported + || vk_target_version_xr.major() > reqs.max_api_version_supported.major() + { + bail!( + "OpenXR runtime requires Vulkan version > {}, < {}.0.0", + reqs.min_api_version_supported, + reqs.max_api_version_supported.major() + 1 + ); + } + + Ok((xr_instance, system)) +} + +struct XrSwapchain { + handle: xr::Swapchain, + buffers: Vec, + resolution: [u32; 3], +} + +struct XrFramebuffer { + framebuffer: Arc, + color: Arc, +} + +fn hmd_pose_from_views(views: &Vec) -> Affine3A { + let pos = { + let pos0: Vec3 = unsafe { std::mem::transmute(views[0].pose.position) }; + let pos1: Vec3 = unsafe { std::mem::transmute(views[1].pose.position) }; + (pos0 + pos1) * 0.5 + }; + let rot = { + let rot0 = unsafe { std::mem::transmute(views[0].pose.orientation) }; + let rot1 = unsafe { std::mem::transmute(views[1].pose.orientation) }; + quat_lerp(rot0, rot1, 0.5) + }; + + Affine3A::from_rotation_translation(rot, pos) +} + +fn quat_lerp(a: Quat, mut b: Quat, t: f32) -> Quat { + let l2 = a.dot(b); + if l2 < 0.0 { + b = -b; + } + + Quat::from_xyzw( + a.x - t * (a.x - b.x), + a.y - t * (a.y - b.y), + a.z - t * (a.z - b.z), + a.w - t * (a.w - b.w), + ) + .normalize() +} diff --git a/src/backend/openxr/overlay.rs b/src/backend/openxr/overlay.rs new file mode 100644 index 0000000..1a61da3 --- /dev/null +++ b/src/backend/openxr/overlay.rs @@ -0,0 +1,7 @@ +pub struct OpenXrOverlayData {} + +impl Default for OpenXrOverlayData { + fn default() -> Self { + Self {} + } +} diff --git a/src/graphics.rs b/src/graphics.rs index 5b13973..38fe76c 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -6,7 +6,7 @@ use std::{ sync::Arc, }; -use ash::vk::SubmitInfo; +use ash::vk::{self, SubmitInfo}; use smallvec::{smallvec, SmallVec}; use vulkano::{ buffer::{ @@ -15,15 +15,14 @@ use vulkano::{ }, command_buffer::{ allocator::{StandardCommandBufferAllocator, StandardCommandBufferAllocatorCreateInfo}, - sys::{CommandBufferBeginInfo, UnsafeCommandBufferBuilder}, - AutoCommandBufferBuilder, CommandBufferExecFuture, CommandBufferInheritanceInfo, + sys::{CommandBufferBeginInfo, RawRecordingCommandBuffer}, + CommandBuffer, CommandBufferExecFuture, CommandBufferInheritanceInfo, CommandBufferInheritanceRenderPassInfo, CommandBufferInheritanceRenderPassType, - CommandBufferLevel, CommandBufferUsage, CopyBufferToImageInfo, PrimaryAutoCommandBuffer, - PrimaryCommandBufferAbstract, RenderPassBeginInfo, SecondaryAutoCommandBuffer, - SubpassBeginInfo, SubpassContents, SubpassEndInfo, + CommandBufferLevel, CommandBufferUsage, CopyBufferToImageInfo, RecordingCommandBuffer, + RenderPassBeginInfo, SubpassBeginInfo, SubpassContents, SubpassEndInfo, }, descriptor_set::{ - allocator::StandardDescriptorSetAllocator, PersistentDescriptorSet, WriteDescriptorSet, + allocator::StandardDescriptorSetAllocator, DescriptorSet, WriteDescriptorSet, }, device::{ physical::{PhysicalDevice, PhysicalDeviceType}, @@ -34,8 +33,8 @@ use vulkano::{ sampler::{Filter, Sampler, SamplerAddressMode, SamplerCreateInfo}, sys::RawImage, view::ImageView, - Image, ImageCreateInfo, ImageLayout, ImageTiling, ImageType, ImageUsage, SampleCount, - SubresourceLayout, + Image, ImageCreateFlags, ImageCreateInfo, ImageLayout, ImageTiling, ImageType, ImageUsage, + SampleCount, SubresourceLayout, }, instance::{Instance, InstanceCreateFlags, InstanceCreateInfo, InstanceExtensions}, memory::{ @@ -65,19 +64,15 @@ use vulkano::{ SubpassDescription, }, shader::ShaderModule, - swapchain::{CompositeAlpha, Surface, Swapchain, SwapchainCreateInfo}, sync::{ fence::Fence, future::NowFuture, AccessFlags, DependencyInfo, GpuFuture, ImageMemoryBarrier, PipelineStages, }, DeviceSize, VulkanLibrary, VulkanObject, }; -use winit::{ - event_loop::EventLoop, - window::{Window, WindowBuilder}, -}; use wlx_capture::frame::{ - DmabufFrame, DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB8888, DRM_FORMAT_XBGR8888, DRM_FORMAT_XRGB8888, + DmabufFrame, FourCC, DRM_FORMAT_ABGR8888, DRM_FORMAT_ARGB8888, DRM_FORMAT_XBGR8888, + DRM_FORMAT_XRGB8888, }; #[repr(C)] @@ -96,7 +91,7 @@ pub struct WlxGraphics { pub device: Arc, pub queue: Arc, - pub surface: Arc, + pub native_format: Format, pub memory_allocator: Arc, pub command_buffer_allocator: Arc, @@ -107,38 +102,155 @@ pub struct WlxGraphics { } impl WlxGraphics { + #[cfg(feature = "openxr")] + pub fn new_xr(xr_instance: openxr::Instance, system: openxr::SystemId) -> Arc { + use vulkano::Handle; + + let vk_target_version = vk::make_api_version(0, 1, 1, 0); // Vulkan 1.1 guarantees multiview support + let target_version = vulkano::Version::V1_1; + let library = VulkanLibrary::new().unwrap(); + let vk_entry = unsafe { ash::Entry::load().unwrap() }; + + let vk_app_info = vk::ApplicationInfo::builder() + .application_version(0) + .engine_version(0) + .api_version(vk_target_version); + + let instance = unsafe { + let vk_instance = xr_instance + .create_vulkan_instance( + system, + std::mem::transmute(vk_entry.static_fn().get_instance_proc_addr), + &vk::InstanceCreateInfo::builder().application_info(&vk_app_info) as *const _ + as *const _, + ) + .expect("XR error creating Vulkan instance") + .map_err(vk::Result::from_raw) + .expect("Vulkan error creating Vulkan instance"); + + Instance::from_handle( + library, + ash::vk::Instance::from_raw(vk_instance as _), + InstanceCreateInfo::default(), // FIXME + ) + }; + + let physical_device = unsafe { + PhysicalDevice::from_handle( + instance.clone(), + vk::PhysicalDevice::from_raw( + xr_instance + .vulkan_graphics_device(system, instance.handle().as_raw() as _) + .unwrap() as _, + ), + ) + } + .unwrap(); + + let vk_device_properties = physical_device.properties(); + if vk_device_properties.api_version < target_version { + panic!( + "Vulkan physical device doesn't support Vulkan {}", + target_version + ); + } + + log::info!( + "Using vkPhysicalDevice: {}", + physical_device.properties().device_name, + ); + + let queue_family_index = physical_device + .queue_family_properties() + .iter() + .enumerate() + .position(|(_, q)| q.queue_flags.intersects(QueueFlags::GRAPHICS)) + .expect("Vulkan device has no graphics queue") as u32; + + let (device, mut queues) = unsafe { + let vk_device = xr_instance + .create_vulkan_device( + system, + std::mem::transmute(vk_entry.static_fn().get_instance_proc_addr), + physical_device.handle().as_raw() as _, + &vk::DeviceCreateInfo::builder() + .queue_create_infos(&[vk::DeviceQueueCreateInfo::builder() + .queue_family_index(queue_family_index) + .queue_priorities(&[1.0]) + .build()]) + .push_next(&mut vk::PhysicalDeviceMultiviewFeatures { + multiview: vk::TRUE, + ..Default::default() + }) as *const _ as *const _, + ) + .expect("XR error creating Vulkan device") + .map_err(vk::Result::from_raw) + .expect("Vulkan error creating Vulkan device"); + + vulkano::device::Device::from_handle( + physical_device, + vk::Device::from_raw(vk_device as _), + DeviceCreateInfo::default(), // FIXME + ) + }; + + let queue = queues.next().unwrap(); + + let memory_allocator = Arc::new(StandardMemoryAllocator::new_default(device.clone())); + let command_buffer_allocator = Arc::new(StandardCommandBufferAllocator::new( + device.clone(), + StandardCommandBufferAllocatorCreateInfo { + secondary_buffer_count: 32, + ..Default::default() + }, + )); + let descriptor_set_allocator = Arc::new(StandardDescriptorSetAllocator::new( + device.clone(), + Default::default(), + )); + + let (quad_verts, quad_indices) = Self::default_quad(memory_allocator.clone()); + + let me = Self { + instance, + device, + queue, + native_format: Format::R8G8B8A8_UNORM, + memory_allocator, + command_buffer_allocator, + descriptor_set_allocator, + quad_indices, + quad_verts, + }; + + Arc::new(me) + } + pub fn new( vk_instance_extensions: InstanceExtensions, mut vk_device_extensions_fn: impl FnMut(&PhysicalDevice) -> DeviceExtensions, - ) -> (Arc, EventLoop<()>) { + ) -> Arc { #[cfg(debug_assertions)] let layers = vec!["VK_LAYER_KHRONOS_validation".to_owned()]; #[cfg(not(debug_assertions))] let layers = vec![]; - // TODO headless - let event_loop = EventLoop::new(); - let library_extensions = Surface::required_extensions(&event_loop); - let library = VulkanLibrary::new().unwrap(); - let required_extensions = library_extensions.union(&vk_instance_extensions); - log::debug!("Instance exts for app: {:?}", &required_extensions); log::debug!("Instance exts for runtime: {:?}", &vk_instance_extensions); let instance = Instance::new( library, InstanceCreateInfo { flags: InstanceCreateFlags::ENUMERATE_PORTABILITY, - enabled_extensions: required_extensions, + enabled_extensions: vk_instance_extensions, enabled_layers: layers, ..Default::default() }, ) .unwrap(); - let mut device_extensions = DeviceExtensions { - khr_swapchain: true, + let device_extensions = DeviceExtensions { khr_external_memory: true, khr_external_memory_fd: true, ext_external_memory_dma_buf: true, @@ -148,10 +260,6 @@ impl WlxGraphics { log::debug!("Device exts for app: {:?}", &device_extensions); - // TODO headless - let window = Arc::new(WindowBuilder::new().build(&event_loop).unwrap()); - let surface = Surface::from_window(instance.clone(), window.clone()).unwrap(); - let (physical_device, my_extensions, queue_family_index) = instance .enumerate_physical_devices() .unwrap() @@ -176,10 +284,7 @@ impl WlxGraphics { p.queue_family_properties() .iter() .enumerate() - .position(|(i, q)| { - q.queue_flags.intersects(QueueFlags::GRAPHICS) - && p.surface_support(i as u32, &surface).unwrap_or(false) - }) + .position(|(_, q)| q.queue_flags.intersects(QueueFlags::GRAPHICS)) .map(|i| (p, my_extensions, i as u32)) }) .min_by_key(|(p, _, _)| match p.properties().device_type { @@ -233,6 +338,26 @@ impl WlxGraphics { Default::default(), )); + let (quad_verts, quad_indices) = Self::default_quad(memory_allocator.clone()); + + let me = Self { + instance, + device, + queue, + memory_allocator, + native_format: Format::R8G8B8A8_UNORM, + command_buffer_allocator, + descriptor_set_allocator, + quad_indices, + quad_verts, + }; + + Arc::new(me) + } + + fn default_quad( + memory_allocator: Arc, + ) -> (Subbuffer<[Vert2Uv]>, Subbuffer<[u16]>) { let vertices = [ Vert2Uv { in_pos: [0., 0.], @@ -267,7 +392,7 @@ impl WlxGraphics { .unwrap(); let quad_indices = Buffer::from_iter( - memory_allocator.clone(), + memory_allocator, BufferCreateInfo { usage: BufferUsage::INDEX_BUFFER, ..Default::default() @@ -281,72 +406,7 @@ impl WlxGraphics { ) .unwrap(); - let me = Self { - instance, - device, - queue, - surface, - memory_allocator, - command_buffer_allocator, - descriptor_set_allocator, - quad_indices, - quad_verts, - }; - - (Arc::new(me), event_loop) - } - - #[allow(dead_code)] - pub fn create_swapchain(&self, format: Option) -> (Arc, Vec>) { - let (min_image_count, composite_alpha, image_format) = if let Some(format) = format { - (1, CompositeAlpha::Opaque, format) - } else { - let surface_capabilities = self - .device - .physical_device() - .surface_capabilities(&self.surface, Default::default()) - .unwrap(); - - let composite_alpha = surface_capabilities - .supported_composite_alpha - .into_iter() - .next() - .unwrap(); - - let image_format = Some( - self.device - .physical_device() - .surface_formats(&self.surface, Default::default()) - .unwrap()[0] - .0, - ); - ( - surface_capabilities.min_image_count, - composite_alpha, - image_format.unwrap(), - ) - }; - let window = self - .surface - .object() - .unwrap() - .downcast_ref::() - .unwrap(); - let swapchain = Swapchain::new( - self.device.clone(), - self.surface.clone(), - SwapchainCreateInfo { - min_image_count, - image_format, - image_extent: window.inner_size().into(), - image_usage: ImageUsage::COLOR_ATTACHMENT, - composite_alpha, - ..Default::default() - }, - ) - .unwrap(); - - swapchain + (quad_verts, quad_indices) } pub fn upload_verts( @@ -411,13 +471,7 @@ impl WlxGraphics { pub fn dmabuf_texture(&self, frame: DmabufFrame) -> Option> { let extent = [frame.format.width, frame.format.height, 1]; - let format = match frame.format.fourcc { - DRM_FORMAT_ABGR8888 => Format::R8G8B8A8_UNORM, - DRM_FORMAT_XBGR8888 => Format::R8G8B8A8_UNORM, - DRM_FORMAT_ARGB8888 => Format::B8G8R8A8_UNORM, - DRM_FORMAT_XRGB8888 => Format::B8G8R8A8_UNORM, - _ => panic!("Unsupported dmabuf format {:x}", frame.format.fourcc), - }; + let format = fourcc_to_vk(frame.format.fourcc); let layouts: Vec = (0..frame.num_planes) .into_iter() @@ -435,6 +489,12 @@ impl WlxGraphics { let external_memory_handle_types = ExternalMemoryHandleTypes::DMA_BUF; + let flags = if frame.num_planes > 9 { + ImageCreateFlags::DISJOINT + } else { + ImageCreateFlags::empty() + }; + let image = RawImage::new( self.device.clone(), ImageCreateInfo { @@ -444,6 +504,7 @@ impl WlxGraphics { usage: ImageUsage::SAMPLED | ImageUsage::TRANSFER_SRC, external_memory_handle_types, tiling: ImageTiling::DrmFormatModifier, + flags, drm_format_modifiers: vec![frame.format.modifier], drm_format_modifier_plane_layouts: layouts, ..Default::default() @@ -464,11 +525,9 @@ impl WlxGraphics { debug_assert!(self.device.enabled_extensions().khr_external_memory); debug_assert!(self.device.enabled_extensions().ext_external_memory_dma_buf); - let memory = unsafe { - if frame.num_planes != 1 { - log::error!("Unsupported number of DMA-buf planes: {}", frame.num_planes); - return None; - } + let mut allocations: SmallVec<[ResourceMemory; 4]> = smallvec![]; + + unsafe { let Some(fd) = frame.planes[0].fd else { log::error!("DMA-buf plane has no FD"); return None; @@ -478,7 +537,7 @@ impl WlxGraphics { let new_file = file.try_clone().unwrap(); file.into_raw_fd(); - DeviceMemory::import( + let memory = DeviceMemory::import( self.device.clone(), MemoryAllocateInfo { allocation_size: requirements.layout.size(), @@ -491,16 +550,17 @@ impl WlxGraphics { handle_type: ExternalMemoryHandleType::DmaBuf, }, ) - .unwrap() - }; + .unwrap(); - let allocations: SmallVec<[ResourceMemory; 1]> = - smallvec![ResourceMemory::new_dedicated(memory)]; + allocations.push(ResourceMemory::new_dedicated(memory)); + } - if let Some(image) = image.bind_memory(allocations).ok() { - Some(Arc::new(image)) - } else { - None + match unsafe { image.bind_memory(allocations) } { + Ok(image) => Some(Arc::new(image)), + Err(e) => { + log::warn!("Failed to bind memory to image: {}", e.0.to_string()); + return None; + } } } @@ -558,10 +618,15 @@ impl WlxGraphics { } pub fn create_command_buffer(self: &Arc, usage: CommandBufferUsage) -> WlxCommandBuffer { - let command_buffer = AutoCommandBufferBuilder::primary( - &self.command_buffer_allocator, + let command_buffer = RecordingCommandBuffer::new( + self.command_buffer_allocator.clone(), self.queue.queue_family_index(), - usage, + CommandBufferLevel::Primary, + CommandBufferBeginInfo { + usage, + inheritance_info: None, + ..Default::default() + }, ) .unwrap(); WlxCommandBuffer { @@ -588,8 +653,8 @@ impl WlxGraphics { }; let command_buffer = unsafe { - let mut builder = UnsafeCommandBufferBuilder::new( - &self.command_buffer_allocator, + let mut builder = RawRecordingCommandBuffer::new( + self.command_buffer_allocator.clone(), self.queue.queue_family_index(), CommandBufferLevel::Primary, CommandBufferBeginInfo { @@ -606,7 +671,7 @@ impl WlxGraphics { ..Default::default() }) .unwrap(); - builder.build().unwrap() + builder.end().unwrap() }; let fence = vulkano::sync::fence::Fence::new( @@ -636,10 +701,7 @@ impl WlxGraphics { pub struct WlxCommandBuffer { graphics: Arc, - command_buffer: AutoCommandBufferBuilder< - PrimaryAutoCommandBuffer>, - Arc, - >, + command_buffer: RecordingCommandBuffer, } impl WlxCommandBuffer { @@ -672,7 +734,7 @@ impl WlxCommandBuffer { width: u32, height: u32, format: Format, - data: Vec, + data: &[u8], ) -> Arc { let image = Image::new( self.graphics.memory_allocator.clone(), @@ -702,7 +764,7 @@ impl WlxCommandBuffer { ) .unwrap(); - buffer.write().unwrap().copy_from_slice(data.as_slice()); + buffer.write().unwrap().copy_from_slice(data); self.command_buffer .copy_buffer_to_image(CopyBufferToImageInfo::buffer_image(buffer, image.clone())) @@ -722,7 +784,7 @@ impl WlxCommandBuffer { let mut image_data = Vec::new(); image_data.resize((info.width * info.height * 4) as usize, 0); reader.next_frame(&mut image_data).unwrap(); - self.texture2d(width, height, Format::R8G8B8A8_UNORM, image_data) + self.texture2d(width, height, Format::R8G8B8A8_UNORM, &image_data) } } @@ -734,8 +796,8 @@ impl WlxCommandBuffer { self } - pub fn build(self) -> Arc>> { - self.command_buffer.build().unwrap() + pub fn build(self) -> Arc { + self.command_buffer.end().unwrap() } pub fn build_and_execute(self) -> CommandBufferExecFuture { @@ -894,6 +956,12 @@ impl WlxPipeline { } } + pub fn swap_framebuffer(&mut self, new_framebuffer: Arc) -> Arc { + let old = self.framebuffer.clone(); + self.framebuffer = new_framebuffer; + old + } + pub fn inner(&self) -> Arc { self.pipeline.clone() } @@ -903,7 +971,7 @@ impl WlxPipeline { set: usize, texture: Arc, filter: Filter, - ) -> Arc { + ) -> Arc { let sampler = Sampler::new( self.graphics.device.clone(), SamplerCreateInfo { @@ -917,8 +985,8 @@ impl WlxPipeline { let layout = self.pipeline.layout().set_layouts().get(set).unwrap(); - PersistentDescriptorSet::new( - &self.graphics.descriptor_set_allocator, + DescriptorSet::new( + self.graphics.descriptor_set_allocator.clone(), layout.clone(), [WriteDescriptorSet::image_view_sampler(0, texture, sampler)], [], @@ -926,7 +994,7 @@ impl WlxPipeline { .unwrap() } - pub fn uniform_buffer(&self, set: usize, data: Vec) -> Arc + pub fn uniform_buffer(&self, set: usize, data: Vec) -> Arc where T: BufferContents + Copy, { @@ -947,8 +1015,8 @@ impl WlxPipeline { }; let layout = self.pipeline.layout().set_layouts().get(set).unwrap(); - PersistentDescriptorSet::new( - &self.graphics.descriptor_set_allocator, + DescriptorSet::new( + self.graphics.descriptor_set_allocator.clone(), layout.clone(), [WriteDescriptorSet::buffer(0, uniform_buffer_subbuffer)], [], @@ -961,7 +1029,7 @@ impl WlxPipeline { dimensions: [f32; 2], vertex_buffer: Subbuffer<[Vert2Uv]>, index_buffer: Subbuffer<[u16]>, - descriptor_sets: Vec>, + descriptor_sets: Vec>, ) -> WlxPass { WlxPass::new( self.clone(), @@ -978,8 +1046,8 @@ pub struct WlxPass { pipeline: Arc, vertex_buffer: Subbuffer<[Vert2Uv]>, index_buffer: Subbuffer<[u16]>, - descriptor_sets: Vec>, - pub command_buffer: Arc>>, + descriptor_sets: Vec>, + pub command_buffer: Arc, } impl WlxPass { @@ -988,7 +1056,7 @@ impl WlxPass { dimensions: [f32; 2], vertex_buffer: Subbuffer<[Vert2Uv]>, index_buffer: Subbuffer<[u16]>, - descriptor_sets: Vec>, + descriptor_sets: Vec>, ) -> Self { let viewport = Viewport { offset: [0.0, 0.0], @@ -997,53 +1065,69 @@ impl WlxPass { }; let pipeline_inner = pipeline.inner().clone(); - let mut command_buffer = AutoCommandBufferBuilder::secondary( - &pipeline.graphics.command_buffer_allocator, + let mut command_buffer = RecordingCommandBuffer::new( + pipeline.graphics.command_buffer_allocator.clone(), pipeline.graphics.queue.queue_family_index(), - CommandBufferUsage::MultipleSubmit, - CommandBufferInheritanceInfo { - render_pass: Some(CommandBufferInheritanceRenderPassType::BeginRenderPass( - CommandBufferInheritanceRenderPassInfo { - subpass: Subpass::from(pipeline.render_pass.clone(), 0).unwrap(), - framebuffer: None, - }, - )), + CommandBufferLevel::Secondary, + CommandBufferBeginInfo { + usage: CommandBufferUsage::MultipleSubmit, + inheritance_info: Some(CommandBufferInheritanceInfo { + render_pass: Some(CommandBufferInheritanceRenderPassType::BeginRenderPass( + CommandBufferInheritanceRenderPassInfo { + subpass: Subpass::from(pipeline.render_pass.clone(), 0).unwrap(), + framebuffer: None, + }, + )), + ..Default::default() + }), ..Default::default() }, ) .unwrap(); - command_buffer - .set_viewport(0, smallvec![viewport]) - .unwrap() - .bind_pipeline_graphics(pipeline_inner) - .unwrap() - .bind_descriptor_sets( - PipelineBindPoint::Graphics, - pipeline.inner().layout().clone(), - 0, - descriptor_sets.clone(), - ) - .unwrap() - .bind_vertex_buffers(0, vertex_buffer.clone()) - .unwrap() - .bind_index_buffer(index_buffer.clone()) - .unwrap() - .draw_indexed(index_buffer.len() as u32, 1, 0, 0, 0) - .or_else(|err| { - if let Some(source) = err.source() { - log::error!("Failed to draw: {}", source); - } - Err(err) - }) - .unwrap(); + unsafe { + command_buffer + .set_viewport(0, smallvec![viewport]) + .unwrap() + .bind_pipeline_graphics(pipeline_inner) + .unwrap() + .bind_descriptor_sets( + PipelineBindPoint::Graphics, + pipeline.inner().layout().clone(), + 0, + descriptor_sets.clone(), + ) + .unwrap() + .bind_vertex_buffers(0, vertex_buffer.clone()) + .unwrap() + .bind_index_buffer(index_buffer.clone()) + .unwrap() + .draw_indexed(index_buffer.len() as u32, 1, 0, 0, 0) + .or_else(|err| { + if let Some(source) = err.source() { + log::error!("Failed to draw: {}", source); + } + Err(err) + }) + .unwrap() + }; Self { pipeline, vertex_buffer, index_buffer, descriptor_sets, - command_buffer: command_buffer.build().unwrap(), + command_buffer: command_buffer.end().unwrap(), } } } + +pub fn fourcc_to_vk(fourcc: FourCC) -> Format { + match fourcc.value { + DRM_FORMAT_ABGR8888 => Format::R8G8B8A8_UNORM, + DRM_FORMAT_XBGR8888 => Format::R8G8B8A8_UNORM, + DRM_FORMAT_ARGB8888 => Format::B8G8R8A8_UNORM, + DRM_FORMAT_XRGB8888 => Format::B8G8R8A8_UNORM, + _ => panic!("Unsupported memfd format {}", fourcc), + } +} diff --git a/src/gui/font.rs b/src/gui/font.rs index 316e3f5..f45aa57 100644 --- a/src/gui/font.rs +++ b/src/gui/font.rs @@ -201,7 +201,7 @@ impl FontCache { }; let mut cmd_buffer = graphics.create_command_buffer(CommandBufferUsage::OneTimeSubmit); - let texture = cmd_buffer.texture2d(bmp.width() as _, bmp.rows() as _, format, buf); + let texture = cmd_buffer.texture2d(bmp.width() as _, bmp.rows() as _, format, &buf); cmd_buffer.build_and_execute_now(); let g = Glyph { diff --git a/src/main.rs b/src/main.rs index 6b62fcc..ca8a97d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,7 +7,11 @@ mod overlays; mod shaders; mod state; -use crate::backend::openvr::openvr_run; +use std::sync::{ + atomic::{AtomicBool, Ordering}, + Arc, +}; + use env_logger::Env; fn main() { @@ -18,5 +22,40 @@ fn main() { env!("CARGO_PKG_VERSION") ); - openvr_run(); + let running = Arc::new(AtomicBool::new(true)); + let _ = ctrlc::set_handler({ + let running = running.clone(); + move || { + running.store(false, Ordering::Relaxed); + } + }); + + #[cfg(all(feature = "openxr", feature = "openvr"))] + auto_run(running); + + #[cfg(all(feature = "openvr", not(feature = "openxr")))] + crate::backend::openvr::openvr_run(running); + + #[cfg(all(feature = "openxr", not(feature = "openvr")))] + crate::backend::openxr::openxr_run(running); + + #[cfg(not(any(feature = "openxr", feature = "openvr")))] + compile_error!("You must enable at least one backend feature (openxr or openvr)"); +} + +#[cfg(all(feature = "openxr", feature = "openvr"))] +fn auto_run(running: Arc) { + use crate::backend::openvr::openvr_run; + use crate::backend::openxr::openxr_run; + use backend::common::BackendError; + + let Err(BackendError::NotSupported) = openxr_run(running.clone()) else { + return; + }; + + let Err(BackendError::NotSupported) = openvr_run(running) else { + return; + }; + + log::error!("No supported backends found"); } diff --git a/src/overlays/screen.rs b/src/overlays/screen.rs index ec1bf60..aef2586 100644 --- a/src/overlays/screen.rs +++ b/src/overlays/screen.rs @@ -1,8 +1,11 @@ +use core::slice; use std::{ f32::consts::PI, path::Path, + ptr, sync::{mpsc::Receiver, Arc}, time::{Duration, Instant}, + usize, }; use vulkano::{ buffer::Subbuffer, @@ -27,7 +30,7 @@ use crate::{ input::{InteractionHandler, PointerHit, PointerMode}, overlay::{OverlayData, OverlayRenderer, OverlayState, SplitOverlayBackend}, }, - graphics::{Vert2Uv, WlxGraphics, WlxPipeline}, + graphics::{fourcc_to_vk, Vert2Uv, WlxGraphics, WlxPipeline}, hid::{MOUSE_LEFT, MOUSE_MIDDLE, MOUSE_RIGHT}, shaders::{frag_screen, vert_common}, state::{AppSession, AppState}, @@ -116,17 +119,21 @@ impl ScreenPipeline { let vertex_buffer = graphics.upload_verts(dim[0] as _, dim[1] as _, 0.0, 0.0, dim[0] as _, dim[1] as _); - let render_texture = graphics.render_texture(dim[0], dim[1], Format::R8G8B8A8_UNORM); + // TODO make this a setting + let render_w = dim[0].min(1920); + let render_h = (dim[1] as f32 / dim[0] as f32 * render_w as f32) as u32; + + let render_texture = graphics.render_texture(render_w, render_h, Format::R8G8B8A8_UNORM); let view = ImageView::new_default(render_texture).unwrap(); - let pipeline = graphics.create_pipeline_with_layouts( + let pipeline = graphics.create_pipeline( view, vert_common::load(graphics.device.clone()).unwrap(), frag_screen::load(graphics.device.clone()).unwrap(), Format::R8G8B8A8_UNORM, - ImageLayout::ColorAttachmentOptimal, - ImageLayout::ColorAttachmentOptimal, + // ImageLayout::TransferSrcOptimal, + // ImageLayout::TransferSrcOptimal, ); Self { @@ -141,6 +148,15 @@ impl ScreenPipeline { return; } + self.graphics + .transition_layout( + self.pipeline.view.image().clone(), + ImageLayout::TransferSrcOptimal, + ImageLayout::General, + ) + .wait(None) + .unwrap(); + let mut command_buffer = self .graphics .create_command_buffer(CommandBufferUsage::OneTimeSubmit) @@ -168,6 +184,15 @@ impl ScreenPipeline { exec.flush().unwrap(); exec.cleanup_finished(); } + + self.graphics + .transition_layout( + self.pipeline.view.image().clone(), + ImageLayout::General, + ImageLayout::TransferSrcOptimal, + ) + .wait(None) + .unwrap(); } pub(super) fn view(&self) -> Arc { @@ -228,6 +253,10 @@ impl OverlayRenderer for ScreenRenderer { for frame in receiver.try_iter() { match frame { WlxFrame::Dmabuf(frame) => { + if !frame.is_valid() { + log::error!("Invalid frame"); + continue; + } if let Some(new) = app.graphics.dmabuf_texture(frame) { let pipeline = self .pipeline @@ -237,11 +266,55 @@ impl OverlayRenderer for ScreenRenderer { self.last_image = Some(pipeline.view()); } } - WlxFrame::MemFd(_frame) => { - todo!() + WlxFrame::MemFd(frame) => { + let mut upload = app + .graphics + .create_command_buffer(CommandBufferUsage::OneTimeSubmit); + + let Some(fd) = frame.plane.fd else { + log::error!("No fd"); + continue; + }; + let format = fourcc_to_vk(frame.format.fourcc); + + let len = frame.plane.stride as usize * frame.format.height as usize; + let offset = frame.plane.offset as i64; + + let map = unsafe { + libc::mmap( + ptr::null_mut(), + len, + libc::PROT_READ, + libc::MAP_SHARED, + fd, + offset, + ) + } as *const u8; + + let data = unsafe { slice::from_raw_parts(map, len) }; + + let image = + upload.texture2d(frame.format.width, frame.format.height, format, &data); + upload.build_and_execute_now(); + + unsafe { libc::munmap(map as *mut _, len) }; + + self.last_image = Some(ImageView::new_default(image).unwrap()); } - WlxFrame::MemPtr(_frame) => { - todo!() + WlxFrame::MemPtr(frame) => { + let mut upload = app + .graphics + .create_command_buffer(CommandBufferUsage::OneTimeSubmit); + let format = fourcc_to_vk(frame.format.fourcc); + + let len = frame.format.width as usize * frame.format.height as usize; + let data = unsafe { slice::from_raw_parts(frame.ptr as *const u8, len) }; + + let image = + upload.texture2d(frame.format.width, frame.format.height, format, &data); + upload.build_and_execute_now(); + + self.last_image = Some(ImageView::new_default(image).unwrap()); } _ => {} }; @@ -278,7 +351,7 @@ where if session.capture_method == "auto" && wl.maybe_wlr_dmabuf_mgr.is_some() { log::info!("{}: Using Wlr DMA-Buf", &output.name); - capture = ScreenRenderer::new_wlr(output); + //capture = ScreenRenderer::new_wlr(output); } if capture.is_none() { diff --git a/src/state.rs b/src/state.rs index 8f78c32..00d926c 100644 --- a/src/state.rs +++ b/src/state.rs @@ -1,11 +1,7 @@ use std::{env::VarError, path::Path, sync::Arc}; use glam::{Quat, Vec3}; -use vulkano::{ - device::{physical::PhysicalDevice, DeviceExtensions}, - format::Format, - instance::InstanceExtensions, -}; +use vulkano::format::Format; use crate::{ backend::{common::TaskContainer, input::InputState}, @@ -28,18 +24,12 @@ pub struct AppState { } impl AppState { - pub fn new( - vk_instance_extensions: InstanceExtensions, - vk_device_extensions_fn: impl FnMut(&PhysicalDevice) -> DeviceExtensions, - ) -> Self { - let (graphics, _event_loop) = - WlxGraphics::new(vk_instance_extensions, vk_device_extensions_fn); - + pub fn from_graphics(graphics: Arc) -> Self { AppState { fc: FontCache::new(), session: AppSession::load(), tasks: TaskContainer::new(), - graphics: graphics.clone(), + graphics, format: Format::R8G8B8A8_UNORM, input_state: InputState::new(), hid_provider: crate::hid::initialize(),