From 3dcc373205c4f948fa003867388cd9edb93222f1 Mon Sep 17 00:00:00 2001 From: Jinlei Li Date: Fri, 21 Jul 2023 05:23:49 +0800 Subject: [PATCH] Remove `fs` `math` mod form app-surface --- Cargo.lock | 99 +- Cargo.toml | 21 +- app-surface/Cargo.lock | 1986 ---------------------------- app-surface/Cargo.toml | 3 +- app-surface/src/fs/file_sys.rs | 19 - app-surface/src/fs/ios_fs.rs | 57 - app-surface/src/fs/mod.rs | 51 - app-surface/src/fs/web_fs.rs | 19 - app-surface/src/lib.rs | 3 - app-surface/src/math/mod.rs | 16 - app-surface/src/math/position.rs | 91 -- app-surface/src/math/rect.rs | 115 -- app-surface/src/math/size.rs | 137 -- app-surface/src/touch.rs | 10 +- wgpu-in-app/Cargo.toml | 1 - wgpu-in-app/src/examples/cube.rs | 16 +- wgpu-in-app/src/examples/mod.rs | 13 - wgpu-in-app/src/examples/shadow.rs | 110 +- wgpu-in-app/src/examples/water.rs | 2 +- wgpu-in-app/src/ffi/android.rs | 4 +- wgpu-in-app/src/ffi/ios.rs | 5 +- 21 files changed, 120 insertions(+), 2658 deletions(-) delete mode 100644 app-surface/Cargo.lock delete mode 100644 app-surface/src/fs/file_sys.rs delete mode 100644 app-surface/src/fs/ios_fs.rs delete mode 100644 app-surface/src/fs/mod.rs delete mode 100644 app-surface/src/fs/web_fs.rs delete mode 100644 app-surface/src/math/mod.rs delete mode 100644 app-surface/src/math/position.rs delete mode 100644 app-surface/src/math/rect.rs delete mode 100644 app-surface/src/math/size.rs diff --git a/Cargo.lock b/Cargo.lock index d24d356..34d8776 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,20 +39,20 @@ dependencies = [ [[package]] name = "android_log-sys" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85965b6739a430150bdd138e2374a98af0c3ee0d030b3bb7fc3bddff58d0102e" +checksum = "27f0fc03f560e1aebde41c2398b691cb98b5ea5996a6184a7a67bbbb77448969" [[package]] name = "android_logger" -version = "0.10.1" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9ed09b18365ed295d722d0b5ed59c01b79a826ff2d2a8f73d5ecca8e6fb2f66" +checksum = "3fa490e751f3878eb9accb9f18988eca52c2337ce000a8bf31ef50d4c723ca9e" dependencies = [ "android_log-sys", - "env_logger 0.8.4", - "lazy_static", + "env_logger 0.10.0", "log", + "once_cell", ] [[package]] @@ -73,13 +73,12 @@ dependencies = [ "async-executor", "core-graphics 0.23.0", "env_logger 0.9.3", + "glam", "jni", - "lazy_static", "libc", "log", "ndk-sys", "objc", - "objc-foundation", "pollster", "raw-window-handle 0.5.2", "wasm-bindgen", @@ -88,15 +87,6 @@ dependencies = [ "winit", ] -[[package]] -name = "approx" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f2a05fd1bd10b2527e20a2cd32d8873d115b8b39fe219ee25f42a8aca6ba278" -dependencies = [ - "num-traits", -] - [[package]] name = "arrayref" version = "0.3.7" @@ -305,16 +295,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "cgmath" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a98d30140e3296250832bbaaff83b27dcd6fa3cc70fb6f1f3e5c9c0023b5317" -dependencies = [ - "approx", - "num-traits", -] - [[package]] name = "clap" version = "3.2.25" @@ -661,25 +641,25 @@ checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] name = "env_logger" -version = "0.8.4" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" dependencies = [ + "atty", + "humantime", "log", "regex", + "termcolor", ] [[package]] name = "env_logger" -version = "0.9.3" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" dependencies = [ - "atty", - "humantime", "log", "regex", - "termcolor", ] [[package]] @@ -853,9 +833,9 @@ checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" [[package]] name = "glam" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12f597d56c1bd55a811a1be189459e8fad2bbc272616375602443bdfb37fa774" +checksum = "42218cb640844e3872cc3c153dc975229e080a6c4733b34709ef445610550226" [[package]] name = "glob" @@ -1008,16 +988,18 @@ dependencies = [ [[package]] name = "jni" -version = "0.19.0" +version = "0.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +checksum = "1a87aa2bb7d2af34197c04845522473242e1aa17c12f4935d5856491a7fb8c97" dependencies = [ "cesu8", + "cfg-if", "combine", "jni-sys", "log", "thiserror", "walkdir", + "windows-sys 0.45.0", ] [[package]] @@ -1317,10 +1299,11 @@ dependencies = [ [[package]] name = "noise" -version = "0.7.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82051dd6745d5184c6efb7bc8be14892a7f6d4f3ad6dbf754d1c7d7d5fe24b43" +checksum = "9ba869e17168793186c10ca82c7079a4ffdeac4f1a7d9e755b9491c028180e40" dependencies = [ + "num-traits", "rand", "rand_xorshift", ] @@ -1375,17 +1358,6 @@ dependencies = [ "objc_exception", ] -[[package]] -name = "objc-foundation" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" -dependencies = [ - "block", - "objc", - "objc_id", -] - [[package]] name = "objc_exception" version = "0.1.2" @@ -1395,15 +1367,6 @@ dependencies = [ "cc", ] -[[package]] -name = "objc_id" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" -dependencies = [ - "objc", -] - [[package]] name = "object" version = "0.30.4" @@ -1493,9 +1456,9 @@ dependencies = [ [[package]] name = "pollster" -version = "0.2.5" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7" +checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" [[package]] name = "ppv-lite86" @@ -2241,7 +2204,7 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.7.4", + "libloading 0.8.0", "log", "metal", "naga", @@ -2268,7 +2231,6 @@ dependencies = [ "app-surface", "async-executor", "bytemuck", - "cgmath", "env_logger 0.9.3", "glam", "jni", @@ -2368,6 +2330,15 @@ dependencies = [ "windows_x86_64_msvc 0.36.1", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + [[package]] name = "windows-sys" version = "0.48.0" diff --git a/Cargo.toml b/Cargo.toml index c1b1c21..b12db6a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,12 +4,11 @@ members = ["wgpu-in-app", "app-surface", "cargo-so"] default-members = ["wgpu-in-app"] [workspace.dependencies] -bytemuck = { version = "1.9.1", features = ["derive"] } -cgmath = "0.18" -glam = "0.22" +bytemuck = { version = "1.13", features = ["derive"] } +glam = "0.24" log = "0.4" -noise = { version = "0.7", default-features = false } -pollster = "0.2" +noise = { version = "0.8", default-features = false } +pollster = "0.3" rand = { version = "0.7.2" } # wgpu = "0.16" wgpu = { git = "https://github.com/gfx-rs/wgpu", rev = "757245cd" } @@ -25,20 +24,18 @@ env_logger = "0.9" libc = "*" objc = "*" core-graphics = "*" -objc-foundation = "*" -lazy_static = "1.4" # android target -android_logger = "0.10.1" -jni = "0.19" +android_logger = "0.13" +jni = "0.21" jni_fn = "0.1" ndk-sys = "*" ash = "0.37.3" # wasm target -web-sys = "0.3.61" -wasm-bindgen = "0.2.83" -js-sys = "0.3.63" +web-sys = "0.3.64" +wasm-bindgen = "0.2.87" +js-sys = "0.3.64" wasm-bindgen-futures = "0.4.34" # parking_lot 0.12 switches from `winapi` to `windows`; permit either parking_lot = ">=0.11,<0.13" diff --git a/app-surface/Cargo.lock b/app-surface/Cargo.lock deleted file mode 100644 index c664298..0000000 --- a/app-surface/Cargo.lock +++ /dev/null @@ -1,1986 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "ahash" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" -dependencies = [ - "getrandom", - "once_cell", - "version_check", -] - -[[package]] -name = "aho-corasick" -version = "0.7.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f" -dependencies = [ - "memchr", -] - -[[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.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9ed09b18365ed295d722d0b5ed59c01b79a826ff2d2a8f73d5ecca8e6fb2f66" -dependencies = [ - "android_log-sys", - "env_logger 0.8.4", - "lazy_static", - "log", -] - -[[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 = "app-surface" -version = "0.1.1" -dependencies = [ - "android_logger", - "async-executor", - "core-graphics", - "env_logger 0.9.0", - "jni", - "lazy_static", - "libc", - "log", - "ndk-sys 0.3.0", - "objc", - "objc-foundation", - "pollster", - "raw-window-handle 0.5.0", - "wasm-bindgen", - "web-sys", - "wee_alloc", - "wgpu", - "winit", -] - -[[package]] -name = "arrayref" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "arrayvec" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" - -[[package]] -name = "ash" -version = "0.37.0+1.3.209" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "006ca68e0f2b03f22d6fa9f2860f85aed430d257fec20f8879b2145e7c7ae1a6" -dependencies = [ - "libloading", -] - -[[package]] -name = "async-executor" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "871f9bb5e0a22eeb7e8cf16641feb87c9dc67032ccf8ff49e772eb9941d3a965" -dependencies = [ - "async-task", - "concurrent-queue", - "fastrand", - "futures-lite", - "once_cell", - "slab", -] - -[[package]] -name = "async-task" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d306121baf53310a3fd342d88dc0824f6bbeace68347593658525565abee8" - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "bit-set" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e11e16035ea35e4e5997b393eacbf6f63983188f7a2ad25bfb13465f5ad59de" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "block" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" - -[[package]] -name = "bumpalo" -version = "3.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a45a46ab1f2412e53d3a0ade76ffad2025804294569aae387231a0cd6e0899" - -[[package]] -name = "bytemuck" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f5715e491b5a1598fc2bef5a606847b5dc1d48ea625bd3c02c00de8285591da" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" - -[[package]] -name = "cache-padded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1db59621ec70f09c5e9b597b220c7a2b43611f4710dc03ceb8748637775692c" - -[[package]] -name = "calloop" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22a6a8f622f797120d452c630b0ab12e1331a1a753e2039ce7868d4ac77b4ee" -dependencies = [ - "log", - "nix 0.24.2", - "slotmap", - "thiserror", - "vec_map", -] - -[[package]] -name = "cc" -version = "1.0.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" - -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" - -[[package]] -name = "cfg_aliases" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" - -[[package]] -name = "cmake" -version = "0.1.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" -dependencies = [ - "cc", -] - -[[package]] -name = "cocoa" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" -dependencies = [ - "bitflags", - "block", - "cocoa-foundation", - "core-foundation", - "core-graphics", - "foreign-types 0.3.2", - "libc", - "objc", -] - -[[package]] -name = "cocoa-foundation" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" -dependencies = [ - "bitflags", - "block", - "core-foundation", - "core-graphics-types", - "foreign-types 0.3.2", - "libc", - "objc", -] - -[[package]] -name = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - -[[package]] -name = "combine" -version = "4.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50b727aacc797f9fc28e355d21f34709ac4fc9adecfe470ad07b8f4464f53062" -dependencies = [ - "bytes", - "memchr", -] - -[[package]] -name = "concurrent-queue" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ed07550be01594c6026cff2a1d7fe9c8f683caa798e12b68694ac9e88286a3" -dependencies = [ - "cache-padded", -] - -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[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.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2581bbab3b8ffc6fcbd550bf46c355135d16e9ff2a6ea032ad6b9bf1d7efe4fb" -dependencies = [ - "bitflags", - "core-foundation", - "core-graphics-types", - "foreign-types 0.3.2", - "libc", -] - -[[package]] -name = "core-graphics-types" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" -dependencies = [ - "bitflags", - "core-foundation", - "foreign-types 0.3.2", - "libc", -] - -[[package]] -name = "core-text" -version = "19.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" -dependencies = [ - "core-foundation", - "core-graphics", - "foreign-types 0.3.2", - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crossfont" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f66b1c1979c4362323f03ab6bf7fb522902bfc418e0c37319ab347f9561d980f" -dependencies = [ - "cocoa", - "core-foundation", - "core-foundation-sys", - "core-graphics", - "core-text", - "dwrote", - "foreign-types 0.5.0", - "freetype-rs", - "libc", - "log", - "objc", - "once_cell", - "pkg-config", - "servo-fontconfig", - "winapi", -] - -[[package]] -name = "cty" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" - -[[package]] -name = "d3d12" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "827914e1f53b1e0e025ecd3d967a7836b7bcb54520f90e21ef8df7b4d88a2759" -dependencies = [ - "bitflags", - "libloading", - "winapi", -] - -[[package]] -name = "darling" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0d720b8683f8dd83c65155f0530560cba68cd2bf395f6513a483caee57ff7f4" -dependencies = [ - "darling_core", - "darling_macro", -] - -[[package]] -name = "darling_core" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a340f241d2ceed1deb47ae36c4144b2707ec7dd0b649f894cb39bb595986324" -dependencies = [ - "fnv", - "ident_case", - "proc-macro2", - "quote", - "strsim", - "syn", -] - -[[package]] -name = "darling_macro" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72c41b3b7352feb3211a0d743dc5700a4e3b60f51bd2b368892d1e0f9a95f44b" -dependencies = [ - "darling_core", - "quote", - "syn", -] - -[[package]] -name = "dispatch" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" - -[[package]] -name = "dlib" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" -dependencies = [ - "libloading", -] - -[[package]] -name = "downcast-rs" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" - -[[package]] -name = "dwrote" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" -dependencies = [ - "lazy_static", - "libc", - "serde", - "serde_derive", - "winapi", - "wio", -] - -[[package]] -name = "env_logger" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" -dependencies = [ - "log", - "regex", -] - -[[package]] -name = "env_logger" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b2cf0344971ee6c64c31be0d530793fba457d322dfec2810c453d0ef228f9c3" -dependencies = [ - "atty", - "humantime", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "expat-sys" -version = "2.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658f19728920138342f68408b7cf7644d90d4784353d8ebc32e7e8663dbe45fa" -dependencies = [ - "cmake", - "pkg-config", -] - -[[package]] -name = "fastrand" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fcf0cee53519c866c09b5de1f6c56ff9d647101f81c1964fa632e148896cdf" -dependencies = [ - "instant", -] - -[[package]] -name = "flate2" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared 0.1.1", -] - -[[package]] -name = "foreign-types" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" -dependencies = [ - "foreign-types-macros", - "foreign-types-shared 0.3.1", -] - -[[package]] -name = "foreign-types-macros" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8469d0d40519bc608ec6863f1cc88f3f1deee15913f2f3b3e573d81ed38cccc" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "foreign-types-shared" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" - -[[package]] -name = "freetype-rs" -version = "0.26.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74eadec9d0a5c28c54bb9882e54787275152a4e36ce206b45d7451384e5bf5fb" -dependencies = [ - "bitflags", - "freetype-sys", - "libc", -] - -[[package]] -name = "freetype-sys" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" -dependencies = [ - "cmake", - "libc", - "pkg-config", -] - -[[package]] -name = "futures-core" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" - -[[package]] -name = "futures-io" -version = "0.3.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" - -[[package]] -name = "futures-lite" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7694489acd39452c77daa48516b894c153f192c3578d5a839b62c58099fcbf48" -dependencies = [ - "fastrand", - "futures-core", - "futures-io", - "memchr", - "parking", - "pin-project-lite", - "waker-fn", -] - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "getrandom" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d39cd93900197114fa1fcb7ae84ca742095eed9442088988ae74fa744e930e77" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", -] - -[[package]] -name = "glow" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919" -dependencies = [ - "js-sys", - "slotmap", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "gpu-alloc" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fc59e5f710e310e76e6707f86c561dd646f69a8876da9131703b2f717de818d" -dependencies = [ - "bitflags", - "gpu-alloc-types", -] - -[[package]] -name = "gpu-alloc-types" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54804d0d6bc9d7f26db4eaec1ad10def69b599315f487d32c334a80d1efe67a5" -dependencies = [ - "bitflags", -] - -[[package]] -name = "gpu-descriptor" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a538f217be4d405ff4719a283ca68323cc2384003eca5baaa87501e821c81dda" -dependencies = [ - "bitflags", - "gpu-descriptor-types", - "hashbrown", -] - -[[package]] -name = "gpu-descriptor-types" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126" -dependencies = [ - "bitflags", -] - -[[package]] -name = "hashbrown" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hexf-parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" - -[[package]] -name = "humantime" -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.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "282a6247722caba404c065016bbfa522806e51714c34f5dfc3e4a3a46fcb4223" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[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", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "jni" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" -dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", -] - -[[package]] -name = "jni-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" - -[[package]] -name = "js-sys" -version = "0.3.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "khronos-egl" -version = "4.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" -dependencies = [ - "libc", - "libloading", - "pkg-config", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "libc" -version = "0.2.134" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "329c933548736bc49fd575ee68c89e8be4d260064184389a5b77517cddd99ffb" - -[[package]] -name = "libloading" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" -dependencies = [ - "cfg-if 1.0.0", - "winapi", -] - -[[package]] -name = "lock_api" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88943dd7ef4a2e5a4bfa2753aaab3013e34ce2533d1996fb18ef591e315e2b3b" -dependencies = [ - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "malloc_buf" -version = "0.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" -dependencies = [ - "libc", -] - -[[package]] -name = "memchr" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" - -[[package]] -name = "memmap2" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498" -dependencies = [ - "libc", -] - -[[package]] -name = "memoffset" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" -dependencies = [ - "autocfg", -] - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[package]] -name = "metal" -version = "0.24.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de11355d1f6781482d027a3b4d4de7825dcedb197bf573e0596d00008402d060" -dependencies = [ - "bitflags", - "block", - "core-graphics-types", - "foreign-types 0.3.2", - "log", - "objc", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96590ba8f175222643a85693f33d26e9c8a015f599c216509b1a6894af675d34" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba272f85fa0b41fc91872be579b3bbe0f56b792aa361a380eb669469f68dafb2" -dependencies = [ - "libc", - "log", - "miow", - "ntapi", - "winapi", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", -] - -[[package]] -name = "naga" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "262d2840e72dbe250e8cf2f522d080988dfca624c4112c096238a4845f591707" -dependencies = [ - "bit-set", - "bitflags", - "codespan-reporting", - "hexf-parse", - "indexmap", - "log", - "num-traits", - "rustc-hash", - "spirv", - "termcolor", - "thiserror", - "unicode-xid", -] - -[[package]] -name = "ndk" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" -dependencies = [ - "bitflags", - "jni-sys", - "ndk-sys 0.4.0", - "num_enum", - "raw-window-handle 0.5.0", - "thiserror", -] - -[[package]] -name = "ndk-context" -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 0.4.0", - "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.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" -dependencies = [ - "jni-sys", -] - -[[package]] -name = "ndk-sys" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21d83ec9c63ec5bf950200a8e508bdad6659972187b625469f58ef8c08e29046" -dependencies = [ - "jni-sys", -] - -[[package]] -name = "nix" -version = "0.22.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" -dependencies = [ - "bitflags", - "cc", - "cfg-if 1.0.0", - "libc", - "memoffset", -] - -[[package]] -name = "nix" -version = "0.24.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" -dependencies = [ - "bitflags", - "cfg-if 1.0.0", - "libc", - "memoffset", -] - -[[package]] -name = "nom" -version = "7.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d11e1ef389c76fe5b81bcaf2ea32cf88b62bc494e19f493d0b30e7a930109" -dependencies = [ - "memchr", - "minimal-lexical", - "version_check", -] - -[[package]] -name = "ntapi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" -dependencies = [ - "winapi", -] - -[[package]] -name = "num-traits" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_enum" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "720d3ea1055e4e4574c0c0b0f8c3fd4f24c4cdaf465948206dea090b57b526ad" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d992b768490d7fe0d8586d9b5745f6c49f557da6d81dc982b1d167ad4edbb21" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "objc" -version = "0.2.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" -dependencies = [ - "malloc_buf", - "objc_exception", -] - -[[package]] -name = "objc-foundation" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1add1b659e36c9607c7aab864a76c7a4c2760cd0cd2e120f3fb8b952c7e22bf9" -dependencies = [ - "block", - "objc", - "objc_id", -] - -[[package]] -name = "objc_exception" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" -dependencies = [ - "cc", -] - -[[package]] -name = "objc_id" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c92d4ddb4bd7b50d730c215ff871754d0da6b2178849f8a2a2ab69712d0c073b" -dependencies = [ - "objc", -] - -[[package]] -name = "once_cell" -version = "1.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" - -[[package]] -name = "parking" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" - -[[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" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core 0.9.3", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" -dependencies = [ - "cfg-if 1.0.0", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09a279cbf25cb0757810394fbc1e359949b59e348145c643a939a525692e6929" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall", - "smallvec", - "windows-sys", -] - -[[package]] -name = "percent-encoding" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" - -[[package]] -name = "pin-project-lite" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e280fbe77cc62c91527259e9442153f4688736748d24660126286329742b4c6c" - -[[package]] -name = "pkg-config" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58893f751c9b0412871a09abd62ecd2a00298c6c83befa223ef98c52aef40cbe" - -[[package]] -name = "png" -version = "0.17.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f0e7f4c94ec26ff209cee506314212639d6c91b80afb82984819fafce9df01c" -dependencies = [ - "bitflags", - "crc32fast", - "flate2", - "miniz_oxide", -] - -[[package]] -name = "pollster" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5da3b0203fd7ee5720aa0b5e790b591aa5d3f41c3ed2c34a3a393382198af2f7" - -[[package]] -name = "proc-macro-crate" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" -dependencies = [ - "thiserror", - "toml", -] - -[[package]] -name = "proc-macro2" -version = "1.0.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7342d5883fbccae1cc37a2353b09c87c9b0f3afd73f5fb9bba687a1f733b029" -dependencies = [ - "unicode-xid", -] - -[[package]] -name = "profiling" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9145ac0af1d93c638c98c40cf7d25665f427b2a44ad0a99b1dccf3e2f25bb987" - -[[package]] -name = "quote" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "864d3e96a899863136fc6e99f3d7cae289dafe43bf2c5ac19b70df7210c0a145" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "range-alloc" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "63e935c45e09cc6dcf00d2f0b2d630a58f4095320223d47fc68918722f0538b6" - -[[package]] -name = "raw-window-handle" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b800beb9b6e7d2df1fe337c9e3d04e3af22a124460fb4c30fcc22c9117cefb41" -dependencies = [ - "cty", -] - -[[package]] -name = "raw-window-handle" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a" -dependencies = [ - "cty", -] - -[[package]] -name = "redox_syscall" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" -dependencies = [ - "bitflags", -] - -[[package]] -name = "regex" -version = "1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" - -[[package]] -name = "renderdoc-sys" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "safe_arch" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ff3d6d9696af502cc3110dacce942840fb06ff4514cad92236ecc455f2ce05" -dependencies = [ - "bytemuck", -] - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scoped-tls" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "sctk-adwaita" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "04b7c47a572f73de28bee5b5060d085b42b6ce1e4ee2b49c956ea7b25e94b6f0" -dependencies = [ - "crossfont", - "log", - "smithay-client-toolkit", - "tiny-skia", -] - -[[package]] -name = "serde" -version = "1.0.136" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce31e24b01e1e524df96f1c2fdd054405f8d7376249a5110886fb4b658484789" - -[[package]] -name = "serde_derive" -version = "1.0.136" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08597e7152fcd306f41838ed3e37be9eaeed2b61c42e2117266a554fab4662f9" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "servo-fontconfig" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7e3e22fe5fd73d04ebf0daa049d3efe3eae55369ce38ab16d07ddd9ac5c217c" -dependencies = [ - "libc", - "servo-fontconfig-sys", -] - -[[package]] -name = "servo-fontconfig-sys" -version = "5.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36b879db9892dfa40f95da1c38a835d41634b825fbd8c4c418093d53c24b388" -dependencies = [ - "expat-sys", - "freetype-sys", - "pkg-config", -] - -[[package]] -name = "slab" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" - -[[package]] -name = "slotmap" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" -dependencies = [ - "version_check", -] - -[[package]] -name = "smallvec" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" - -[[package]] -name = "smithay-client-toolkit" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f307c47d32d2715eb2e0ece5589057820e0e5e70d07c247d1063e844e107f454" -dependencies = [ - "bitflags", - "calloop", - "dlib", - "lazy_static", - "log", - "memmap2", - "nix 0.24.2", - "pkg-config", - "wayland-client", - "wayland-cursor", - "wayland-protocols", -] - -[[package]] -name = "spirv" -version = "0.2.0+1.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" -dependencies = [ - "bitflags", - "num-traits", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "strsim" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" - -[[package]] -name = "syn" -version = "1.0.86" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a65b3f4ffa0092e9887669db0eae07941f023991ab58ea44da8fe8e2d511c6b" -dependencies = [ - "proc-macro2", - "quote", - "unicode-xid", -] - -[[package]] -name = "termcolor" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dfed899f0eb03f32ee8c6a0aabdb8a7949659e3466561fc0adf54e26d88c5f4" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tiny-skia" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "642680569bb895b16e4b9d181c60be1ed136fa0c9c7f11d004daf053ba89bf82" -dependencies = [ - "arrayref", - "arrayvec 0.5.2", - "bytemuck", - "cfg-if 1.0.0", - "png", - "safe_arch", - "tiny-skia-path", -] - -[[package]] -name = "tiny-skia-path" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c114d32f0c2ee43d585367cb013dfaba967ab9f62b90d9af0d696e955e70fa6c" -dependencies = [ - "arrayref", - "bytemuck", -] - -[[package]] -name = "toml" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31142970826733df8241ef35dc040ef98c679ab14d7c3e54d827099b3acecaa" -dependencies = [ - "serde", -] - -[[package]] -name = "unicode-width" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - -[[package]] -name = "version_check" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" - -[[package]] -name = "waker-fn" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d5b2c62b4012a3e1eca5a7e077d13b3bf498c4073e33ccd58626607748ceeca" - -[[package]] -name = "walkdir" -version = "2.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "808cf2735cd4b6866113f648b791c6adc5714537bc222d9347bb203386ffda56" -dependencies = [ - "same-file", - "winapi", - "winapi-util", -] - -[[package]] -name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" - -[[package]] -name = "wasm-bindgen" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" -dependencies = [ - "cfg-if 1.0.0", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" - -[[package]] -name = "wayland-client" -version = "0.29.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91223460e73257f697d9e23d401279123d36039a3f7a449e983f123292d4458f" -dependencies = [ - "bitflags", - "downcast-rs", - "libc", - "nix 0.22.3", - "scoped-tls", - "wayland-commons", - "wayland-scanner", - "wayland-sys", -] - -[[package]] -name = "wayland-commons" -version = "0.29.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94f6e5e340d7c13490eca867898c4cec5af56c27a5ffe5c80c6fc4708e22d33e" -dependencies = [ - "nix 0.22.3", - "once_cell", - "smallvec", - "wayland-sys", -] - -[[package]] -name = "wayland-cursor" -version = "0.29.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c52758f13d5e7861fc83d942d3d99bf270c83269575e52ac29e5b73cb956a6bd" -dependencies = [ - "nix 0.22.3", - "wayland-client", - "xcursor", -] - -[[package]] -name = "wayland-protocols" -version = "0.29.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60147ae23303402e41fe034f74fb2c35ad0780ee88a1c40ac09a3be1e7465741" -dependencies = [ - "bitflags", - "wayland-client", - "wayland-commons", - "wayland-scanner", -] - -[[package]] -name = "wayland-scanner" -version = "0.29.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39a1ed3143f7a143187156a2ab52742e89dac33245ba505c17224df48939f9e0" -dependencies = [ - "proc-macro2", - "quote", - "xml-rs", -] - -[[package]] -name = "wayland-sys" -version = "0.29.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9341df79a8975679188e37dab3889bfa57c44ac2cb6da166f519a81cbe452d4" -dependencies = [ - "dlib", - "lazy_static", - "pkg-config", -] - -[[package]] -name = "web-sys" -version = "0.3.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[package]] -name = "wgpu" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2272b17bffc8a0c7d53897435da7c1db587c87d3a14e8dae9cdb8d1d210fc0f" -dependencies = [ - "arrayvec 0.7.2", - "js-sys", - "log", - "naga", - "parking_lot 0.11.2", - "raw-window-handle 0.5.0", - "smallvec", - "static_assertions", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "wgpu-core", - "wgpu-hal", - "wgpu-types", -] - -[[package]] -name = "wgpu-core" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73d14cad393054caf992ee02b7da6a372245d39a484f7461c1f44f6f6359bd28" -dependencies = [ - "arrayvec 0.7.2", - "bit-vec", - "bitflags", - "cfg_aliases", - "codespan-reporting", - "fxhash", - "log", - "naga", - "parking_lot 0.11.2", - "profiling", - "raw-window-handle 0.5.0", - "smallvec", - "thiserror", - "web-sys", - "wgpu-hal", - "wgpu-types", -] - -[[package]] -name = "wgpu-hal" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdae6a80dbc725343f02f854b310b37190be946aeea65e9d83afaa7d840ebaac" -dependencies = [ - "android_system_properties", - "arrayvec 0.7.2", - "ash", - "bit-set", - "bitflags", - "block", - "core-graphics-types", - "d3d12", - "foreign-types 0.3.2", - "fxhash", - "glow", - "gpu-alloc", - "gpu-descriptor", - "js-sys", - "khronos-egl", - "libloading", - "log", - "metal", - "naga", - "objc", - "parking_lot 0.11.2", - "profiling", - "range-alloc", - "raw-window-handle 0.5.0", - "renderdoc-sys", - "smallvec", - "thiserror", - "wasm-bindgen", - "web-sys", - "wgpu-types", - "winapi", -] - -[[package]] -name = "wgpu-types" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28fb86c1909233c804aa79b7dd1ad06ebd979b2a465e3e980582db0ea9e69f3f" -dependencies = [ - "bitflags", -] - -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - -[[package]] -name = "winapi-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - -[[package]] -name = "windows-sys" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" -dependencies = [ - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" - -[[package]] -name = "windows_i686_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" - -[[package]] -name = "windows_i686_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" - -[[package]] -name = "winit" -version = "0.27.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a22e94ba35ca3ff11820044bfa0dc48b95a3a15569c0068555566a12ef41c9e5" -dependencies = [ - "bitflags", - "cocoa", - "core-foundation", - "core-graphics", - "dispatch", - "instant", - "libc", - "log", - "mio", - "ndk", - "ndk-glue", - "objc", - "once_cell", - "parking_lot 0.12.1", - "percent-encoding", - "raw-window-handle 0.4.3", - "raw-window-handle 0.5.0", - "sctk-adwaita", - "smithay-client-toolkit", - "wasm-bindgen", - "wayland-client", - "wayland-protocols", - "web-sys", - "windows-sys", - "x11-dl", -] - -[[package]] -name = "wio" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" -dependencies = [ - "winapi", -] - -[[package]] -name = "x11-dl" -version = "2.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" -dependencies = [ - "lazy_static", - "libc", - "pkg-config", -] - -[[package]] -name = "xcursor" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" -dependencies = [ - "nom", -] - -[[package]] -name = "xml-rs" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" diff --git a/app-surface/Cargo.toml b/app-surface/Cargo.toml index 7872f31..baef4bd 100644 --- a/app-surface/Cargo.toml +++ b/app-surface/Cargo.toml @@ -14,6 +14,7 @@ webgl = ["wgpu/webgl"] [dependencies] log.workspace = true +glam.workspace = true pollster.workspace = true wgpu.workspace = true @@ -29,10 +30,8 @@ raw-window-handle.workspace = true [target.'cfg(target_os = "ios")'.dependencies] core-graphics.workspace = true env_logger.workspace = true -lazy_static.workspace = true libc.workspace = true objc.workspace = true -objc-foundation.workspace = true [target.'cfg(target_os = "android")'.dependencies] android_logger.workspace = true diff --git a/app-surface/src/fs/file_sys.rs b/app-surface/src/fs/file_sys.rs deleted file mode 100644 index 67b8ea4..0000000 --- a/app-surface/src/fs/file_sys.rs +++ /dev/null @@ -1,19 +0,0 @@ -use std::path::PathBuf; - -pub struct FileSystem<'a> { - base_path: &'a str, -} - -impl<'a> FileSystem<'a> { - pub fn new(base_path: &'a str) -> Self { - FileSystem { base_path } - } - - pub fn get_bundle_url() -> &'static str { - "" - } - - pub fn get_texture_file_path(&self, name: &str) -> PathBuf { - PathBuf::from(self.base_path).join("assets").join(name) - } -} diff --git a/app-surface/src/fs/ios_fs.rs b/app-surface/src/fs/ios_fs.rs deleted file mode 100644 index 51ee80a..0000000 --- a/app-surface/src/fs/ios_fs.rs +++ /dev/null @@ -1,57 +0,0 @@ -extern crate objc; -use self::objc::{runtime::Object, *}; -extern crate objc_foundation; -use self::objc_foundation::{INSString, NSString}; - -extern crate lazy_static; -use self::lazy_static::*; - -use std::path::PathBuf; - -lazy_static! { - static ref BUNDLE_PATH: &'static str = get_bundle_url(); -} - -fn get_bundle_url() -> &'static str { - let cls = class!(NSBundle); - let path: &str = unsafe { - // Allocate an instance - let bundle: *mut Object = msg_send![cls, mainBundle]; - // let url: *mut Object = msg_send![*bundle, resourcePath]; - // 资源路径要用 resourcePath - let path: &NSString = msg_send![bundle, resourcePath]; - path.as_str() - }; - path -} - -pub struct FileSystem<'a> { - _base_path: &'a str, -} - -impl<'a> FileSystem<'a> { - pub fn new(_base_path: &'a str) -> Self { - FileSystem { _base_path } - } - - pub fn get_bundle_url() -> &'static str { - &BUNDLE_PATH - } - - pub fn get_shader_path(name: &str, suffix: &str) -> String { - FileSystem::get_spirv_file_path(name, suffix) - } - - fn get_spirv_file_path(name: &str, suffix: &str) -> String { - let mut p = name.to_string().replace('/', "_"); - p = get_bundle_url().to_string() + "/shader-spirv/" + &p; - p += &format!("_{suffix}.spv"); - - p - } - - pub fn get_texture_file_path(&self, name: &str) -> PathBuf { - let p = get_bundle_url().to_string() + "/assets/" + name; - PathBuf::from(&p) - } -} diff --git a/app-surface/src/fs/mod.rs b/app-surface/src/fs/mod.rs deleted file mode 100644 index c725c9a..0000000 --- a/app-surface/src/fs/mod.rs +++ /dev/null @@ -1,51 +0,0 @@ -use std::path::PathBuf; - -#[cfg_attr(target_os = "ios", path = "ios_fs.rs")] -#[cfg_attr(target_arch = "wasm32", path = "web_fs.rs")] -mod file_sys; - -pub use file_sys::FileSystem; - -pub fn get_texture_file_path(name: &str) -> PathBuf { - let base_dir = application_root_dir(); - let f = FileSystem::new(&base_dir); - f.get_texture_file_path(name) -} - -// Returns the cargo manifest directory when running the executable with cargo -// or the directory in which the executable resides otherwise, -// traversing symlinks if necessary. -#[cfg(target_arch = "wasm32")] -pub fn application_root_dir() -> String { - let host = web_sys::window().unwrap().location().host().unwrap(); - "http://".to_string() + &host -} - -#[cfg(not(target_arch = "wasm32"))] -pub fn application_root_dir() -> String { - use std::env; - use std::fs; - - match env::var("PROFILE") { - Ok(_) => String::from(env!("CARGO_MANIFEST_DIR")), - Err(_) => { - let mut path = env::current_exe().expect("Failed to find executable path."); - while let Ok(target) = fs::read_link(path.clone()) { - path = target; - } - if cfg!(any( - target_os = "macos", - target_os = "windows", - target_os = "linux" - )) { - path = path.join("../../../").canonicalize().unwrap(); - } - String::from( - path.parent() - .expect("Failed to get parent directory of the executable.") - .to_str() - .unwrap(), - ) - } - } -} diff --git a/app-surface/src/fs/web_fs.rs b/app-surface/src/fs/web_fs.rs deleted file mode 100644 index 67b8ea4..0000000 --- a/app-surface/src/fs/web_fs.rs +++ /dev/null @@ -1,19 +0,0 @@ -use std::path::PathBuf; - -pub struct FileSystem<'a> { - base_path: &'a str, -} - -impl<'a> FileSystem<'a> { - pub fn new(base_path: &'a str) -> Self { - FileSystem { base_path } - } - - pub fn get_bundle_url() -> &'static str { - "" - } - - pub fn get_texture_file_path(&self, name: &str) -> PathBuf { - PathBuf::from(self.base_path).join("assets").join(name) - } -} diff --git a/app-surface/src/lib.rs b/app-surface/src/lib.rs index 3c21303..874c19e 100644 --- a/app-surface/src/lib.rs +++ b/app-surface/src/lib.rs @@ -1,6 +1,5 @@ use std::{ops::Deref, sync::Arc}; -pub mod math; mod touch; pub use touch::*; @@ -9,8 +8,6 @@ pub use touch::*; mod app_surface; pub use app_surface::*; -pub mod fs; - #[repr(C)] #[derive(Debug)] pub struct ViewSize { diff --git a/app-surface/src/math/mod.rs b/app-surface/src/math/mod.rs deleted file mode 100644 index d4553e5..0000000 --- a/app-surface/src/math/mod.rs +++ /dev/null @@ -1,16 +0,0 @@ -#[derive(Copy, Clone, Debug)] -pub struct EdgeInset { - pub top: f32, - pub right: f32, - pub bottom: f32, - pub left: f32, -} - -mod rect; -pub use rect::Rect; - -mod size; -pub use size::Size; - -mod position; -pub use position::Position; diff --git a/app-surface/src/math/position.rs b/app-surface/src/math/position.rs deleted file mode 100644 index 62a5257..0000000 --- a/app-surface/src/math/position.rs +++ /dev/null @@ -1,91 +0,0 @@ -#[repr(C)] -#[derive(Copy, Clone, Debug)] -pub struct Position { - pub x: f32, - pub y: f32, -} -impl Position { - pub fn new(x: f32, y: f32) -> Self { - Position { x, y } - } - - pub fn zero() -> Self { - Position::new(0.0, 0.0) - } - - pub fn is_equal_zero(&self) -> bool { - self.x == 0.0 && self.y == 0.0 - } - - // 加减乘除运算 - pub fn add(&self, other: &Position) -> Self { - Position::new(self.x + other.x, self.y + other.y) - } - - pub fn minus(&self, other: &Position) -> Self { - Position::new(self.x - other.x, self.y - other.y) - } - - pub fn multiply_f(&self, param: f32) -> Self { - Position::new(self.x * param, self.y * param) - } - - pub fn divide_f(&self, param: f32) -> Self { - Position::new(self.x / param, self.y / param) - } - - pub fn offset(&self, dx: f32, dy: f32) -> Self { - Position::new(self.x + dx, self.y + dy) - } - - pub fn distance(&self, other: &Position) -> f32 { - ((self.x - other.x).powf(2.0) + (self.y - other.y).powf(2.0)).sqrt() - } - - pub fn length(&self) -> f32 { - (self.x.powf(2.0) + self.y.powf(2.0)).sqrt() - } - - // 取整 - pub fn round(&self) -> Self { - Position::new(self.x.round(), self.y.round()) - } - - // 基于斜率及距离,计算点的坐标 - pub fn new_by_slope_n_dis(&self, slope: f32, distance: f32) -> Self { - Position::new( - self.x + distance * slope.cos(), - self.y + distance * slope.sin(), - ) - } - - // 求矢量的模 - pub fn vector_mod(&self) -> f32 { - (self.x.powf(2.0) + self.y.powf(2.0)).sqrt() - } - - pub fn slope_with(&self, last: &Position) -> f32 { - (self.y - last.y) / (self.x - last.x) - } - - pub fn slope_ridian(&self, last: &Position) -> f32 { - // atan2 求出的θ取值范围是[-PI, PI] - (self.y - last.y).atan2(self.x - last.x) - } - - pub fn cross_multiply(&self, other: &Position) -> f32 { - self.x * other.y - self.y * other.x - } -} - -impl From for [f32; 2] { - fn from(vs: Position) -> Self { - [vs.x, vs.y] - } -} - -impl From<[f32; 2]> for Position { - fn from(vs: [f32; 2]) -> Self { - Position::new(vs[0], vs[1]) - } -} diff --git a/app-surface/src/math/rect.rs b/app-surface/src/math/rect.rs deleted file mode 100644 index c584efa..0000000 --- a/app-surface/src/math/rect.rs +++ /dev/null @@ -1,115 +0,0 @@ -use super::Position; -use crate::math::Size; - -#[derive(Copy, Clone, Debug)] -pub struct Rect { - pub x: f32, - pub y: f32, - pub width: f32, - pub height: f32, - pub origin: Position, - pub size: Size, -} - -impl Rect { - pub fn new(width: f32, height: f32, center_to: Position) -> Self { - let x = center_to.x - width / 2.0; - let y = center_to.y + height / 2.0; - Rect { - x, - y, - width, - height, - origin: Position::new(x, y), - size: (width, height).into(), - } - } - - pub fn get_standard_new() -> Self { - Rect { - x: 0.0, - y: 0.0, - width: 1.0, - height: 1.0, - origin: Position::zero(), - size: (1.0, 1.0).into(), - } - } - - pub fn from_origin_n_size(x: f32, y: f32, width: f32, height: f32) -> Self { - Rect { - x, - y, - width, - height, - origin: Position::new(x, y), - size: (width, height).into(), - } - } - - pub fn zero() -> Self { - Rect { - x: 0.0, - y: 0.0, - width: 0.0, - height: 0.0, - origin: Position::zero(), - size: (0.0, 0.0).into(), - } - } - - // 将像素坐标转换成NDC空间中的坐标 - // 这个空间可能不是当前可见视口,需要传入实际 reander target 的尺寸 - pub fn get_std_coord(&self, viewport_size: Size) -> Self { - let half_w = viewport_size.width / 2.0; - let half_h = viewport_size.height / 2.0; - // 像素在NDC空间对应的值 - let x = (self.x - half_w) / half_w; - let mut y = (self.y - half_h) / half_h; - // 反转 y 坐标 - y *= -1.0; - let width = self.width / half_w; - let height = self.height / half_h; - - Rect { - x, - y, - width, - height, - origin: Position::new(x, y), - size: (width, height).into(), - } - } - - pub fn center_x(&self) -> f32 { - self.x + self.width / 2.0 - } - - pub fn center_y(&self) -> f32 { - self.y + self.height / 2.0 - } - - pub fn anchor(&self) -> Position { - Position::new(self.center_x(), self.center_y()) - } - - // 中心点移动到坐标原点 - pub fn move_anchor_to_origin(&mut self) { - self.x = -self.width / 2.0; - self.y = self.height / 2.0; - self.origin = Position::new(self.x, self.y); - } - - // 一个正交投影坐标是否在区域内 - pub fn is_ortho_intersect(&self, ortho_point: Position) -> bool { - let x_left = -self.center_x(); - let x_right = self.center_x(); - let y_top = self.center_y(); - let y_bottom = -self.center_y(); - - ortho_point.x >= x_left - && ortho_point.x <= x_right - && ortho_point.y >= y_bottom - && ortho_point.y <= y_top - } -} diff --git a/app-surface/src/math/size.rs b/app-surface/src/math/size.rs deleted file mode 100644 index d08970a..0000000 --- a/app-surface/src/math/size.rs +++ /dev/null @@ -1,137 +0,0 @@ -use super::{EdgeInset, Rect}; - -#[derive(Copy, Clone, Debug)] -pub struct Size { - pub width: T, - pub height: T, -} - -impl Size { - // 计算等比填充的 rect 坐标 - // margin: 填充区的边界 - // fill_size: 待缩放填充图形的原始尺寸 - pub fn aspect_fit(&self, margin: EdgeInset, fill_size: Size) -> Rect { - // 待填充区 - let valid_w = self.width - margin.left - margin.right; - let valid_h = self.height - margin.top - margin.bottom; - let self_ratio = valid_w / valid_h; - let external_size_ratio = fill_size.width / fill_size.height; - let ratio = if external_size_ratio > self_ratio { - // 按宽顶边计算缩放比 - valid_w / fill_size.width - } else { - valid_h / fill_size.height - }; - // 缩放后的 size - let new_fill_size: Size = (fill_size.width * ratio, fill_size.height * ratio).into(); - Rect::from_origin_n_size( - margin.left + (valid_w - new_fill_size.width) / 2.0, - margin.top + (valid_h - new_fill_size.height) / 2.0, - new_fill_size.width, - new_fill_size.height, - ) - } -} - -impl From<[u32; 2]> for Size { - fn from(vs: [u32; 2]) -> Self { - Size { - width: vs[0], - height: vs[1], - } - } -} - -impl From> for [u32; 2] { - fn from(s: Size) -> Self { - [s.width, s.height] - } -} - -impl From<(u32, u32)> for Size { - fn from(data: (u32, u32)) -> Self { - Size { - width: data.0, - height: data.1, - } - } -} - -impl From> for (u32, u32) { - fn from(s: Size) -> Self { - (s.width, s.height) - } -} -impl From for Size { - fn from(data: wgpu::Extent3d) -> Self { - Size { - width: data.width as f32, - height: data.height as f32, - } - } -} -impl From for Size { - fn from(data: wgpu::Extent3d) -> Self { - Size { - width: data.width, - height: data.height, - } - } -} - -impl From<[f32; 2]> for Size { - fn from(vs: [f32; 2]) -> Self { - Size { - width: vs[0], - height: vs[1], - } - } -} - -impl From> for [f32; 2] { - fn from(s: Size) -> Self { - [s.width, s.height] - } -} - -impl From<(f32, f32)> for Size { - fn from(data: (f32, f32)) -> Self { - Size { - width: data.0, - height: data.1, - } - } -} - -impl From> for (f32, f32) { - fn from(s: Size) -> Self { - (s.width, s.height) - } -} - -impl From for Size { - fn from(data: super::Position) -> Self { - Size { - width: data.x, - height: data.y, - } - } -} - -impl From<&wgpu::SurfaceConfiguration> for Size { - fn from(data: &wgpu::SurfaceConfiguration) -> Self { - Size { - width: data.width as f32, - height: data.height as f32, - } - } -} - -impl From<&wgpu::SurfaceConfiguration> for Size { - fn from(data: &wgpu::SurfaceConfiguration) -> Self { - Size { - width: data.width, - height: data.height, - } - } -} diff --git a/app-surface/src/touch.rs b/app-surface/src/touch.rs index efa0f7c..80bdc89 100644 --- a/app-surface/src/touch.rs +++ b/app-surface/src/touch.rs @@ -18,7 +18,7 @@ pub enum TouchPhase { #[derive(Copy, Clone, Debug)] pub struct Touch { pub phase: TouchPhase, - pub position: crate::math::Position, + pub position: glam::Vec2, // The angle of the stylus: Apple Pencil pub stylus_angle: Option>, pub pressure: f32, @@ -29,19 +29,19 @@ pub struct Touch { } impl Touch { - pub fn touch_start(position: crate::math::Position) -> Self { + pub fn touch_start(position: glam::Vec2) -> Self { Self::new(position, TouchPhase::Started) } - pub fn touch_move(position: crate::math::Position) -> Self { + pub fn touch_move(position: glam::Vec2) -> Self { Self::new(position, TouchPhase::Moved) } - pub fn touch_end(position: crate::math::Position) -> Self { + pub fn touch_end(position: glam::Vec2) -> Self { Self::new(position, TouchPhase::Ended) } - fn new(position: crate::math::Position, phase: TouchPhase) -> Self { + fn new(position: glam::Vec2, phase: TouchPhase) -> Self { Touch { position, phase, diff --git a/wgpu-in-app/Cargo.toml b/wgpu-in-app/Cargo.toml index fa6cf5e..241128a 100644 --- a/wgpu-in-app/Cargo.toml +++ b/wgpu-in-app/Cargo.toml @@ -19,7 +19,6 @@ package = "app-surface" [dependencies] bytemuck.workspace = true -cgmath.workspace = true glam.workspace = true log.workspace = true noise.workspace = true diff --git a/wgpu-in-app/src/examples/cube.rs b/wgpu-in-app/src/examples/cube.rs index ad079a8..6e807b7 100644 --- a/wgpu-in-app/src/examples/cube.rs +++ b/wgpu-in-app/src/examples/cube.rs @@ -319,15 +319,15 @@ impl Cube { } } - fn generate_matrix(aspect_ratio: f32) -> cgmath::Matrix4 { - let mx_projection = cgmath::perspective(cgmath::Deg(45f32), aspect_ratio, 1.0, 10.0); - let mx_view = cgmath::Matrix4::look_at_rh( - cgmath::Point3::new(1.5f32, -5.0, 3.0), - cgmath::Point3::new(0f32, 0.0, 0.0), - cgmath::Vector3::unit_z(), + fn generate_matrix(aspect_ratio: f32) -> glam::Mat4 { + let projection = + glam::Mat4::perspective_rh(std::f32::consts::FRAC_PI_4, aspect_ratio, 1.0, 10.0); + let view = glam::Mat4::look_at_rh( + glam::Vec3::new(1.5f32, -5.0, 3.0), + glam::Vec3::ZERO, + glam::Vec3::Z, ); - let mx_correction = super::OPENGL_TO_WGPU_MATRIX; - mx_correction * mx_projection * mx_view + projection * view } } diff --git a/wgpu-in-app/src/examples/mod.rs b/wgpu-in-app/src/examples/mod.rs index 9d93419..1f7ce30 100644 --- a/wgpu-in-app/src/examples/mod.rs +++ b/wgpu-in-app/src/examples/mod.rs @@ -33,16 +33,3 @@ pub use shadow::Shadow; mod hdr_image_view; pub use hdr_image_view::HDRImageView; - -// mod page_turning; -// pub use page_turning::PageTurning; - -// copy from wgpu's example -#[rustfmt::skip] -#[allow(unused)] -pub const OPENGL_TO_WGPU_MATRIX: cgmath::Matrix4 = cgmath::Matrix4::new( - 1.0, 0.0, 0.0, 0.0, - 0.0, 1.0, 0.0, 0.0, - 0.0, 0.0, 0.5, 0.0, - 0.0, 0.0, 0.5, 1.0, -); diff --git a/wgpu-in-app/src/examples/shadow.rs b/wgpu-in-app/src/examples/shadow.rs index fead798..7b51135 100644 --- a/wgpu-in-app/src/examples/shadow.rs +++ b/wgpu-in-app/src/examples/shadow.rs @@ -3,10 +3,10 @@ use super::Example; use app_surface::{AppSurface, SurfaceFrame}; -use std::{borrow::Cow, iter, mem, ops::Range, rc::Rc}; +use std::{borrow::Cow, f32::consts, iter, mem, ops::Range, rc::Rc}; use bytemuck::{Pod, Zeroable}; -use wgpu::util::DeviceExt; +use wgpu::util::{align_to, DeviceExt}; #[repr(C)] #[derive(Clone, Copy, Pod, Zeroable)] @@ -82,7 +82,7 @@ fn create_plane(size: i8) -> (Vec, Vec) { } struct Entity { - mx_world: cgmath::Matrix4, + mx_world: glam::Mat4, rotation_speed: f32, color: wgpu::Color, vertex_buf: Rc, @@ -93,7 +93,7 @@ struct Entity { } struct Light { - pos: cgmath::Point3, + pos: glam::Vec3, color: wgpu::Color, fov: f32, depth: Range, @@ -110,20 +110,16 @@ struct LightRaw { impl Light { fn to_raw(&self) -> LightRaw { - use cgmath::{Deg, EuclideanSpace, Matrix4, PerspectiveFov, Point3, Vector3}; - - let mx_view = Matrix4::look_at_rh(self.pos, Point3::origin(), Vector3::unit_z()); - let projection = PerspectiveFov { - fovy: Deg(self.fov).into(), - aspect: 1.0, - near: self.depth.start, - far: self.depth.end, - }; - let mx_correction = super::OPENGL_TO_WGPU_MATRIX; - let mx_view_proj = - mx_correction * cgmath::Matrix4::from(projection.to_perspective()) * mx_view; + let view = glam::Mat4::look_at_rh(self.pos, glam::Vec3::ZERO, glam::Vec3::Z); + let projection = glam::Mat4::perspective_rh( + self.fov * consts::PI / 180., + 1.0, + self.depth.start, + self.depth.end, + ); + let view_proj = projection * view; LightRaw { - proj: *mx_view_proj.as_ref(), + proj: view_proj.to_cols_array_2d(), pos: [self.pos.x, self.pos.y, self.pos.z, 1.0], color: [ self.color.r as f32, @@ -177,15 +173,14 @@ impl Shadow { }; const DEPTH_FORMAT: wgpu::TextureFormat = wgpu::TextureFormat::Depth32Float; - fn generate_matrix(aspect_ratio: f32) -> cgmath::Matrix4 { - let mx_projection = cgmath::perspective(cgmath::Deg(45f32), aspect_ratio, 1.0, 20.0); - let mx_view = cgmath::Matrix4::look_at_rh( - cgmath::Point3::new(3.0f32, -10.0, 6.0), - cgmath::Point3::new(0f32, 0.0, 0.0), - cgmath::Vector3::unit_z(), + fn generate_matrix(aspect_ratio: f32) -> glam::Mat4 { + let projection = glam::Mat4::perspective_rh(consts::FRAC_PI_4, aspect_ratio, 1.0, 20.0); + let view = glam::Mat4::look_at_rh( + glam::Vec3::new(3.0f32, -10.0, 6.0), + glam::Vec3::new(0f32, 0.0, 0.0), + glam::Vec3::Z, ); - let mx_correction = super::OPENGL_TO_WGPU_MATRIX; - mx_correction * mx_projection * mx_view + projection * view } fn create_depth_texture( @@ -214,6 +209,13 @@ impl Shadow { let config = &app_surface.config; let device = &app_surface.device; + let supports_storage_resources = app_surface + .adapter + .get_downlevel_capabilities() + .flags + .contains(wgpu::DownlevelFlags::VERTEX_STORAGE) + && device.limits().max_storage_buffers_per_shader_stage > 0; + // Create the vertex and index buffers let vertex_size = mem::size_of::(); let (cube_vertex_data, cube_index_data) = create_cube(); @@ -245,34 +247,33 @@ impl Shadow { contents: bytemuck::cast_slice(&plane_index_data), usage: wgpu::BufferUsages::INDEX, }); - struct CubeDesc { - offset: cgmath::Vector3, + offset: glam::Vec3, angle: f32, scale: f32, rotation: f32, } let cube_descs = [ CubeDesc { - offset: cgmath::vec3(-2.0, -2.0, 2.0), + offset: glam::Vec3::new(-2.0, -2.0, 2.0), angle: 10.0, scale: 0.7, rotation: 0.1, }, CubeDesc { - offset: cgmath::vec3(2.0, -2.0, 2.0), + offset: glam::Vec3::new(2.0, -2.0, 2.0), angle: 50.0, scale: 1.3, rotation: 0.2, }, CubeDesc { - offset: cgmath::vec3(-2.0, 2.0, 2.0), + offset: glam::Vec3::new(-2.0, 2.0, 2.0), angle: 140.0, scale: 1.1, rotation: 0.3, }, CubeDesc { - offset: cgmath::vec3(2.0, 2.0, 2.0), + offset: glam::Vec3::new(2.0, 2.0, 2.0), angle: 210.0, scale: 0.9, rotation: 0.4, @@ -285,12 +286,7 @@ impl Shadow { let uniform_alignment = { let alignment = device.limits().min_uniform_buffer_offset_alignment as wgpu::BufferAddress; - let multiple = entity_uniform_size / alignment; - if entity_uniform_size % alignment != 0 { - alignment * (multiple + 1) - } else { - alignment * multiple - } + align_to(entity_uniform_size, alignment) }; // Note: dynamic uniform offsets also have to be aligned to `Limits::min_uniform_buffer_offset_alignment`. let entity_uniform_buf = device.create_buffer(&wgpu::BufferDescriptor { @@ -303,9 +299,8 @@ impl Shadow { let index_format = wgpu::IndexFormat::Uint16; let mut entities = vec![{ - use cgmath::SquareMatrix; Entity { - mx_world: cgmath::Matrix4::identity(), + mx_world: glam::Mat4::IDENTITY, rotation_speed: 0.0, color: wgpu::Color::WHITE, vertex_buf: Rc::new(plane_vertex_buf), @@ -317,15 +312,16 @@ impl Shadow { }]; for (i, cube) in cube_descs.iter().enumerate() { - use cgmath::{Decomposed, Deg, InnerSpace, Quaternion, Rotation3}; - - let transform = Decomposed { - disp: cube.offset, - rot: Quaternion::from_axis_angle(cube.offset.normalize(), Deg(cube.angle)), - scale: cube.scale, - }; + let mx_world = glam::Mat4::from_scale_rotation_translation( + glam::Vec3::splat(cube.scale), + glam::Quat::from_axis_angle( + cube.offset.normalize(), + cube.angle * consts::PI / 180., + ), + cube.offset, + ); entities.push(Entity { - mx_world: cgmath::Matrix4::from(transform), + mx_world, rotation_speed: cube.rotation, color: wgpu::Color::GREEN, vertex_buf: Rc::clone(&cube_vertex_buf), @@ -404,7 +400,7 @@ impl Shadow { .collect::>(); let lights = vec![ Light { - pos: cgmath::Point3::new(7.0, -5.0, 10.0), + pos: glam::Vec3::new(7.0, -5.0, 10.0), color: wgpu::Color { r: 0.5, g: 1.0, @@ -416,7 +412,7 @@ impl Shadow { target_view: shadow_target_views[0].take().unwrap(), }, Light { - pos: cgmath::Point3::new(-5.0, 7.0, 10.0), + pos: glam::Vec3::new(-5.0, 7.0, 10.0), color: wgpu::Color { r: 1.0, g: 0.5, @@ -433,8 +429,11 @@ impl Shadow { let light_storage_buf = device.create_buffer(&wgpu::BufferDescriptor { label: None, size: light_uniform_size, - usage: wgpu::BufferUsages::STORAGE - | wgpu::BufferUsages::COPY_SRC + usage: if supports_storage_resources { + wgpu::BufferUsages::STORAGE + } else { + wgpu::BufferUsages::UNIFORM + } | wgpu::BufferUsages::COPY_SRC | wgpu::BufferUsages::COPY_DST, mapped_at_creation: false, }); @@ -588,7 +587,7 @@ impl Shadow { let mx_total = Self::generate_matrix(config.width as f32 / config.height as f32); let forward_uniforms = GlobalUniforms { - proj: *mx_total.as_ref(), + proj: mx_total.to_cols_array_2d(), num_lights: [lights.len() as u32, 0, 0, 0], }; let uniform_buf = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { @@ -697,11 +696,12 @@ impl Example for Shadow { // update uniforms for entity in self.entities.iter_mut() { if entity.rotation_speed != 0.0 { - let rotation = cgmath::Matrix4::from_angle_x(cgmath::Deg(entity.rotation_speed)); - entity.mx_world = entity.mx_world * rotation; + let rotation = + glam::Mat4::from_rotation_x(entity.rotation_speed * consts::PI / 180.); + entity.mx_world *= rotation; } let data = EntityUniforms { - model: entity.mx_world.into(), + model: entity.mx_world.to_cols_array_2d(), color: [ entity.color.r as f32, entity.color.g as f32, diff --git a/wgpu-in-app/src/examples/water.rs b/wgpu-in-app/src/examples/water.rs index b997030..c636707 100644 --- a/wgpu-in-app/src/examples/water.rs +++ b/wgpu-in-app/src/examples/water.rs @@ -104,7 +104,7 @@ impl Water { let terrain_vertex_size = mem::size_of::(); // Noise generation - let terrain_noise = noise::OpenSimplex::new(); + let terrain_noise = noise::OpenSimplex::default(); // Random colouration let mut terrain_random = rand::rngs::StdRng::seed_from_u64(42); diff --git a/wgpu-in-app/src/ffi/android.rs b/wgpu-in-app/src/ffi/android.rs index 4fc85af..1856216 100644 --- a/wgpu-in-app/src/ffi/android.rs +++ b/wgpu-in-app/src/ffi/android.rs @@ -5,13 +5,13 @@ use jni::objects::JClass; use jni::sys::{jint, jlong, jobject}; use jni::JNIEnv; use jni_fn::jni_fn; -use log::{info, Level}; +use log::{info, LevelFilter}; #[no_mangle] #[jni_fn("name.jinleili.wgpu.RustBridge")] pub fn createWgpuCanvas(env: *mut JNIEnv, _: JClass, surface: jobject, idx: jint) -> jlong { log_panics::init(); - android_logger::init_once(Config::default().with_min_level(Level::Info)); + android_logger::init_once(Config::default().with_max_level(LevelFilter::Error)); let canvas = WgpuCanvas::new(AppSurface::new(env as *mut _, surface), idx); info!("WgpuCanvas created!"); Box::into_raw(Box::new(canvas)) as jlong diff --git a/wgpu-in-app/src/ffi/ios.rs b/wgpu-in-app/src/ffi/ios.rs index feaaae3..0c3b97c 100644 --- a/wgpu-in-app/src/ffi/ios.rs +++ b/wgpu-in-app/src/ffi/ios.rs @@ -3,7 +3,10 @@ use app_surface::{AppSurface, IOSViewObj}; #[no_mangle] pub fn create_wgpu_canvas(ios_obj: IOSViewObj) -> *mut libc::c_void { - println!("create_wgpu_canvas, maximum frames: {}", ios_obj.maximum_frames); + println!( + "create_wgpu_canvas, maximum frames: {}", + ios_obj.maximum_frames + ); let obj = WgpuCanvas::new(AppSurface::new(ios_obj), 0_i32); // 使用 Box 对 Rust 对象进行装箱操作。 // 我们无法将 Rust 对象直接传递给外部语言,通过装箱来传递此对象的胖指针