From 7c4ee8e37b37c14b7d994c17076c1a7350035181 Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Tue, 4 Oct 2022 10:08:48 +0300 Subject: [PATCH 1/2] Update wgpu (and ash, to avoid duplicate deps). --- Cargo.lock | 846 +++++++++++++++----------- examples/runners/ash/Cargo.toml | 13 +- examples/runners/ash/src/main.rs | 22 +- examples/runners/wgpu/Cargo.toml | 6 +- examples/runners/wgpu/src/compute.rs | 84 ++- examples/runners/wgpu/src/graphics.rs | 159 +++-- 6 files changed, 656 insertions(+), 474 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 276e74c0df..6a12026240 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,31 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "ab_glyph" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe21446ad43aa56417a767f3e2f3d7c4ca522904de1dd640529a76e9c5c3b33c" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" + +[[package]] +name = "addr2line" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a76fd60b23679b7d19bd066031410fb7e458ccc5e958eb5c325888ce4baedc97" +dependencies = [ + "gimli", +] + [[package]] name = "adler" version = "1.0.2" @@ -28,6 +53,39 @@ dependencies = [ "memchr", ] +[[package]] +name = "android-activity" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c77a0045eda8b888c76ea473c2b0515ba6f471d318f8927c5c72240937035a6" +dependencies = [ + "android-properties", + "bitflags", + "cc", + "jni-sys", + "libc", + "log", + "ndk", + "ndk-context", + "ndk-sys", + "num_enum", +] + +[[package]] +name = "android-properties" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "ansi_term" version = "0.12.1" @@ -49,6 +107,12 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d67af77d68a931ecd5cbd8a3b5987d63a1d1d1278f7f6a60ae33db485cdebb69" +[[package]] +name = "arrayref" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b4930d2cb77ce62f89ee5d5289b4ac049559b1c45539271f5ed4fdc7db34545" + [[package]] name = "arrayvec" version = "0.7.2" @@ -57,18 +121,18 @@ checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "ash" -version = "0.35.0+1.2.203" +version = "0.37.2+1.3.238" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a7638ce84f8c84d6fd6faa63aa267574d345181ba591c0eeb5550d4c30cd600" +checksum = "28bf19c1f0a470be5fbf7522a308a05df06610252c5bcf5143e1b23f629a9a03" dependencies = [ "libloading", ] [[package]] name = "ash-molten" -version = "0.12.0+1.1.5" +version = "0.13.1+1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46b51f10940e9e2022ff1cecbc73ba848d0edda13084f2063980546e945b0e7b" +checksum = "74f01aab261481bd870f4a4e44de72894b1721a5f9f25e5fbd79c9612d1d1605" dependencies = [ "anyhow", "ash", @@ -78,12 +142,12 @@ dependencies = [ [[package]] name = "ash-window" -version = "0.9.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2f510c6da81963f828aaaf863983bc51f223fba4e8c3f054d98c941c7e19ee7" +checksum = "b912285a7c29f3a8f87ca6f55afc48768624e5e33ec17dbd2f2075903f5e35ab" dependencies = [ "ash", - "raw-window-handle 0.3.4", + "raw-window-handle 0.5.1", "raw-window-metal", ] @@ -104,6 +168,21 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +[[package]] +name = "backtrace" +version = "0.3.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "233d376d6d185f2a3093e58f283f60f880315b6c60075b01f36b3b85154564ca" +dependencies = [ + "addr2line", + "cc", + "cfg-if", + "libc", + "miniz_oxide 0.6.2", + "object", + "rustc-demangle", +] + [[package]] name = "base64" version = "0.13.0" @@ -127,9 +206,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block" @@ -137,6 +216,25 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" +[[package]] +name = "block-sys" +version = "0.1.0-beta.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fa55741ee90902547802152aaf3f8e5248aab7e21468089560d4c8840561146" +dependencies = [ + "objc-sys", +] + +[[package]] +name = "block2" +version = "0.2.0-alpha.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8dd9e63c1744f755c2f60332b88de39d341e5e86239014ad839bd71c106dec42" +dependencies = [ + "block-sys", + "objc2-encode", +] + [[package]] name = "bumpalo" version = "3.8.0" @@ -171,12 +269,15 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "calloop" -version = "0.9.3" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82" +checksum = "595eb0438b3c6d262395fe30e6de9a61beb57ea56290b00a07f227fe6e20cbf2" dependencies = [ "log", - "nix 0.22.2", + "nix", + "slotmap", + "thiserror", + "vec_map", ] [[package]] @@ -188,12 +289,6 @@ dependencies = [ "jobserver", ] -[[package]] -name = "cfg-if" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" - [[package]] name = "cfg-if" version = "1.0.0" @@ -239,8 +334,8 @@ dependencies = [ "bitflags", "block", "cocoa-foundation", - "core-foundation 0.9.2", - "core-graphics 0.22.3", + "core-foundation", + "core-graphics", "foreign-types", "libc", "objc", @@ -254,7 +349,7 @@ checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" dependencies = [ "bitflags", "block", - "core-foundation 0.9.2", + "core-foundation", "core-graphics-types", "foreign-types", "libc", @@ -271,6 +366,12 @@ dependencies = [ "unicode-width", ] +[[package]] +name = "com-rs" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" + [[package]] name = "compiletest_rs" version = "0.9.0" @@ -323,7 +424,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen", ] @@ -337,56 +438,22 @@ dependencies = [ "web-sys", ] -[[package]] -name = "copyless" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2df960f5d869b2dd8532793fde43eb5427cceb126c929747a26823ab0eeb536" - -[[package]] -name = "core-foundation" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" -dependencies = [ - "core-foundation-sys 0.7.0", - "libc", -] - [[package]] name = "core-foundation" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" +checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" dependencies = [ - "core-foundation-sys 0.8.3", + "core-foundation-sys", "libc", ] -[[package]] -name = "core-foundation-sys" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" - [[package]] name = "core-foundation-sys" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" -[[package]] -name = "core-graphics" -version = "0.19.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" -dependencies = [ - "bitflags", - "core-foundation 0.7.0", - "foreign-types", - "libc", -] - [[package]] name = "core-graphics" version = "0.22.3" @@ -394,7 +461,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" dependencies = [ "bitflags", - "core-foundation 0.9.2", + "core-foundation", "core-graphics-types", "foreign-types", "libc", @@ -407,31 +474,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" dependencies = [ "bitflags", - "core-foundation 0.9.2", + "core-foundation", "foreign-types", "libc", ] -[[package]] -name = "core-video-sys" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" -dependencies = [ - "cfg-if 0.1.10", - "core-foundation-sys 0.7.0", - "core-graphics 0.19.2", - "libc", - "objc", -] - [[package]] name = "crc32fast" version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "738c290dfaea84fc1ca15ad9c168d083b05a714e1efddd8edaab678dc28d2836" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -440,7 +494,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "06ed27e177f16d65f0f0c22a213e17c696ace5dd64b14258b52f9417ccb52db4" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", ] @@ -450,7 +504,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-epoch", "crossbeam-utils", ] @@ -461,7 +515,7 @@ version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec02e091aa634e2c3ada4a392989e7c3116673ef0ac5b72232439094d73b7fd" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crossbeam-utils", "lazy_static", "memoffset", @@ -474,7 +528,7 @@ version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "once_cell", ] @@ -496,9 +550,8 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "d3d12" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c" +version = "0.6.0" +source = "git+https://github.com/gfx-rs/d3d12-rs?rev=b940b1d71#b940b1d71ab7083ae80eec697872672dc1f2bd32" dependencies = [ "bitflags", "libloading", @@ -507,43 +560,19 @@ dependencies = [ [[package]] name = "darling" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" -dependencies = [ - "darling_core 0.10.2", - "darling_macro 0.10.2", -] - -[[package]] -name = "darling" -version = "0.13.1" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ - "darling_core 0.13.1", - "darling_macro 0.13.1", + "darling_core", + "darling_macro", ] [[package]] name = "darling_core" -version = "0.10.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.9.3", - "syn", -] - -[[package]] -name = "darling_core" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ "fnv", "ident_case", @@ -555,22 +584,11 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" -dependencies = [ - "darling_core 0.10.2", - "quote", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.13.1" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ - "darling_core 0.13.1", + "darling_core", "quote", "syn", ] @@ -598,7 +616,7 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "dirs-sys-next", ] @@ -650,15 +668,6 @@ dependencies = [ "stable_deref_trait", ] -[[package]] -name = "encoding_rs" -version = "0.8.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dc8abb250ffdda33912550faa54c88ec8b998dec0b2c55ab224921ce11df" -dependencies = [ - "cfg-if 1.0.0", -] - [[package]] name = "env_logger" version = "0.9.0" @@ -700,8 +709,8 @@ dependencies = [ "ash", "ash-molten", "ash-window", - "cfg-if 1.0.0", - "nix 0.20.2", + "cfg-if", + "raw-window-handle 0.5.1", "shared", "spirv-builder", "structopt", @@ -723,12 +732,12 @@ name = "example-runner-wgpu" version = "0.0.0" dependencies = [ "bytemuck", - "cfg-if 1.0.0", + "cfg-if", "console_error_panic_hook", "console_log", "env_logger", "futures", - "ndk-glue 0.4.0", + "ndk-glue", "shared", "spirv-builder", "structopt", @@ -761,9 +770,9 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", - "redox_syscall", + "redox_syscall 0.2.10", "winapi", ] @@ -779,10 +788,10 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e6988e897c1c9c485f43b47a529cef42fde0547f9d8d41a7062518f1d8fc53f" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "crc32fast", "libc", - "miniz_oxide", + "miniz_oxide 0.4.4", ] [[package]] @@ -928,11 +937,17 @@ version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "libc", "wasi", ] +[[package]] +name = "gimli" +version = "0.27.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad0a93d233ebf96623465aad4046a8d3aa4da22d4f4beba5388838c8a434bbb4" + [[package]] name = "glam" version = "0.22.0" @@ -944,9 +959,9 @@ dependencies = [ [[package]] name = "glow" -version = "0.11.2" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" +checksum = "4e007a07a24de5ecae94160f141029e9a347282cfe25d1d58d85d845cf3130f1" dependencies = [ "js-sys", "slotmap", @@ -973,6 +988,19 @@ dependencies = [ "bitflags", ] +[[package]] +name = "gpu-allocator" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" +dependencies = [ + "backtrace", + "log", + "thiserror", + "winapi", + "windows", +] + [[package]] name = "gpu-descriptor" version = "0.2.2" @@ -981,7 +1009,7 @@ checksum = "a538f217be4d405ff4719a283ca68323cc2384003eca5baaa87501e821c81dda" dependencies = [ "bitflags", "gpu-descriptor-types", - "hashbrown", + "hashbrown 0.11.2", ] [[package]] @@ -1002,6 +1030,27 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hassle-rs" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0" +dependencies = [ + "bitflags", + "com-rs", + "libc", + "libloading", + "thiserror", + "widestring", + "winapi", +] + [[package]] name = "heck" version = "0.3.3" @@ -1040,12 +1089,12 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "1.7.0" +version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", ] [[package]] @@ -1068,19 +1117,13 @@ dependencies = [ "libc", ] -[[package]] -name = "inplace_it" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90953f308a79fe6d62a4643e51f848fbfddcd05975a38e69fdf4ab86a7baf7ca" - [[package]] name = "instant" version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -1190,7 +1233,7 @@ version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "afe203d669ec979b7128619bae5a63b7b42e9203c1b29146079ee05e2f604b52" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "winapi", ] @@ -1217,9 +1260,9 @@ checksum = "f051f77a7c8e6957c0696eac88f26b0117e54f52d3fc682ab19397a8812846a4" [[package]] name = "lock_api" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" +checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" dependencies = [ "scopeguard", ] @@ -1230,7 +1273,7 @@ version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", ] [[package]] @@ -1250,9 +1293,9 @@ checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memmap2" -version = "0.3.1" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" +checksum = "83faa42c0a078c393f6b29d5db232d8be22776a891f8f56e5284faee4a20b327" dependencies = [ "libc", ] @@ -1268,8 +1311,9 @@ dependencies = [ [[package]] name = "metal" -version = "0.23.1" -source = "git+https://github.com/gfx-rs/metal-rs?rev=a357159#a35715916fec38bbc08a510ecf7d115edc500c72" +version = "0.24.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" dependencies = [ "bitflags", "block", @@ -1321,6 +1365,15 @@ dependencies = [ "autocfg", ] +[[package]] +name = "miniz_oxide" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" +dependencies = [ + "adler", +] + [[package]] name = "mio" version = "0.7.14" @@ -1373,8 +1426,8 @@ dependencies = [ [[package]] name = "naga" -version = "0.8.0" -source = "git+https://github.com/gfx-rs/naga?rev=a45b9a6#a45b9a6cc691a671aa24a32114b51c5acae02420" +version = "0.11.0" +source = "git+https://github.com/gfx-rs/naga?rev=9742f1616c3e3dd2cc9a5880616fc886c391bb9f#9742f1616c3e3dd2cc9a5880616fc886c391bb9f" dependencies = [ "bit-set", "bitflags", @@ -1386,74 +1439,45 @@ dependencies = [ "petgraph", "rustc-hash", "spirv", + "termcolor", "thiserror", + "unicode-xid", ] [[package]] name = "ndk" -version = "0.4.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d64d6af06fde0e527b1ba5c7b79a6cc89cfc46325b0b2887dffe8f70197e0c3c" +checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" dependencies = [ "bitflags", "jni-sys", "ndk-sys", "num_enum", + "raw-window-handle 0.5.1", "thiserror", ] [[package]] -name = "ndk" -version = "0.5.0" +name = "ndk-context" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" -dependencies = [ - "bitflags", - "jni-sys", - "ndk-sys", - "num_enum", - "thiserror", -] +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" [[package]] name = "ndk-glue" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e9e94628f24e7a3cb5b96a2dc5683acd9230bf11991c2a1677b87695138420" -dependencies = [ - "lazy_static", - "libc", - "log", - "ndk 0.4.0", - "ndk-macro 0.2.0", - "ndk-sys", -] - -[[package]] -name = "ndk-glue" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc291b8de2095cba8dab7cf381bf582ff4c17a09acf854c32e46545b08085d28" +checksum = "0434fabdd2c15e0aab768ca31d5b7b333717f03cf02037d5a0a3ff3c278ed67f" dependencies = [ - "lazy_static", "libc", "log", - "ndk 0.5.0", - "ndk-macro 0.3.0", + "ndk", + "ndk-context", + "ndk-macro", "ndk-sys", -] - -[[package]] -name = "ndk-macro" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" -dependencies = [ - "darling 0.10.2", - "proc-macro-crate 0.1.5", - "proc-macro2", - "quote", - "syn", + "once_cell", + "parking_lot 0.12.1", ] [[package]] @@ -1462,8 +1486,8 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" dependencies = [ - "darling 0.13.1", - "proc-macro-crate 1.1.0", + "darling", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -1471,34 +1495,11 @@ dependencies = [ [[package]] name = "ndk-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" - -[[package]] -name = "nix" -version = "0.20.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5e06129fb611568ef4e868c14b326274959aa70ff7776e9d55323531c374945" -dependencies = [ - "bitflags", - "cc", - "cfg-if 1.0.0", - "libc", - "memoffset", -] - -[[package]] -name = "nix" -version = "0.22.2" +version = "0.4.1+23.1.7779620" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3bb9a13fa32bc5aeb64150cd3f32d6cf4c748f8f8a417cce5d2eb976a8370ba" +checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" dependencies = [ - "bitflags", - "cc", - "cfg-if 1.0.0", - "libc", - "memoffset", + "jni-sys", ] [[package]] @@ -1508,7 +1509,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fa52e972a9a719cecb6864fb88568781eb706bac2cd1d4f04a648542dbf78069" dependencies = [ "bitflags", - "cfg-if 1.0.0", + "cfg-if", "libc", "memoffset", ] @@ -1587,7 +1588,7 @@ version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5249369707a1e07b39f78d98c8f34e00aca7dcb053812fdbb5ad7be82c1bba38" dependencies = [ - "proc-macro-crate 1.1.0", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -1603,6 +1604,32 @@ dependencies = [ "objc_exception", ] +[[package]] +name = "objc-sys" +version = "0.2.0-beta.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b9834c1e95694a05a828b59f55fa2afec6288359cda67146126b3f90a55d7" + +[[package]] +name = "objc2" +version = "0.3.0-beta.3.patch-leaks.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7d9bb2ee6b71d02b1b3554ed600d267ee9a2796acc9fa43fb7748e13fe072dd" +dependencies = [ + "block2", + "objc-sys", + "objc2-encode", +] + +[[package]] +name = "objc2-encode" +version = "2.0.0-pre.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abfcac41015b00a120608fdaa6938c44cb983fee294351cc4bac7638b4e50512" +dependencies = [ + "objc-sys", +] + [[package]] name = "objc_exception" version = "0.1.2" @@ -1612,6 +1639,15 @@ dependencies = [ "cc", ] +[[package]] +name = "object" +version = "0.30.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea86265d3d3dcb6a27fc51bd29a4bf387fae9d2986b823079d4986af253eb439" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.17.1" @@ -1620,13 +1656,14 @@ checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "orbclient" -version = "0.3.31" +version = "0.3.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c976c5018e7f1db4359616d8b31ef8ae7d9649b11803c0b38fff67fd2999fc8" +checksum = "974465c5e83cf9df05c1e4137b271d29035c902e39e5ad4c1939837e22160af8" dependencies = [ + "cfg-if", "libc", "raw-window-handle 0.3.4", - "redox_syscall", + "redox_syscall 0.2.10", "sdl2", "sdl2-sys", "wasm-bindgen", @@ -1642,6 +1679,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "owned_ttf_parser" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e25e9fb15717794fae58ab55c26e044103aad13186fbb625893f9a3bbcc24228" +dependencies = [ + "ttf-parser", +] + [[package]] name = "parking_lot" version = "0.11.2" @@ -1650,7 +1696,17 @@ checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", - "parking_lot_core", + "parking_lot_core 0.8.5", +] + +[[package]] +name = "parking_lot" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" +dependencies = [ + "lock_api", + "parking_lot_core 0.9.7", ] [[package]] @@ -1659,14 +1715,27 @@ version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "instant", "libc", - "redox_syscall", + "redox_syscall 0.2.10", "smallvec", "winapi", ] +[[package]] +name = "parking_lot_core" +version = "0.9.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9069cbb9f99e3a5083476ccb29ceb1de18b9118cafa53e90c9551235de2b9521" +dependencies = [ + "cfg-if", + "libc", + "redox_syscall 0.2.10", + "smallvec", + "windows-sys 0.45.0", +] + [[package]] name = "percent-encoding" version = "2.1.0" @@ -1724,6 +1793,18 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "png" +version = "0.17.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d708eaf860a19b19ce538740d2b4bdeeb8337fa53f7738455e706623ad5c638" +dependencies = [ + "bitflags", + "crc32fast", + "flate2", + "miniz_oxide 0.6.2", +] + [[package]] name = "pretty_assertions" version = "1.0.0" @@ -1736,15 +1817,6 @@ dependencies = [ "output_vt100", ] -[[package]] -name = "proc-macro-crate" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - [[package]] name = "proc-macro-crate" version = "1.1.0" @@ -1834,16 +1906,22 @@ dependencies = [ "cty", ] +[[package]] +name = "raw-window-handle" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f851a03551ceefd30132e447f07f96cb7011d6b658374f3aed847333adb5559" + [[package]] name = "raw-window-metal" -version = "0.1.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cd21ed1cdef7f1b1579b972148ba6058b5b545959a14d91ea83c4f0ea9f289b" +checksum = "ed91094d30089fc273de843cfef783f8c04cc75828277a64e0e8dc2a0cebd4dc" dependencies = [ "cocoa", - "core-graphics 0.22.3", + "core-graphics", "objc", - "raw-window-handle 0.3.4", + "raw-window-handle 0.5.1", ] [[package]] @@ -1880,6 +1958,15 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_syscall" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +dependencies = [ + "bitflags", +] + [[package]] name = "redox_users" version = "0.4.0" @@ -1887,7 +1974,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" dependencies = [ "getrandom", - "redox_syscall", + "redox_syscall 0.2.10", ] [[package]] @@ -1916,9 +2003,9 @@ checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "renderdoc-sys" -version = "0.7.1" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" +checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" [[package]] name = "rspirv" @@ -1949,7 +2036,7 @@ version = "0.6.1" dependencies = [ "ar", "either", - "hashbrown", + "hashbrown 0.11.2", "indexmap", "lazy_static", "libc", @@ -2054,31 +2141,41 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +[[package]] +name = "sctk-adwaita" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc56402866c717f54e48b122eb93c69f709bc5a6359c403598992fd92f017931" +dependencies = [ + "ab_glyph", + "log", + "memmap2", + "smithay-client-toolkit", + "tiny-skia", +] + [[package]] name = "sdl2" -version = "0.34.5" +version = "0.35.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "deecbc3fa9460acff5a1e563e05cb5f31bba0aa0c214bb49a43db8159176d54b" +checksum = "f7959277b623f1fb9e04aea73686c3ca52f01b2145f8ea16f4ff30d8b7623b1a" dependencies = [ "bitflags", "lazy_static", "libc", - "raw-window-handle 0.3.4", + "raw-window-handle 0.4.2", "sdl2-sys", ] [[package]] name = "sdl2-sys" -version = "0.34.5" +version = "0.35.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41a29aa21f175b5a41a6e26da572d5e5d1ee5660d35f9f9d0913e8a802098f74" +checksum = "e3586be2cf6c0a8099a79a12b4084357aa9b3e0b0d7980e3b67aaf7a9d55f9f0" dependencies = [ - "cfg-if 0.1.10", + "cfg-if", "cmake", - "flate2", "libc", - "tar", - "unidiff", "version-compare", ] @@ -2163,9 +2260,9 @@ dependencies = [ [[package]] name = "smithay-client-toolkit" -version = "0.15.3" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1325f292209cee78d5035530932422a30aa4c8fda1a16593ac083c1de211e68a" +checksum = "f307c47d32d2715eb2e0ece5589057820e0e5e70d07c247d1063e844e107f454" dependencies = [ "bitflags", "calloop", @@ -2173,7 +2270,7 @@ dependencies = [ "lazy_static", "log", "memmap2", - "nix 0.22.2", + "nix", "pkg-config", "wayland-client", "wayland-cursor", @@ -2273,16 +2370,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] -name = "strsim" -version = "0.8.0" +name = "static_assertions" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strict-num" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9df65f20698aeed245efdde3628a6b559ea1239bbb871af1b6e3b58c413b2bd1" [[package]] name = "strsim" -version = "0.9.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" +checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "strsim" @@ -2347,26 +2450,15 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "tar" -version = "0.4.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b55807c0344e1e6c04d7c965f5289c39a8d94ae23ed5c0b57aabac549f871c6" -dependencies = [ - "filetime", - "libc", - "xattr", -] - [[package]] name = "tempfile" version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af18f7ae1acd354b992402e9ec5864359d693cd8a79dcbef59f76891701c1e95" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "fastrand", - "redox_syscall", + "redox_syscall 0.2.10", "rustix", "windows-sys 0.42.0", ] @@ -2397,7 +2489,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0639d10d8f4615f223a57275cf40f9bdb7cfbb806bcb7f7cc56e3beb55a576eb" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "getopts", "libc", "num_cpus", @@ -2443,6 +2535,31 @@ dependencies = [ "libc", ] +[[package]] +name = "tiny-skia" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfef3412c6975196fdfac41ef232f910be2bb37b9dd3313a49a1a6bc815a5bdb" +dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if", + "png", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4b5edac058fc98f51c935daea4d805b695b38e2f151241cad125ade2a2ac20d" +dependencies = [ + "arrayref", + "bytemuck", + "strict-num", +] + [[package]] name = "toml" version = "0.5.8" @@ -2452,6 +2569,12 @@ dependencies = [ "serde", ] +[[package]] +name = "ttf-parser" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0609f771ad9c6155384897e1df4d948e692667cc0588548b68eb44d052b27633" + [[package]] name = "unicode-ident" version = "1.0.5" @@ -2471,15 +2594,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" [[package]] -name = "unidiff" -version = "0.3.3" +name = "unicode-xid" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8a62719acf1933bfdbeb73a657ecd9ecece70b405125267dd549e2e2edc232c" -dependencies = [ - "encoding_rs", - "lazy_static", - "regex", -] +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" [[package]] name = "vec_map" @@ -2489,9 +2607,9 @@ checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] name = "version-compare" -version = "0.0.10" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d63556a25bae6ea31b52e640d7c41d1ab27faba4ccb600013837a3d0b3994ca1" +checksum = "579a42fc0b8e0c63b76519a339be31bed574929511fa53c1a3acae26eb258f29" [[package]] name = "version_check" @@ -2522,7 +2640,7 @@ version = "0.2.84" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "wasm-bindgen-macro", ] @@ -2547,7 +2665,7 @@ version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f219e0d211ba40266969f6dbdd90636da12f75bee4fc9d6c23d1260dadb51454" dependencies = [ - "cfg-if 1.0.0", + "cfg-if", "js-sys", "wasm-bindgen", "web-sys", @@ -2591,7 +2709,7 @@ dependencies = [ "bitflags", "downcast-rs", "libc", - "nix 0.24.3", + "nix", "scoped-tls", "wayland-commons", "wayland-scanner", @@ -2604,7 +2722,7 @@ version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8691f134d584a33a6606d9d717b95c4fa20065605f798a3f350d78dced02a902" dependencies = [ - "nix 0.24.3", + "nix", "once_cell", "smallvec", "wayland-sys", @@ -2616,7 +2734,7 @@ version = "0.29.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6865c6b66f13d6257bef1cd40cbfe8ef2f150fb8ebbdb1e8e873455931377661" dependencies = [ - "nix 0.24.3", + "nix", "wayland-client", "xcursor", ] @@ -2657,9 +2775,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.55" +version = "0.3.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" +checksum = "e33b99f4b23ba3eec1a53ac264e35a755f00e966e0065077d6027c0f575b0b97" dependencies = [ "js-sys", "wasm-bindgen", @@ -2667,16 +2785,19 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.12.0" -source = "git+https://github.com/gfx-rs/wgpu#0ac9ce002656565ccd05b889f5856f4e2c38fa73" +version = "0.15.0" +source = "git+https://github.com/gfx-rs/wgpu#a50228230797e4b6005e2e6ed83638646aa5e055" dependencies = [ "arrayvec", + "cfg-if", "js-sys", "log", "naga", - "parking_lot", - "raw-window-handle 0.4.2", + "parking_lot 0.11.2", + "profiling", + "raw-window-handle 0.5.1", "smallvec", + "static_assertions", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", @@ -2687,31 +2808,32 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.12.0" -source = "git+https://github.com/gfx-rs/wgpu#0ac9ce002656565ccd05b889f5856f4e2c38fa73" +version = "0.15.0" +source = "git+https://github.com/gfx-rs/wgpu#a50228230797e4b6005e2e6ed83638646aa5e055" dependencies = [ "arrayvec", + "bit-vec", "bitflags", - "cfg_aliases", "codespan-reporting", - "copyless", - "fxhash", "log", "naga", - "parking_lot", + "parking_lot 0.11.2", "profiling", - "raw-window-handle 0.4.2", + "raw-window-handle 0.5.1", + "rustc-hash", "smallvec", "thiserror", + "web-sys", "wgpu-hal", "wgpu-types", ] [[package]] name = "wgpu-hal" -version = "0.12.0" -source = "git+https://github.com/gfx-rs/wgpu#0ac9ce002656565ccd05b889f5856f4e2c38fa73" +version = "0.15.1" +source = "git+https://github.com/gfx-rs/wgpu#a50228230797e4b6005e2e6ed83638646aa5e055" dependencies = [ + "android_system_properties", "arrayvec", "ash", "bit-set", @@ -2720,23 +2842,26 @@ dependencies = [ "core-graphics-types", "d3d12", "foreign-types", - "fxhash", "glow", "gpu-alloc", + "gpu-allocator", "gpu-descriptor", - "inplace_it", + "hassle-rs", "js-sys", "khronos-egl", + "libc", "libloading", "log", "metal", "naga", "objc", - "parking_lot", + "parking_lot 0.11.2", "profiling", "range-alloc", - "raw-window-handle 0.4.2", + "raw-window-handle 0.5.1", "renderdoc-sys", + "rustc-hash", + "smallvec", "thiserror", "wasm-bindgen", "web-sys", @@ -2746,12 +2871,20 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.12.0" -source = "git+https://github.com/gfx-rs/wgpu#0ac9ce002656565ccd05b889f5856f4e2c38fa73" +version = "0.15.0" +source = "git+https://github.com/gfx-rs/wgpu#a50228230797e4b6005e2e6ed83638646aa5e055" dependencies = [ "bitflags", + "js-sys", + "web-sys", ] +[[package]] +name = "widestring" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" + [[package]] name = "winapi" version = "0.3.9" @@ -2783,6 +2916,15 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +[[package]] +name = "windows" +version = "0.44.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.42.0" @@ -2866,35 +3008,36 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "winit" -version = "0.26.0" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70466a5f4825cc88c92963591b06dbc255420bffe19d847bfcda475e82d079c0" +checksum = "4f504e8c117b9015f618774f8d58cd4781f5a479bc41079c064f974cbb253874" dependencies = [ + "android-activity", "bitflags", - "block", - "cocoa", - "core-foundation 0.9.2", - "core-graphics 0.22.3", - "core-video-sys", + "cfg_aliases", + "core-foundation", + "core-graphics", "dispatch", "instant", - "lazy_static", "libc", "log", "mio 0.8.0", - "ndk 0.5.0", - "ndk-glue 0.5.0", - "ndk-sys", - "objc", - "parking_lot", + "ndk", + "objc2", + "once_cell", + "orbclient", "percent-encoding", - "raw-window-handle 0.4.2", + "raw-window-handle 0.5.1", + "redox_syscall 0.3.5", + "sctk-adwaita", "smithay-client-toolkit", "wasm-bindgen", "wayland-client", + "wayland-commons", "wayland-protocols", + "wayland-scanner", "web-sys", - "winapi", + "windows-sys 0.45.0", "x11-dl", ] @@ -2909,15 +3052,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "xattr" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" -dependencies = [ - "libc", -] - [[package]] name = "xcursor" version = "0.3.4" diff --git a/examples/runners/ash/Cargo.toml b/examples/runners/ash/Cargo.toml index 3c2f838c69..0b41bb9ecc 100644 --- a/examples/runners/ash/Cargo.toml +++ b/examples/runners/ash/Cargo.toml @@ -14,17 +14,14 @@ use-installed-tools = ["spirv-builder/use-installed-tools"] use-compiled-tools = ["spirv-builder/use-compiled-tools"] [dependencies] -ash = "0.35" -ash-window = "0.9" -winit = "0.26" +ash = "0.37" +ash-window = "0.12" +raw-window-handle = "0.5.1" +winit = "0.28.3" structopt = "0.3.20" cfg-if = "1.0.0" shared = { path = "../../shaders/shared" } spirv-builder = { workspace = true, default-features = false } -# TODO: Remove this once no longer needed, only needed to make cargo-deny happy for some reason. -# https://rustsec.org/advisories/RUSTSEC-2021-0119 -nix = "0.20.2" - [target.'cfg(target_os = "macos")'.dependencies] -ash-molten = { version = "0.12.0", features = ["pre-built"] } +ash-molten = { version = "0.13.1", features = ["pre-built"] } diff --git a/examples/runners/ash/src/main.rs b/examples/runners/ash/src/main.rs index eae6aff145..ad999cb917 100644 --- a/examples/runners/ash/src/main.rs +++ b/examples/runners/ash/src/main.rs @@ -76,6 +76,7 @@ use ash::{ vk, }; +use raw_window_handle::{HasRawDisplayHandle, HasRawWindowHandle}; use winit::{ event::{Event, VirtualKeyCode, WindowEvent}, event_loop::{ControlFlow, EventLoop}, @@ -271,11 +272,10 @@ impl RenderBase { .map(|raw_name| raw_name.as_ptr()) .collect(); - let mut extension_names_raw = ash_window::enumerate_required_extensions(&window) - .unwrap() - .iter() - .map(|ext| ext.as_ptr()) - .collect::>(); + let mut extension_names_raw = + ash_window::enumerate_required_extensions(window.raw_display_handle()) + .unwrap() + .to_vec(); if options.debug_layer { extension_names_raw.push(ext::DebugUtils::name().as_ptr()); } @@ -299,8 +299,16 @@ impl RenderBase { } }; - let surface = - unsafe { ash_window::create_surface(&entry, &instance, &window, None).unwrap() }; + let surface = unsafe { + ash_window::create_surface( + &entry, + &instance, + window.raw_display_handle(), + window.raw_window_handle(), + None, + ) + .unwrap() + }; let (debug_utils_loader, debug_call_back) = if options.debug_layer { let debug_utils_loader = ext::DebugUtils::new(&entry, &instance); diff --git a/examples/runners/wgpu/Cargo.toml b/examples/runners/wgpu/Cargo.toml index 17344a7769..5a02657795 100644 --- a/examples/runners/wgpu/Cargo.toml +++ b/examples/runners/wgpu/Cargo.toml @@ -22,7 +22,7 @@ shared = { path = "../../shaders/shared" } futures = { version = "0.3", default-features = false, features = ["std", "executor"] } # Vulkan SDK or MoltenVK needs to be installed for `vulkan-portability` to work on macOS wgpu = { git = "https://github.com/gfx-rs/wgpu", features = ["spirv", "vulkan-portability"] } -winit = { version = "0.26" } +winit = "0.28.3" structopt = "0.3" strum = { version = "0.23.0", default_features = false, features = ["std", "derive"] } bytemuck = "1.6.3" @@ -31,13 +31,13 @@ bytemuck = "1.6.3" spirv-builder = { workspace = true, features = ["watch"] } [target.'cfg(target_os = "android")'.dependencies] -ndk-glue = "0.4" +ndk-glue = "0.7.0" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] env_logger = "0.9.0" [target.'cfg(target_arch = "wasm32")'.dependencies] -web-sys = "=0.3.55" +web-sys = "0.3.60" console_error_panic_hook = "0.1.6" console_log = "0.2.0" wasm-bindgen-futures = "0.4.18" diff --git a/examples/runners/wgpu/src/compute.rs b/examples/runners/wgpu/src/compute.rs index 7a896a0005..5968f43c8c 100644 --- a/examples/runners/wgpu/src/compute.rs +++ b/examples/runners/wgpu/src/compute.rs @@ -1,7 +1,6 @@ use wgpu::util::DeviceExt; use super::Options; -use futures::future::join; use std::{convert::TryInto, future::Future, time::Duration}; fn block_on(future: impl Future) -> T { @@ -24,13 +23,12 @@ pub async fn start_internal( _options: &Options, shader_binary: wgpu::ShaderModuleDescriptor<'static>, ) { - let instance = wgpu::Instance::new(wgpu::Backends::PRIMARY); - let adapter = instance - .request_adapter(&wgpu::RequestAdapterOptions { - power_preference: wgpu::PowerPreference::default(), - force_fallback_adapter: false, - compatible_surface: None, - }) + let backends = wgpu::util::backend_bits_from_env().unwrap_or(wgpu::Backends::PRIMARY); + let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { + backends, + dx12_shader_compiler: wgpu::util::dx12_shader_compiler_from_env().unwrap_or_default(), + }); + let adapter = wgpu::util::initialize_adapter_from_env_or_default(&instance, backends, None) .await .expect("Failed to find an appropriate adapter"); @@ -51,7 +49,7 @@ pub async fn start_internal( let timestamp_period = queue.get_timestamp_period(); // Load the shaders from disk - let module = device.create_shader_module(&shader_binary); + let module = device.create_shader_module(shader_binary); let top = 2u32.pow(20); let src_range = 1..top; @@ -135,7 +133,7 @@ pub async fn start_internal( cpass.set_bind_group(0, &bind_group, &[]); cpass.set_pipeline(&compute_pipeline); cpass.write_timestamp(&queries, 0); - cpass.dispatch(src_range.len() as u32 / 64, 1, 1); + cpass.dispatch_workgroups(src_range.len() as u32 / 64, 1, 1); cpass.write_timestamp(&queries, 1); } @@ -151,41 +149,41 @@ pub async fn start_internal( queue.submit(Some(encoder.finish())); let buffer_slice = readback_buffer.slice(..); let timestamp_slice = timestamp_buffer.slice(..); - let timestamp_future = timestamp_slice.map_async(wgpu::MapMode::Read); - let buffer_future = buffer_slice.map_async(wgpu::MapMode::Read); + timestamp_slice.map_async(wgpu::MapMode::Read, |r| r.unwrap()); + buffer_slice.map_async(wgpu::MapMode::Read, |r| r.unwrap()); + // NOTE(eddyb) `poll` should return only after the above callbacks fire + // (see also https://github.com/gfx-rs/wgpu/pull/2698 for more details). device.poll(wgpu::Maintain::Wait); - if let (Ok(()), Ok(())) = join(buffer_future, timestamp_future).await { - let data = buffer_slice.get_mapped_range(); - let timing_data = timestamp_slice.get_mapped_range(); - let result = data - .chunks_exact(4) - .map(|b| u32::from_ne_bytes(b.try_into().unwrap())) - .collect::>(); - let timings = timing_data - .chunks_exact(8) - .map(|b| u64::from_ne_bytes(b.try_into().unwrap())) - .collect::>(); - drop(data); - readback_buffer.unmap(); - drop(timing_data); - timestamp_buffer.unmap(); - let mut max = 0; - for (src, out) in src_range.zip(result.iter().copied()) { - if out == u32::MAX { - println!("{src}: overflowed"); - break; - } else if out > max { - max = out; - // Should produce - println!("{src}: {out}"); - } + let data = buffer_slice.get_mapped_range(); + let timing_data = timestamp_slice.get_mapped_range(); + let result = data + .chunks_exact(4) + .map(|b| u32::from_ne_bytes(b.try_into().unwrap())) + .collect::>(); + let timings = timing_data + .chunks_exact(8) + .map(|b| u64::from_ne_bytes(b.try_into().unwrap())) + .collect::>(); + drop(data); + readback_buffer.unmap(); + drop(timing_data); + timestamp_buffer.unmap(); + let mut max = 0; + for (src, out) in src_range.zip(result.iter().copied()) { + if out == u32::MAX { + println!("{src}: overflowed"); + break; + } else if out > max { + max = out; + // Should produce + println!("{src}: {out}"); } - println!( - "Took: {:?}", - Duration::from_nanos( - ((timings[1] - timings[0]) as f64 * f64::from(timestamp_period)) as u64 - ) - ); } + println!( + "Took: {:?}", + Duration::from_nanos( + ((timings[1] - timings[0]) as f64 * f64::from(timestamp_period)) as u64 + ) + ); } diff --git a/examples/runners/wgpu/src/graphics.rs b/examples/runners/wgpu/src/graphics.rs index 2a090fc2df..8eab96b63a 100644 --- a/examples/runners/wgpu/src/graphics.rs +++ b/examples/runners/wgpu/src/graphics.rs @@ -4,7 +4,7 @@ use super::Options; use shared::ShaderConstants; use winit::{ event::{ElementState, Event, KeyboardInput, MouseButton, VirtualKeyCode, WindowEvent}, - event_loop::{ControlFlow, EventLoop}, + event_loop::{ControlFlow, EventLoop, EventLoopBuilder}, window::Window, }; @@ -37,25 +37,37 @@ async fn run( window: Window, shader_binary: wgpu::ShaderModuleDescriptor<'static>, ) { - let instance = wgpu::Instance::new(wgpu::Backends::VULKAN | wgpu::Backends::METAL); + let backends = wgpu::util::backend_bits_from_env() + .unwrap_or(wgpu::Backends::VULKAN | wgpu::Backends::METAL); + let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { + backends, + dx12_shader_compiler: wgpu::util::dx12_shader_compiler_from_env().unwrap_or_default(), + }); + + // HACK(eddyb) marker error type for lazily-created surfaces (e.g. on Android). + struct SurfaceCreationPending { + preferred_format: wgpu::TextureFormat, + } - // Wait for Resumed event on Android; the surface is only needed early to - // find an adapter that can render to this surface. - let mut surface = if cfg!(target_os = "android") { - None + // Wait for Resumed event on Android; the surface is only otherwise needed + // early to find an adapter that can render to this surface. + let initial_surface = if cfg!(target_os = "android") { + Err(SurfaceCreationPending { + preferred_format: wgpu::TextureFormat::Rgba8UnormSrgb, + }) } else { - Some(unsafe { instance.create_surface(&window) }) + Ok(unsafe { instance.create_surface(&window) } + .expect("Failed to create surface from window")) }; - let adapter = instance - .request_adapter(&wgpu::RequestAdapterOptions { - power_preference: wgpu::PowerPreference::default(), - force_fallback_adapter: false, - // Request an adapter which can render to our surface - compatible_surface: surface.as_ref(), - }) - .await - .expect("Failed to find an appropriate adapter"); + let adapter = wgpu::util::initialize_adapter_from_env_or_default( + &instance, + backends, + // Request an adapter which can render to our surface + initial_surface.as_ref().ok(), + ) + .await + .expect("Failed to find an appropriate adapter"); let features = wgpu::Features::PUSH_CONSTANTS; let limits = wgpu::Limits { @@ -76,6 +88,30 @@ async fn run( .await .expect("Failed to create device"); + let auto_configure_surface = + |adapter: &_, device: &_, surface: wgpu::Surface, size: winit::dpi::PhysicalSize<_>| { + let mut surface_config = surface + .get_default_config(adapter, size.width, size.height) + .unwrap_or_else(|| { + panic!( + "Missing formats/present modes in surface capabilities: {:#?}", + surface.get_capabilities(adapter) + ) + }); + + // FIXME(eddyb) should this be toggled by a CLI arg? + // NOTE(eddyb) VSync was disabled in the past, but without VSync, + // especially for simpler shaders, you can easily hit thousands + // of frames per second, stressing GPUs for no reason. + surface_config.present_mode = wgpu::PresentMode::AutoVsync; + + surface.configure(device, &surface_config); + + (surface, surface_config) + }; + let mut surface_with_config = initial_surface + .map(|surface| auto_configure_surface(&adapter, &device, surface, window.inner_size())); + // Load the shaders from disk let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor { @@ -87,28 +123,15 @@ async fn run( }], }); - let preferred_format = if let Some(surface) = &surface { - surface.get_preferred_format(&adapter).unwrap() - } else { - // if Surface is none, we're guaranteed to be on android - wgpu::TextureFormat::Rgba8UnormSrgb - }; - - let mut render_pipeline = - create_pipeline(&device, &pipeline_layout, preferred_format, shader_binary); - - let size = window.inner_size(); - - let mut surface_config = wgpu::SurfaceConfiguration { - usage: wgpu::TextureUsages::RENDER_ATTACHMENT, - format: preferred_format, - width: size.width, - height: size.height, - present_mode: wgpu::PresentMode::Mailbox, - }; - if let Some(surface) = &mut surface { - surface.configure(&device, &surface_config); - } + let mut render_pipeline = create_pipeline( + &device, + &pipeline_layout, + surface_with_config.as_ref().map_or_else( + |pending| pending.preferred_format, + |(_, surface_config)| surface_config.format, + ), + shader_binary, + ); let start = std::time::Instant::now(); @@ -132,13 +155,21 @@ async fn run( window.request_redraw(); } Event::Resumed => { - let s = unsafe { instance.create_surface(&window) }; - surface_config.format = s.get_preferred_format(&adapter).unwrap(); - s.configure(&device, &surface_config); - surface = Some(s); + let new_surface = unsafe { instance.create_surface(&window) } + .expect("Failed to create surface from window (after resume)"); + surface_with_config = Ok(auto_configure_surface( + &adapter, + &device, + new_surface, + window.inner_size(), + )); } Event::Suspended => { - surface = None; + if let Ok((_, surface_config)) = &surface_with_config { + surface_with_config = Err(SurfaceCreationPending { + preferred_format: surface_config.format, + }); + } } Event::WindowEvent { event: WindowEvent::Resized(size), @@ -146,22 +177,29 @@ async fn run( } => { if size.width != 0 && size.height != 0 { // Recreate the swap chain with the new size - surface_config.width = size.width; - surface_config.height = size.height; - if let Some(surface) = &surface { - surface.configure(&device, &surface_config); + if let Ok((surface, surface_config)) = &mut surface_with_config { + surface_config.width = size.width; + surface_config.height = size.height; + surface.configure(&device, surface_config); } } } Event::RedrawRequested(_) => { - if let Some(surface) = &mut surface { + // FIXME(eddyb) only the mouse shader *really* needs this, could + // avoid doing wasteful rendering by special-casing each shader? + // (with VSync enabled this can't be *too* bad, thankfully) + // FIXME(eddyb) is this the best way to do continuous redraws in + // `winit`? (or should we stop using `ControlFlow::Wait`? etc.) + window.request_redraw(); + + if let Ok((surface, surface_config)) = &mut surface_with_config { let output = match surface.get_current_texture() { Ok(surface) => surface, Err(err) => { eprintln!("get_current_texture error: {err:?}"); match err { wgpu::SurfaceError::Lost => { - surface.configure(&device, &surface_config); + surface.configure(&device, surface_config); } wgpu::SurfaceError::OutOfMemory => { *control_flow = ControlFlow::Exit; @@ -179,14 +217,14 @@ async fn run( { let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { label: None, - color_attachments: &[wgpu::RenderPassColorAttachment { + color_attachments: &[Some(wgpu::RenderPassColorAttachment { view: &output_view, resolve_target: None, ops: wgpu::Operations { load: wgpu::LoadOp::Clear(wgpu::Color::GREEN), store: true, }, - }], + })], depth_stencil_attachment: None, }); @@ -270,8 +308,15 @@ async fn run( } } Event::UserEvent(new_module) => { - *render_pipeline = - create_pipeline(&device, &pipeline_layout, surface_config.format, new_module); + *render_pipeline = create_pipeline( + &device, + &pipeline_layout, + surface_with_config.as_ref().map_or_else( + |pending| pending.preferred_format, + |(_, surface_config)| surface_config.format, + ), + new_module, + ); window.request_redraw(); *control_flow = ControlFlow::Poll; } @@ -286,7 +331,7 @@ fn create_pipeline( surface_format: wgpu::TextureFormat, shader_binary: wgpu::ShaderModuleDescriptor<'_>, ) -> wgpu::RenderPipeline { - let module = device.create_shader_module(&shader_binary); + let module = device.create_shader_module(shader_binary); device.create_render_pipeline(&wgpu::RenderPipelineDescriptor { label: None, layout: Some(pipeline_layout), @@ -313,11 +358,11 @@ fn create_pipeline( fragment: Some(wgpu::FragmentState { module: &module, entry_point: shaders::main_fs, - targets: &[wgpu::ColorTargetState { + targets: &[Some(wgpu::ColorTargetState { format: surface_format, blend: None, write_mask: wgpu::ColorWrites::ALL, - }], + })], }), multiview: None, }) @@ -326,7 +371,7 @@ fn create_pipeline( #[allow(clippy::match_wild_err_arm)] pub fn start(options: &Options) { // Build the shader before we pop open a window, since it might take a while. - let event_loop = EventLoop::with_user_event(); + let event_loop = EventLoopBuilder::with_user_event().build(); let proxy = event_loop.create_proxy(); let initial_shader = maybe_watch( options.shader, From 5dc302ad500827f0e689110e29a2c02e09fb502e Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Wed, 22 Mar 2023 18:29:05 +0200 Subject: [PATCH 2/2] example-runner-wgpu: transition from `ndk-glue` to `android-activity`. --- .github/workflows/ci.yaml | 2 +- Cargo.lock | 165 ++++++------------- android.nix | 34 ++++ examples/runners/wgpu/Cargo.toml | 10 +- examples/runners/wgpu/build.rs | 6 +- examples/runners/wgpu/src/bin/wgpu_runner.rs | 7 + examples/runners/wgpu/src/compute.rs | 16 +- examples/runners/wgpu/src/graphics.rs | 42 +++-- examples/runners/wgpu/src/lib.rs | 31 ++-- 9 files changed, 154 insertions(+), 159 deletions(-) create mode 100644 android.nix diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 2e66bdcdea..78314db9d6 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -116,7 +116,7 @@ jobs: echo "::endgroup::" echo "::group::Build WGPU example for Android" - cargo apk build -p example-runner-wgpu --features use-installed-tools --no-default-features + cargo apk build -p example-runner-wgpu --lib --features use-installed-tools --no-default-features echo "::endgroup::" lint: diff --git a/Cargo.lock b/Cargo.lock index 6a12026240..a963d46d33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -77,6 +77,24 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc7eb209b1518d6bb87b283c20095f5228ecda460da70b44f0802523dea6da04" +[[package]] +name = "android_log-sys" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85965b6739a430150bdd138e2374a98af0c3ee0d030b3bb7fc3bddff58d0102e" + +[[package]] +name = "android_logger" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8619b80c242aa7bd638b5c7ddd952addeecb71f69c75e33f1d47b2804f8f883a" +dependencies = [ + "android_log-sys", + "env_logger", + "log", + "once_cell", +] + [[package]] name = "android_system_properties" version = "0.1.5" @@ -157,7 +175,7 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", "winapi", ] @@ -310,7 +328,7 @@ dependencies = [ "ansi_term", "atty", "bitflags", - "strsim 0.8.0", + "strsim", "textwrap", "unicode-width", "vec_map", @@ -558,41 +576,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "darling" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim 0.10.0", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" -dependencies = [ - "darling_core", - "quote", - "syn", -] - [[package]] name = "derivative" version = "2.2.0" @@ -670,12 +653,12 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.9.0" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" dependencies = [ - "atty", "humantime", + "is-terminal", "log", "regex", "termcolor", @@ -731,13 +714,13 @@ dependencies = [ name = "example-runner-wgpu" version = "0.0.0" dependencies = [ + "android_logger", "bytemuck", "cfg-if", "console_error_panic_hook", "console_log", "env_logger", "futures", - "ndk-glue", "shared", "spirv-builder", "structopt", @@ -794,12 +777,6 @@ dependencies = [ "miniz_oxide 0.4.4", ] -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - [[package]] name = "foreign-types" version = "0.3.2" @@ -1069,6 +1046,12 @@ dependencies = [ "libc", ] +[[package]] +name = "hermit-abi" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" + [[package]] name = "hexf-parse" version = "0.2.1" @@ -1081,12 +1064,6 @@ version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" -[[package]] -name = "ident_case" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" - [[package]] name = "indexmap" version = "1.9.2" @@ -1139,6 +1116,18 @@ dependencies = [ "windows-sys 0.45.0", ] +[[package]] +name = "is-terminal" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8687c819457e979cc940d09cb16e42a1bf70aa6b60a549de6d3a62a0ee90c69e" +dependencies = [ + "hermit-abi 0.3.1", + "io-lifetimes", + "rustix", + "windows-sys 0.45.0", +] + [[package]] name = "itertools" version = "0.10.5" @@ -1464,35 +1453,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" -[[package]] -name = "ndk-glue" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0434fabdd2c15e0aab768ca31d5b7b333717f03cf02037d5a0a3ff3c278ed67f" -dependencies = [ - "libc", - "log", - "ndk", - "ndk-context", - "ndk-macro", - "ndk-sys", - "once_cell", - "parking_lot 0.12.1", -] - -[[package]] -name = "ndk-macro" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" -dependencies = [ - "darling", - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "ndk-sys" version = "0.4.1+23.1.7779620" @@ -1568,7 +1528,7 @@ version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "19e64526ebdee182341572e50e9ad03965aa510cd94427a4549448f285e957a1" dependencies = [ - "hermit-abi", + "hermit-abi 0.1.19", "libc", ] @@ -1688,17 +1648,6 @@ dependencies = [ "ttf-parser", ] -[[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.5", -] - [[package]] name = "parking_lot" version = "0.12.1" @@ -1706,21 +1655,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ "lock_api", - "parking_lot_core 0.9.7", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" -dependencies = [ - "cfg-if", - "instant", - "libc", - "redox_syscall 0.2.10", - "smallvec", - "winapi", + "parking_lot_core", ] [[package]] @@ -2387,12 +2322,6 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - [[package]] name = "structopt" version = "0.3.25" @@ -2793,7 +2722,7 @@ dependencies = [ "js-sys", "log", "naga", - "parking_lot 0.11.2", + "parking_lot", "profiling", "raw-window-handle 0.5.1", "smallvec", @@ -2817,7 +2746,7 @@ dependencies = [ "codespan-reporting", "log", "naga", - "parking_lot 0.11.2", + "parking_lot", "profiling", "raw-window-handle 0.5.1", "rustc-hash", @@ -2855,7 +2784,7 @@ dependencies = [ "metal", "naga", "objc", - "parking_lot 0.11.2", + "parking_lot", "profiling", "range-alloc", "raw-window-handle 0.5.1", diff --git a/android.nix b/android.nix new file mode 100644 index 0000000000..807d5ca7c3 --- /dev/null +++ b/android.nix @@ -0,0 +1,34 @@ +# HACK(eddyb) this is a minimal setup to allow testing the Android build on NixOS. +# +# Tested in `NIXPKGS_ACCEPT_ANDROID_SDK_LICENSE=1 nix-shell android.nix --pure`, +# by running the following commands (x64 target is for the Android Emulator): +# rustup target add aarch64-linux-android x86_64-linux-android +# cargo apk build -p example-runner-wgpu --target aarch64-linux-android +# cargo apk build -p example-runner-wgpu --target x86_64-linux-android +# +# (you can also replace `cargo apk build` with `cargo apk run` to launch it, +# via `adb`, into either the Android Emulator, or a physical Android device) + +let + pkgs = import {}; +in with pkgs; mkShell rec { + # Workaround for https://github.com/NixOS/nixpkgs/issues/60919. + # NOTE(eddyb) needed only in debug mode (warnings about needing optimizations + # turn into errors due to `-Werror`, for at least `spirv-tools-sys`). + hardeningDisable = [ "fortify" ]; + + # Allow cargo to download crates (even inside `nix-shell --pure`). + SSL_CERT_FILE = "${cacert}/etc/ssl/certs/ca-bundle.crt"; + + nativeBuildInputs = [ rustup cargo-apk jdk ]; + + ANDROID_SDK_ROOT = let + androidComposition = androidenv.composeAndroidPackages { + abiVersions = [ "arm64-v8a" "x86_64" ]; + includeNDK = true; + platformVersions = [ "30" ]; + }; + in "${androidComposition.androidsdk}/libexec/android-sdk"; + + ANDROID_NDK_ROOT = "${ANDROID_SDK_ROOT}/ndk-bundle"; +} diff --git a/examples/runners/wgpu/Cargo.toml b/examples/runners/wgpu/Cargo.toml index 5a02657795..149e0f6303 100644 --- a/examples/runners/wgpu/Cargo.toml +++ b/examples/runners/wgpu/Cargo.toml @@ -22,19 +22,19 @@ shared = { path = "../../shaders/shared" } futures = { version = "0.3", default-features = false, features = ["std", "executor"] } # Vulkan SDK or MoltenVK needs to be installed for `vulkan-portability` to work on macOS wgpu = { git = "https://github.com/gfx-rs/wgpu", features = ["spirv", "vulkan-portability"] } -winit = "0.28.3" +winit = { version = "0.28.3", features = ["android-native-activity"] } structopt = "0.3" strum = { version = "0.23.0", default_features = false, features = ["std", "derive"] } bytemuck = "1.6.3" [target.'cfg(not(any(target_os = "android", target_arch = "wasm32")))'.dependencies] +env_logger = "0.10.0" spirv-builder = { workspace = true, features = ["watch"] } [target.'cfg(target_os = "android")'.dependencies] -ndk-glue = "0.7.0" - -[target.'cfg(not(target_arch = "wasm32"))'.dependencies] -env_logger = "0.9.0" +android_logger = "0.11.0" +# NOTE(eddyb) `winit` feature `android-native-activity` is always enabled above, +# to avoid specifying the dependency twice, but only applies to android builds. [target.'cfg(target_arch = "wasm32")'.dependencies] web-sys = "0.3.60" diff --git a/examples/runners/wgpu/build.rs b/examples/runners/wgpu/build.rs index 4c79f896f8..55f708728d 100644 --- a/examples/runners/wgpu/build.rs +++ b/examples/runners/wgpu/build.rs @@ -25,7 +25,11 @@ fn main() -> Result<(), Box> { && dir.ends_with(profile) && dir.pop(); assert!(ok); - let dir = dir.join("spirv-builder"); + // NOTE(eddyb) this needs to be distinct from the `--target-dir` value that + // `spirv-builder` generates in a similar way from `$OUT_DIR` and `$PROFILE`, + // otherwise repeated `cargo build`s will cause build script reruns and the + // rebuilding of `rustc_codegen_spirv` (likely due to common proc macro deps). + let dir = dir.join("example-runner-wgpu-builder"); let status = std::process::Command::new("cargo") .args([ "run", diff --git a/examples/runners/wgpu/src/bin/wgpu_runner.rs b/examples/runners/wgpu/src/bin/wgpu_runner.rs index 120e8b9e0f..50d7c51f0c 100644 --- a/examples/runners/wgpu/src/bin/wgpu_runner.rs +++ b/examples/runners/wgpu/src/bin/wgpu_runner.rs @@ -1,3 +1,10 @@ +#[cfg(target_os = "android")] +const _: () = panic!( + "executable not applicable for Android targets, \ + make sure to pass `--lib` when building with `cargo-apk`" +); + fn main() { + #[cfg(not(target_os = "android"))] example_runner_wgpu::main(); } diff --git a/examples/runners/wgpu/src/compute.rs b/examples/runners/wgpu/src/compute.rs index 5968f43c8c..6736642003 100644 --- a/examples/runners/wgpu/src/compute.rs +++ b/examples/runners/wgpu/src/compute.rs @@ -1,22 +1,14 @@ use wgpu::util::DeviceExt; use super::Options; -use std::{convert::TryInto, future::Future, time::Duration}; - -fn block_on(future: impl Future) -> T { - cfg_if::cfg_if! { - if #[cfg(target_arch = "wasm32")] { - wasm_bindgen_futures::spawn_local(future) - } else { - futures::executor::block_on(future) - } - } -} +use std::{convert::TryInto, time::Duration}; pub fn start(options: &Options) { + env_logger::init(); + let shader_binary = crate::maybe_watch(options.shader, None); - block_on(start_internal(options, shader_binary)); + futures::executor::block_on(start_internal(options, shader_binary)); } pub async fn start_internal( diff --git a/examples/runners/wgpu/src/graphics.rs b/examples/runners/wgpu/src/graphics.rs index 8eab96b63a..39e5702870 100644 --- a/examples/runners/wgpu/src/graphics.rs +++ b/examples/runners/wgpu/src/graphics.rs @@ -369,17 +369,41 @@ fn create_pipeline( } #[allow(clippy::match_wild_err_arm)] -pub fn start(options: &Options) { +pub fn start( + #[cfg(target_os = "android")] android_app: winit::platform::android::activity::AndroidApp, + options: &Options, +) { + let mut event_loop_builder = EventLoopBuilder::with_user_event(); + cfg_if::cfg_if! { + if #[cfg(target_os = "android")] { + android_logger::init_once( + android_logger::Config::default() + .with_min_level("info".parse().unwrap()), + ); + + use winit::platform::android::EventLoopBuilderExtAndroid; + event_loop_builder.with_android_app(android_app); + } else if #[cfg(target_arch = "wasm32")] { + std::panic::set_hook(Box::new(console_error_panic_hook::hook)); + console_log::init().expect("could not initialize logger"); + } else { + env_logger::init(); + } + } + let event_loop = event_loop_builder.build(); + // Build the shader before we pop open a window, since it might take a while. - let event_loop = EventLoopBuilder::with_user_event().build(); - let proxy = event_loop.create_proxy(); let initial_shader = maybe_watch( options.shader, - Some(Box::new(move |res| match proxy.send_event(res) { - Ok(it) => it, - // ShaderModuleDescriptor is not `Debug`, so can't use unwrap/expect - Err(_err) => panic!("Event loop dead"), - })), + #[cfg(not(any(target_os = "android", target_arch = "wasm32")))] + { + let proxy = event_loop.create_proxy(); + Some(Box::new(move |res| match proxy.send_event(res) { + Ok(it) => it, + // ShaderModuleDescriptor is not `Debug`, so can't use unwrap/expect + Err(_err) => panic!("Event loop dead"), + })) + }, ); let window = winit::window::WindowBuilder::new() @@ -390,8 +414,6 @@ pub fn start(options: &Options) { cfg_if::cfg_if! { if #[cfg(target_arch = "wasm32")] { - std::panic::set_hook(Box::new(console_error_panic_hook::hook)); - console_log::init().expect("could not initialize logger"); use winit::platform::web::WindowExtWebSys; // On wasm, append the canvas to the document body web_sys::window() diff --git a/examples/runners/wgpu/src/lib.rs b/examples/runners/wgpu/src/lib.rs index 3ef1da0a86..4bdb7cd9cc 100644 --- a/examples/runners/wgpu/src/lib.rs +++ b/examples/runners/wgpu/src/lib.rs @@ -73,7 +73,10 @@ use structopt::StructOpt; use strum::{Display, EnumString}; +// NOTE(eddyb) while this could theoretically work on the web, it needs more work. +#[cfg(not(any(target_os = "android", target_arch = "wasm32")))] mod compute; + mod graphics; #[derive(EnumString, Display, PartialEq, Eq, Copy, Clone)] @@ -86,7 +89,9 @@ pub enum RustGPUShader { fn maybe_watch( shader: RustGPUShader, - on_watch: Option) + Send + 'static>>, + #[cfg(not(any(target_os = "android", target_arch = "wasm32")))] on_watch: Option< + Box) + Send + 'static>, + >, ) -> wgpu::ShaderModuleDescriptor<'static> { #[cfg(not(any(target_os = "android", target_arch = "wasm32")))] { @@ -145,10 +150,6 @@ fn maybe_watch( } } -fn is_compute_shader(shader: RustGPUShader) -> bool { - shader == RustGPUShader::Compute -} - #[derive(StructOpt)] #[structopt(name = "example-runner-wgpu")] pub struct Options { @@ -156,14 +157,20 @@ pub struct Options { shader: RustGPUShader, } -#[cfg_attr(target_os = "android", ndk_glue::main(backtrace = "on"))] -pub fn main() { - env_logger::init(); +#[cfg_attr(target_os = "android", export_name = "android_main")] +pub fn main( + #[cfg(target_os = "android")] android_app: winit::platform::android::activity::AndroidApp, +) { let options: Options = Options::from_args(); - if is_compute_shader(options.shader) { - compute::start(&options); - } else { - graphics::start(&options); + #[cfg(not(any(target_os = "android", target_arch = "wasm32")))] + if options.shader == RustGPUShader::Compute { + return compute::start(&options); } + + graphics::start( + #[cfg(target_os = "android")] + android_app, + &options, + ); }