diff --git a/.vscode/launch.json b/.vscode/launch.json index 43fbb5f..cc22320 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -23,7 +23,7 @@ "cwd": "${workspaceFolder}", "env": { "RUST_BACKTRACE": "1", - "RUST_LOG": "debug" + "WGPU_BACKEND": "dx12", } }, { @@ -45,7 +45,6 @@ "cwd": "${workspaceFolder}", "env": { "RUST_BACKTRACE": "1", - "RUST_LOG": "debug" } }, { diff --git a/Cargo.lock b/Cargo.lock index 91f6fee..568fb12 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -20,14 +20,23 @@ checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" [[package]] name = "accesskit" -version = "0.12.3" +version = "0.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74a4b14f3d99c1255dcba8f45621ab1a2e7540a0009652d33989005a4d0bfc6b" +checksum = "ef7442f1f520649b8e11ee3af6caeec24123fed4b63bc36a85b67308d8514fdf" dependencies = [ "enumn", "serde", ] +[[package]] +name = "addr2line" +version = "0.24.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" +dependencies = [ + "gimli", +] + [[package]] name = "adler2" version = "2.0.0" @@ -58,25 +67,10 @@ dependencies = [ ] [[package]] -name = "android-activity" -version = "0.5.2" +name = "allocator-api2" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee91c0c2905bae44f84bfa4e044536541df26b7703fd0888deeb9060fcc44289" -dependencies = [ - "android-properties", - "bitflags 2.6.0", - "cc", - "cesu8", - "jni", - "jni-sys", - "libc", - "log", - "ndk 0.8.0", - "ndk-context", - "ndk-sys 0.5.0+25.2.9519653", - "num_enum", - "thiserror", -] +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-activity" @@ -92,9 +86,9 @@ dependencies = [ "jni-sys", "libc", "log", - "ndk 0.9.0", + "ndk", "ndk-context", - "ndk-sys 0.6.0+11769913", + "ndk-sys", "num_enum", "thiserror", ] @@ -120,6 +114,55 @@ dependencies = [ "libc", ] +[[package]] +name = "anstream" +version = "0.6.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" + +[[package]] +name = "anstyle-parse" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" +dependencies = [ + "windows-sys 0.52.0", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" +dependencies = [ + "anstyle", + "windows-sys 0.52.0", +] + [[package]] name = "anyhow" version = "1.0.89" @@ -134,7 +177,7 @@ checksum = "df099ccb16cd014ff054ac1bf392c67feeef57164b05c42f037cd40f5d4357f4" dependencies = [ "clipboard-win", "log", - "objc2 0.5.2", + "objc2", "objc2-app-kit", "objc2-foundation", "parking_lot", @@ -159,6 +202,15 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" +[[package]] +name = "ash" +version = "0.37.3+1.3.251" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" +dependencies = [ + "libloading 0.7.4", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -171,6 +223,36 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" +[[package]] +name = "backtrace" +version = "0.3.74" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +dependencies = [ + "addr2line", + "cfg-if", + "libc", + "miniz_oxide", + "object", + "rustc-demangle", + "windows-targets 0.52.6", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +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" @@ -184,23 +266,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] -name = "block-sys" -version = "0.2.1" +name = "block" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae85a0696e7ea3b835a453750bf002770776609115e6d25c6d2ff28a8200f7e7" -dependencies = [ - "objc-sys", -] - -[[package]] -name = "block2" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15b55663a85f33501257357e6421bb33e769d5c9ffb5ba0921c975a123e35e68" -dependencies = [ - "block-sys", - "objc2 0.4.1", -] +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "block2" @@ -208,7 +277,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2c132eebf10f5cad5289222520a4a058514204aed6d791f1cf4fe8088b82d15f" dependencies = [ - "objc2 0.5.2", + "objc2", ] [[package]] @@ -255,20 +324,6 @@ version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" -[[package]] -name = "calloop" -version = "0.12.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" -dependencies = [ - "bitflags 2.6.0", - "log", - "polling", - "rustix", - "slab", - "thiserror", -] - [[package]] name = "calloop" version = "0.13.0" @@ -283,25 +338,13 @@ dependencies = [ "thiserror", ] -[[package]] -name = "calloop-wayland-source" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f0ea9b9476c7fad82841a8dbb380e2eae480c21910feba80725b46931ed8f02" -dependencies = [ - "calloop 0.12.4", - "rustix", - "wayland-backend", - "wayland-client", -] - [[package]] name = "calloop-wayland-source" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "95a66a987056935f7efce4ab5668920b5d0dac4a7c99991a67395f13702ddd20" dependencies = [ - "calloop 0.13.0", + "calloop", "rustix", "wayland-backend", "wayland-client", @@ -309,9 +352,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.1.24" +version = "1.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812acba72f0a070b003d3697490d2b55b837230ae7c6c6497f05cc2ddbb8d938" +checksum = "e8d9e0b4957f635b8d3da819d0db5603620467ecf1f692d22a8c2717ce27e6d8" dependencies = [ "jobserver", "libc", @@ -330,12 +373,6 @@ 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 = "cfg_aliases" version = "0.2.1" @@ -375,6 +412,28 @@ dependencies = [ "error-code", ] +[[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 = "colorchoice" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" + +[[package]] +name = "com-rs" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" + [[package]] name = "combine" version = "4.6.7" @@ -453,6 +512,25 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "crossbeam-deque" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + [[package]] name = "crossbeam-utils" version = "0.8.20" @@ -465,6 +543,17 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" +[[package]] +name = "d3d12" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20" +dependencies = [ + "bitflags 2.6.0", + "libloading 0.8.5", + "winapi", +] + [[package]] name = "directories" version = "5.0.1" @@ -492,29 +581,13 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" -[[package]] -name = "display-info" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6e3843b0c9a0470b137a6acc899ef429c9e77082e8a5cceed6896aa5d15d2ea" -dependencies = [ - "anyhow", - "core-graphics", - "fxhash", - "log", - "smithay-client-toolkit 0.18.1", - "widestring", - "windows", - "xcb", -] - [[package]] name = "dlib" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading", + "libloading 0.8.5", ] [[package]] @@ -545,28 +618,27 @@ dependencies = [ "anyhow", "chrono", "directories", - "display-info", "eframe", "egui", "egui_extras", "env_logger", - "femtovg", - "glutin 0.32.1", "log", + "pixels", "rand", + "rayon", "serde", "serde_json", "toml", "wasm-bindgen-futures", "web-sys", - "winit 0.30.5", + "winit", ] [[package]] name = "ecolor" -version = "0.28.1" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e6b451ff1143f6de0f33fc7f1b68fecfd2c7de06e104de96c4514de3f5396f8" +checksum = "775cfde491852059e386c4e1deb4aef381c617dc364184c6f6afee99b87c402b" dependencies = [ "bytemuck", "emath", @@ -575,9 +647,9 @@ dependencies = [ [[package]] name = "eframe" -version = "0.28.1" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6490ef800b2e41ee129b1f32f9ac15f713233fe3bc18e241a1afe1e4fb6811e0" +checksum = "8ac2645a9bf4826eb4e91488b1f17b8eaddeef09396706b2f14066461338e24f" dependencies = [ "ahash", "bytemuck", @@ -585,33 +657,33 @@ dependencies = [ "egui", "egui-winit", "egui_glow", - "glow", - "glutin 0.31.3", + "glow 0.14.1", + "glutin", "glutin-winit", "image", "js-sys", "log", - "objc2 0.5.2", + "objc2", "objc2-app-kit", "objc2-foundation", "parking_lot", "percent-encoding", - "raw-window-handle 0.5.2", "raw-window-handle 0.6.2", "static_assertions", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", - "web-time 0.2.4", + "web-time", "winapi", - "winit 0.29.15", + "windows-sys 0.52.0", + "winit", ] [[package]] name = "egui" -version = "0.28.1" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20c97e70a2768de630f161bb5392cbd3874fcf72868f14df0e002e82e06cb798" +checksum = "53eafabcce0cb2325a59a98736efe0bf060585b437763f8c476957fb274bb974" dependencies = [ "accesskit", "ahash", @@ -624,9 +696,9 @@ dependencies = [ [[package]] name = "egui-winit" -version = "0.28.1" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fac4e066af341bf92559f60dbdf2020b2a03c963415349af5f3f8d79ff7a4926" +checksum = "0a9c430f4f816340e8e8c1b20eec274186b1be6bc4c7dfc467ed50d57abc36c6" dependencies = [ "ahash", "arboard", @@ -634,46 +706,51 @@ dependencies = [ "log", "raw-window-handle 0.6.2", "smithay-clipboard", - "web-time 0.2.4", + "web-time", "webbrowser", - "winit 0.29.15", + "winit", ] [[package]] name = "egui_extras" -version = "0.28.1" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb783d9fa348f69ed5c340aa25af78b5472043090e8b809040e30960cc2a746" +checksum = "bf3c1f5cd8dfe2ade470a218696c66cf556fcfd701e7830fa2e9f4428292a2a1" dependencies = [ "ahash", "egui", "enum-map", "log", "mime_guess2", - "serde", ] [[package]] name = "egui_glow" -version = "0.28.1" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e2bdc8b38cfa17cc712c4ae079e30c71c00cd4c2763c9e16dc7860a02769103" +checksum = "0e39bccc683cd43adab530d8f21a13eb91e80de10bcc38c3f1c16601b6f62b26" dependencies = [ "ahash", "bytemuck", "egui", - "glow", + "glow 0.14.1", "log", "memoffset", "wasm-bindgen", "web-sys", ] +[[package]] +name = "either" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" + [[package]] name = "emath" -version = "0.28.1" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6a21708405ea88f63d8309650b4d77431f4bc28fb9d8e6f77d3963b51249e6" +checksum = "b1fe0049ce51d0fb414d029e668dd72eb30bc2b739bf34296ed97bd33df544f3" dependencies = [ "bytemuck", "serde", @@ -711,36 +788,53 @@ dependencies = [ "syn", ] +[[package]] +name = "env_filter" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +dependencies = [ + "log", + "regex", +] + [[package]] name = "env_logger" -version = "0.10.2" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd405aab171cb85d6735e5c8d9db038c17d3ca007a4d2c25f337935c3d90580" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" dependencies = [ + "anstream", + "anstyle", + "env_filter", "humantime", - "is-terminal", "log", - "regex", - "termcolor", ] [[package]] name = "epaint" -version = "0.28.1" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f0dcc0a0771e7500e94cd1cb797bd13c9f23b9409bdc3c824e2cbc562b7fa01" +checksum = "a32af8da821bd4f43f2c137e295459ee2e1661d87ca8779dfa0eaf45d870e20f" dependencies = [ "ab_glyph", "ahash", "bytemuck", "ecolor", "emath", + "epaint_default_fonts", "log", "nohash-hasher", "parking_lot", "serde", ] +[[package]] +name = "epaint_default_fonts" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "483440db0b7993cf77a20314f08311dbe95675092405518c0677aa08c151a3ea" + [[package]] name = "equivalent" version = "1.0.1" @@ -772,28 +866,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "femtovg" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47921d14afc4daad9bedc926099bc6edcaa23e37a957448f86cdefcbafe2f632" -dependencies = [ - "bitflags 2.6.0", - "fnv", - "glow", - "image", - "imgref", - "log", - "lru", - "rgb", - "rustybuzz", - "slotmap", - "unicode-bidi", - "unicode-segmentation", - "wasm-bindgen", - "web-sys", -] - [[package]] name = "flate2" version = "1.0.34" @@ -804,12 +876,6 @@ dependencies = [ "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.5.0" @@ -846,15 +912,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - [[package]] name = "gethostname" version = "0.4.3" @@ -876,6 +933,12 @@ dependencies = [ "wasi", ] +[[package]] +name = "gimli" +version = "0.31.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" + [[package]] name = "gl_generator" version = "0.14.0" @@ -889,9 +952,9 @@ dependencies = [ [[package]] name = "glow" -version = "0.13.1" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" +checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" dependencies = [ "js-sys", "slotmap", @@ -900,27 +963,15 @@ dependencies = [ ] [[package]] -name = "glutin" -version = "0.31.3" +name = "glow" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18fcd4ae4e86d991ad1300b8f57166e5be0c95ef1f63f3f5b827f8a164548746" +checksum = "2f4a888dbe8181a7535853469c21c67ca9a1cea9460b16808fc018ea9e55d248" dependencies = [ - "bitflags 2.6.0", - "cfg_aliases 0.1.1", - "cgl", - "core-foundation 0.9.4", - "dispatch", - "glutin_egl_sys 0.6.0", - "glutin_glx_sys 0.5.0", - "glutin_wgl_sys 0.5.0", - "icrate", - "libloading", - "objc2 0.4.1", - "once_cell", - "raw-window-handle 0.5.2", - "wayland-sys", - "windows-sys 0.48.0", - "x11-dl", + "js-sys", + "slotmap", + "wasm-bindgen", + "web-sys", ] [[package]] @@ -930,15 +981,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec69412a0bf07ea7607e638b415447857a808846c2b685a43c8aa18bc6d5e499" dependencies = [ "bitflags 2.6.0", - "cfg_aliases 0.2.1", + "cfg_aliases", "cgl", "core-foundation 0.9.4", "dispatch", - "glutin_egl_sys 0.7.0", - "glutin_glx_sys 0.6.0", - "glutin_wgl_sys 0.6.0", - "libloading", - "objc2 0.5.2", + "glutin_egl_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "libloading 0.8.5", + "objc2", "objc2-app-kit", "objc2-foundation", "once_cell", @@ -950,24 +1001,14 @@ dependencies = [ [[package]] name = "glutin-winit" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebcdfba24f73b8412c5181e56f092b5eff16671c514ce896b258a0a64bd7735" -dependencies = [ - "cfg_aliases 0.1.1", - "glutin 0.31.3", - "raw-window-handle 0.5.2", - "winit 0.29.15", -] - -[[package]] -name = "glutin_egl_sys" -version = "0.6.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77cc5623f5309ef433c3dd4ca1223195347fe62c413da8e2fdd0eb76db2d9bcd" +checksum = "85edca7075f8fc728f28cb8fbb111a96c3b89e930574369e3e9c27eb75d3788f" dependencies = [ - "gl_generator", - "windows-sys 0.48.0", + "cfg_aliases", + "glutin", + "raw-window-handle 0.6.2", + "winit", ] [[package]] @@ -982,40 +1023,89 @@ dependencies = [ [[package]] name = "glutin_glx_sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a165fd686c10dcc2d45380b35796e577eacfd43d4660ee741ec8ebe2201b3b4f" +checksum = "9c2b2d3918e76e18e08796b55eb64e8fe6ec67d5a6b2e2a7e2edce224ad24c63" dependencies = [ "gl_generator", "x11-dl", ] [[package]] -name = "glutin_glx_sys" +name = "glutin_wgl_sys" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c2b2d3918e76e18e08796b55eb64e8fe6ec67d5a6b2e2a7e2edce224ad24c63" +checksum = "0a4e1951bbd9434a81aa496fe59ccc2235af3820d27b85f9314e279609211e2c" dependencies = [ "gl_generator", - "x11-dl", ] [[package]] -name = "glutin_wgl_sys" -version = "0.5.0" +name = "gpu-alloc" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" +checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "gl_generator", + "bitflags 2.6.0", + "gpu-alloc-types", ] [[package]] -name = "glutin_wgl_sys" -version = "0.6.0" +name = "gpu-alloc-types" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a4e1951bbd9434a81aa496fe59ccc2235af3820d27b85f9314e279609211e2c" +checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "gl_generator", + "bitflags 2.6.0", +] + +[[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.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" +dependencies = [ + "bitflags 2.6.0", + "gpu-descriptor-types", + "hashbrown 0.14.5", +] + +[[package]] +name = "gpu-descriptor-types" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" +dependencies = [ + "bitflags 2.6.0", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", + "allocator-api2", ] [[package]] @@ -1024,12 +1114,33 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" +[[package]] +name = "hassle-rs" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0" +dependencies = [ + "bitflags 1.3.2", + "com-rs", + "libc", + "libloading 0.7.4", + "thiserror", + "widestring", + "winapi", +] + [[package]] name = "hermit-abi" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbf6a919d6cf397374f7dfeeea91d974c7c0a7221d0d0f4f20d859d329e53fcc" +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + [[package]] name = "home" version = "0.5.9" @@ -1056,7 +1167,7 @@ dependencies = [ "iana-time-zone-haiku", "js-sys", "wasm-bindgen", - "windows-core 0.52.0", + "windows-core", ] [[package]] @@ -1068,17 +1179,6 @@ dependencies = [ "cc", ] -[[package]] -name = "icrate" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99d3aaff8a54577104bafdf686ff18565c3b6903ca5782a2026ef06e2c7aa319" -dependencies = [ - "block2 0.3.0", - "dispatch", - "objc2 0.4.1", -] - [[package]] name = "idna" version = "0.5.0" @@ -1102,10 +1202,14 @@ dependencies = [ ] [[package]] -name = "imgref" -version = "1.10.1" +name = "indexmap" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44feda355f4159a7c757171a77de25daf6411e217b4cabd03bd6650690468126" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", +] [[package]] name = "indexmap" @@ -1114,19 +1218,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown", + "hashbrown 0.15.0", ] [[package]] -name = "is-terminal" -version = "0.4.13" +name = "is_terminal_polyfill" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.52.0", -] +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itoa" @@ -1174,6 +1273,17 @@ 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 0.7.4", + "pkg-config", +] + [[package]] name = "khronos_api" version = "3.1.0" @@ -1186,6 +1296,16 @@ version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + [[package]] name = "libloading" version = "0.8.5" @@ -1246,10 +1366,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] -name = "lru" -version = "0.12.4" +name = "malloc_buf" +version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ee39891760e7d94734f6f63fedc29a2e4a152f836120753a72503f09fcf904" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] [[package]] name = "memchr" @@ -1275,6 +1398,21 @@ dependencies = [ "autocfg", ] +[[package]] +name = "metal" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "623b5e6cefd76e58f774bd3cc0c6f5c7615c58c03a97815245a25c3c9bdee318" +dependencies = [ + "bitflags 2.6.0", + "block", + "core-graphics-types", + "foreign-types", + "log", + "objc", + "paste", +] + [[package]] name = "mime" version = "0.3.17" @@ -1302,19 +1440,23 @@ dependencies = [ ] [[package]] -name = "ndk" -version = "0.8.0" +name = "naga" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" +checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e" dependencies = [ + "bit-set", "bitflags 2.6.0", - "jni-sys", + "codespan-reporting", + "hexf-parse", + "indexmap 1.9.3", "log", - "ndk-sys 0.5.0+25.2.9519653", - "num_enum", - "raw-window-handle 0.5.2", - "raw-window-handle 0.6.2", + "num-traits", + "rustc-hash", + "spirv", + "termcolor", "thiserror", + "unicode-xid", ] [[package]] @@ -1326,8 +1468,9 @@ dependencies = [ "bitflags 2.6.0", "jni-sys", "log", - "ndk-sys 0.6.0+11769913", + "ndk-sys", "num_enum", + "raw-window-handle 0.5.2", "raw-window-handle 0.6.2", "thiserror", ] @@ -1338,15 +1481,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" -[[package]] -name = "ndk-sys" -version = "0.5.0+25.2.9519653" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c196769dd60fd4f363e11d948139556a344e79d451aeb2fa2fd040738ef7691" -dependencies = [ - "jni-sys", -] - [[package]] name = "ndk-sys" version = "0.6.0+11769913" @@ -1393,20 +1527,20 @@ dependencies = [ ] [[package]] -name = "objc-sys" -version = "0.3.5" +name = "objc" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", + "objc_exception", +] [[package]] -name = "objc2" -version = "0.4.1" +name = "objc-sys" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "559c5a40fdd30eb5e344fbceacf7595a81e242529fb4e21cf5f43fb4f11ff98d" -dependencies = [ - "objc-sys", - "objc2-encode 3.0.0", -] +checksum = "cdb91bdd390c7ce1a8607f35f3ca7151b65afc0ff5ff3b34fa350f7d7c7e4310" [[package]] name = "objc2" @@ -1415,7 +1549,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "46a785d4eeff09c14c487497c162e92766fbb3e4059a71840cecc03d9a50b804" dependencies = [ "objc-sys", - "objc2-encode 4.0.3", + "objc2-encode", ] [[package]] @@ -1425,9 +1559,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e4e89ad9e3d7d297152b17d39ed92cd50ca8063a89a9fa569046d41568891eff" dependencies = [ "bitflags 2.6.0", - "block2 0.5.1", + "block2", "libc", - "objc2 0.5.2", + "objc2", "objc2-core-data", "objc2-core-image", "objc2-foundation", @@ -1441,8 +1575,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74dd3b56391c7a0596a295029734d3c1c5e7e510a4cb30245f8221ccea96b009" dependencies = [ "bitflags 2.6.0", - "block2 0.5.1", - "objc2 0.5.2", + "block2", + "objc2", "objc2-core-location", "objc2-foundation", ] @@ -1453,8 +1587,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a5ff520e9c33812fd374d8deecef01d4a840e7b41862d849513de77e44aa4889" dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", + "block2", + "objc2", "objc2-foundation", ] @@ -1465,8 +1599,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "617fbf49e071c178c0b24c080767db52958f716d9eabdf0890523aeae54773ef" dependencies = [ "bitflags 2.6.0", - "block2 0.5.1", - "objc2 0.5.2", + "block2", + "objc2", "objc2-foundation", ] @@ -1476,8 +1610,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "55260963a527c99f1819c4f8e3b47fe04f9650694ef348ffd2227e8196d34c80" dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", + "block2", + "objc2", "objc2-foundation", "objc2-metal", ] @@ -1488,18 +1622,12 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "000cfee34e683244f284252ee206a27953279d370e309649dc3ee317b37e5781" dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", + "block2", + "objc2", "objc2-contacts", "objc2-foundation", ] -[[package]] -name = "objc2-encode" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" - [[package]] name = "objc2-encode" version = "4.0.3" @@ -1513,10 +1641,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee638a5da3799329310ad4cfa62fbf045d5f56e3ef5ba4149e7452dcf89d5a8" dependencies = [ "bitflags 2.6.0", - "block2 0.5.1", + "block2", "dispatch", "libc", - "objc2 0.5.2", + "objc2", ] [[package]] @@ -1525,8 +1653,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1a1ae721c5e35be65f01a03b6d2ac13a54cb4fa70d8a5da293d7b0020261398" dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", + "block2", + "objc2", "objc2-app-kit", "objc2-foundation", ] @@ -1538,8 +1666,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd0cba1276f6023976a406a14ffa85e1fdd19df6b0f737b063b95f6c8c7aadd6" dependencies = [ "bitflags 2.6.0", - "block2 0.5.1", - "objc2 0.5.2", + "block2", + "objc2", "objc2-foundation", ] @@ -1550,8 +1678,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e42bee7bff906b14b167da2bac5efe6b6a07e6f7c0a21a7308d40c960242dc7a" dependencies = [ "bitflags 2.6.0", - "block2 0.5.1", - "objc2 0.5.2", + "block2", + "objc2", "objc2-foundation", "objc2-metal", ] @@ -1562,7 +1690,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a684efe3dec1b305badae1a28f6555f6ddd3bb2c2267896782858d5a78404dc" dependencies = [ - "objc2 0.5.2", + "objc2", "objc2-foundation", ] @@ -1573,8 +1701,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8bb46798b20cd6b91cbd113524c490f1686f4c4e8f49502431415f3512e2b6f" dependencies = [ "bitflags 2.6.0", - "block2 0.5.1", - "objc2 0.5.2", + "block2", + "objc2", "objc2-cloud-kit", "objc2-core-data", "objc2-core-image", @@ -1593,8 +1721,8 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "44fa5f9748dbfe1ca6c0b79ad20725a11eca7c2218bceb4b005cb1be26273bfe" dependencies = [ - "block2 0.5.1", - "objc2 0.5.2", + "block2", + "objc2", "objc2-foundation", ] @@ -1605,12 +1733,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76cfcbf642358e8689af64cee815d139339f3ed8ad05103ed5eaf73db8d84cb3" dependencies = [ "bitflags 2.6.0", - "block2 0.5.1", - "objc2 0.5.2", + "block2", + "objc2", "objc2-core-location", "objc2-foundation", ] +[[package]] +name = "objc_exception" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" +dependencies = [ + "cc", +] + +[[package]] +name = "object" +version = "0.36.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +dependencies = [ + "memchr", +] + [[package]] name = "once_cell" version = "1.20.1" @@ -1641,7 +1787,7 @@ version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "490d3a563d3122bf7c911a59b0add9389e5ec0f5f0c3ac6b91ff235a0e6a7f90" dependencies = [ - "ttf-parser 0.24.1", + "ttf-parser", ] [[package]] @@ -1667,6 +1813,12 @@ dependencies = [ "windows-targets 0.52.6", ] +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + [[package]] name = "percent-encoding" version = "2.3.1" @@ -1699,6 +1851,20 @@ version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" +[[package]] +name = "pixels" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fe695c41cbcc552b6ad7511479226911e804e6569204ea0bafbe7c5fdddfc11" +dependencies = [ + "bytemuck", + "pollster", + "raw-window-handle 0.5.2", + "thiserror", + "ultraviolet", + "wgpu", +] + [[package]] name = "pkg-config" version = "0.3.31" @@ -1733,6 +1899,12 @@ dependencies = [ "windows-sys 0.59.0", ] +[[package]] +name = "pollster" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" + [[package]] name = "portable-atomic" version = "1.9.0" @@ -1767,13 +1939,10 @@ dependencies = [ ] [[package]] -name = "quick-xml" -version = "0.30.0" +name = "profiling" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eff6510e86862b57b210fd8cbe8ed3f0d7d600b9c2863cd4549a2e033c66e956" -dependencies = [ - "memchr", -] +checksum = "43d84d1d7a6ac92673717f9f6d1518374ef257669c24ebc5ac25d5033828be58" [[package]] name = "quick-xml" @@ -1823,6 +1992,12 @@ dependencies = [ "getrandom", ] +[[package]] +name = "range-alloc" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" + [[package]] name = "raw-window-handle" version = "0.5.2" @@ -1836,12 +2011,23 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "20675572f6f24e9e76ef639bc5552774ed45f1c30e2951e1e99c59888861c539" [[package]] -name = "redox_syscall" -version = "0.3.5" +name = "rayon" +version = "1.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" dependencies = [ - "bitflags 1.3.2", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", ] [[package]] @@ -1903,13 +2089,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] -name = "rgb" -version = "0.8.50" +name = "renderdoc-sys" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" + +[[package]] +name = "rustc-demangle" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" + +[[package]] +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57397d16646700483b67d2dd6511d79318f9d057fdbd21a4066aeac8b41d310a" -dependencies = [ - "bytemuck", -] +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" @@ -1924,28 +2119,21 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rustybuzz" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cfb9cf8877777222e4a3bc7eb247e398b56baba500c38c1c46842431adc8b55c" -dependencies = [ - "bitflags 2.6.0", - "bytemuck", - "smallvec", - "ttf-parser 0.21.1", - "unicode-bidi-mirroring", - "unicode-ccc", - "unicode-properties", - "unicode-script", -] - [[package]] name = "ryu" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +[[package]] +name = "safe_arch" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3460605018fdc9612bce72735cba0d27efbcd9904780d44c7e3a9948f96148a" +dependencies = [ + "bytemuck", +] + [[package]] name = "same-file" version = "1.0.6" @@ -1976,7 +2164,7 @@ dependencies = [ "ab_glyph", "log", "memmap2", - "smithay-client-toolkit 0.19.2", + "smithay-client-toolkit", "tiny-skia", ] @@ -2057,31 +2245,6 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" -[[package]] -name = "smithay-client-toolkit" -version = "0.18.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "922fd3eeab3bd820d76537ce8f582b1cf951eceb5475c28500c7457d9d17f53a" -dependencies = [ - "bitflags 2.6.0", - "calloop 0.12.4", - "calloop-wayland-source 0.2.0", - "cursor-icon", - "libc", - "log", - "memmap2", - "rustix", - "thiserror", - "wayland-backend", - "wayland-client", - "wayland-csd-frame", - "wayland-cursor", - "wayland-protocols 0.31.2", - "wayland-protocols-wlr 0.2.0", - "wayland-scanner", - "xkeysym", -] - [[package]] name = "smithay-client-toolkit" version = "0.19.2" @@ -2089,8 +2252,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3457dea1f0eb631b4034d61d4d8c32074caa6cd1ab2d59f2327bd8461e2c0016" dependencies = [ "bitflags 2.6.0", - "calloop 0.13.0", - "calloop-wayland-source 0.3.0", + "calloop", + "calloop-wayland-source", "cursor-icon", "libc", "log", @@ -2101,8 +2264,8 @@ dependencies = [ "wayland-client", "wayland-csd-frame", "wayland-cursor", - "wayland-protocols 0.32.4", - "wayland-protocols-wlr 0.3.4", + "wayland-protocols", + "wayland-protocols-wlr", "wayland-scanner", "xkeysym", ] @@ -2114,7 +2277,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc8216eec463674a0e90f29e0ae41a4db573ec5b56b1c6c1c71615d249b6d846" dependencies = [ "libc", - "smithay-client-toolkit 0.19.2", + "smithay-client-toolkit", "wayland-backend", ] @@ -2127,6 +2290,16 @@ dependencies = [ "serde", ] +[[package]] +name = "spirv" +version = "0.2.0+1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +dependencies = [ + "bitflags 1.3.2", + "num-traits", +] + [[package]] name = "static_assertions" version = "1.1.0" @@ -2246,7 +2419,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap", + "indexmap 2.6.0", "serde", "serde_spanned", "toml_datetime", @@ -2271,15 +2444,18 @@ checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" [[package]] name = "ttf-parser" -version = "0.21.1" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c591d83f69777866b9126b24c6dd9a18351f177e49d625920d19f989fd31cf8" +checksum = "5be21190ff5d38e8b4a2d3b6a3ae57f612cc39c96e83cedeaf7abc338a8bac4a" [[package]] -name = "ttf-parser" -version = "0.24.1" +name = "ultraviolet" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be21190ff5d38e8b4a2d3b6a3ae57f612cc39c96e83cedeaf7abc338a8bac4a" +checksum = "6a28554d13eb5daba527cc1b91b6c341372a0ae45ed277ffb2c6fbc04f319d7e" +dependencies = [ + "wide", +] [[package]] name = "unicase" @@ -2292,21 +2468,9 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08f95100a766bf4f8f28f90d77e0a5461bbdb219042e7679bebe79004fed8d75" - -[[package]] -name = "unicode-bidi-mirroring" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23cb788ffebc92c5948d0e997106233eeb1d8b9512f93f41651f52b6c5f5af86" - -[[package]] -name = "unicode-ccc" -version = "0.2.0" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1df77b101bcc4ea3d78dafc5ad7e4f58ceffe0b2b16bf446aeb50b6cb4157656" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[package]] name = "unicode-ident" @@ -2324,22 +2488,22 @@ dependencies = [ ] [[package]] -name = "unicode-properties" -version = "0.1.3" +name = "unicode-segmentation" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70f2a8b45122e719eb623c01822704c4e0907e7e426a05927e1a1cfff5b75d0" +checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" [[package]] -name = "unicode-script" -version = "0.5.7" +name = "unicode-width" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fb421b350c9aff471779e262955939f565ec18b86c15364e6bdf0d662ca7c1f" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] -name = "unicode-segmentation" -version = "1.12.0" +name = "unicode-xid" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "url" @@ -2352,6 +2516,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + [[package]] name = "version_check" version = "0.9.5" @@ -2489,18 +2659,6 @@ dependencies = [ "xcursor", ] -[[package]] -name = "wayland-protocols" -version = "0.31.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f81f365b8b4a97f422ac0e8737c438024b5951734506b0e1d775c73030561f4" -dependencies = [ - "bitflags 2.6.0", - "wayland-backend", - "wayland-client", - "wayland-scanner", -] - [[package]] name = "wayland-protocols" version = "0.32.4" @@ -2513,19 +2671,6 @@ dependencies = [ "wayland-scanner", ] -[[package]] -name = "wayland-protocols-plasma" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" -dependencies = [ - "bitflags 2.6.0", - "wayland-backend", - "wayland-client", - "wayland-protocols 0.31.2", - "wayland-scanner", -] - [[package]] name = "wayland-protocols-plasma" version = "0.3.4" @@ -2535,20 +2680,7 @@ dependencies = [ "bitflags 2.6.0", "wayland-backend", "wayland-client", - "wayland-protocols 0.32.4", - "wayland-scanner", -] - -[[package]] -name = "wayland-protocols-wlr" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" -dependencies = [ - "bitflags 2.6.0", - "wayland-backend", - "wayland-client", - "wayland-protocols 0.31.2", + "wayland-protocols", "wayland-scanner", ] @@ -2561,7 +2693,7 @@ dependencies = [ "bitflags 2.6.0", "wayland-backend", "wayland-client", - "wayland-protocols 0.32.4", + "wayland-protocols", "wayland-scanner", ] @@ -2572,7 +2704,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "597f2001b2e5fc1121e3d5b9791d3e78f05ba6bfa4641053846248e3a13661c3" dependencies = [ "proc-macro2", - "quick-xml 0.36.2", + "quick-xml", "quote", ] @@ -2598,16 +2730,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "web-time" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa30049b1c872b72c89866d458eae9f20380ab280ffd1b1e18df2d3e2d98cfe0" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - [[package]] name = "web-time" version = "1.1.0" @@ -2624,18 +2746,127 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e5f07fb9bc8de2ddfe6b24a71a75430673fd679e568c48b52716cef1cfae923" dependencies = [ - "block2 0.5.1", + "block2", "core-foundation 0.10.0", "home", "jni", "log", "ndk-context", - "objc2 0.5.2", + "objc2", "objc2-foundation", "url", "web-sys", ] +[[package]] +name = "wgpu" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "752e44d3998ef35f71830dd1ad3da513e628e2e4d4aedb0ab580f850827a0b41" +dependencies = [ + "arrayvec", + "cfg-if", + "js-sys", + "log", + "naga", + "parking_lot", + "profiling", + "raw-window-handle 0.5.2", + "smallvec", + "static_assertions", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "wgpu-core", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-core" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f8a44dd301a30ceeed3c27d8c0090433d3da04d7b2a4042738095a424d12ae7" +dependencies = [ + "arrayvec", + "bit-vec", + "bitflags 2.6.0", + "codespan-reporting", + "log", + "naga", + "parking_lot", + "profiling", + "raw-window-handle 0.5.2", + "rustc-hash", + "smallvec", + "thiserror", + "web-sys", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "0.17.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a80bf0e3c77399bb52850cb0830af9bad073d5cfcb9dd8253bef8125c42db17" +dependencies = [ + "android_system_properties", + "arrayvec", + "ash", + "bit-set", + "bitflags 2.6.0", + "block", + "core-graphics-types", + "d3d12", + "glow 0.12.3", + "gpu-alloc", + "gpu-allocator", + "gpu-descriptor", + "hassle-rs", + "js-sys", + "khronos-egl", + "libc", + "libloading 0.8.5", + "log", + "metal", + "naga", + "objc", + "parking_lot", + "profiling", + "range-alloc", + "raw-window-handle 0.5.2", + "renderdoc-sys", + "rustc-hash", + "smallvec", + "thiserror", + "wasm-bindgen", + "web-sys", + "wgpu-types", + "winapi", +] + +[[package]] +name = "wgpu-types" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee64d7398d0c2f9ca48922c902ef69c42d000c759f3db41e355f4a570b052b67" +dependencies = [ + "bitflags 2.6.0", + "js-sys", + "web-sys", +] + +[[package]] +name = "wide" +version = "0.7.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b828f995bf1e9622031f8009f8481a85406ce1f4d4588ff746d872043e855690" +dependencies = [ + "bytemuck", + "safe_arch", +] + [[package]] name = "widestring" version = "1.1.0" @@ -2675,12 +2906,11 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.56.0" +version = "0.44.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1de69df01bdf1ead2f4ac895dc77c9351aefff65b2f3db429a343f9cbf05e132" +checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" dependencies = [ - "windows-core 0.56.0", - "windows-targets 0.52.6", + "windows-targets 0.42.2", ] [[package]] @@ -2692,49 +2922,6 @@ dependencies = [ "windows-targets 0.52.6", ] -[[package]] -name = "windows-core" -version = "0.56.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4698e52ed2d08f8658ab0c39512a7c00ee5fe2688c65f8c0a4f06750d729f2a6" -dependencies = [ - "windows-implement", - "windows-interface", - "windows-result", - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-implement" -version = "0.56.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6fc35f58ecd95a9b71c4f2329b911016e6bec66b3f2e6a4aad86bd2e99e2f9b" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "windows-interface" -version = "0.56.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08990546bf4edef8f431fa6326e032865f27138718c587dc21bc0265bbcb57cc" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "windows-result" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e383302e8ec8515204254685643de10811af0ed97ea37210dc26fb0032647f8" -dependencies = [ - "windows-targets 0.52.6", -] - [[package]] name = "windows-sys" version = "0.45.0" @@ -2949,54 +3136,6 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "winit" -version = "0.29.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d59ad965a635657faf09c8f062badd885748428933dad8e8bdd64064d92e5ca" -dependencies = [ - "ahash", - "android-activity 0.5.2", - "atomic-waker", - "bitflags 2.6.0", - "bytemuck", - "calloop 0.12.4", - "cfg_aliases 0.1.1", - "core-foundation 0.9.4", - "core-graphics", - "cursor-icon", - "icrate", - "js-sys", - "libc", - "log", - "memmap2", - "ndk 0.8.0", - "ndk-sys 0.5.0+25.2.9519653", - "objc2 0.4.1", - "once_cell", - "orbclient", - "percent-encoding", - "raw-window-handle 0.5.2", - "raw-window-handle 0.6.2", - "redox_syscall 0.3.5", - "rustix", - "smithay-client-toolkit 0.18.1", - "smol_str", - "unicode-segmentation", - "wasm-bindgen", - "wasm-bindgen-futures", - "wayland-backend", - "wayland-client", - "wayland-protocols 0.31.2", - "wayland-protocols-plasma 0.2.0", - "web-sys", - "web-time 0.2.4", - "windows-sys 0.48.0", - "x11-dl", - "x11rb", - "xkbcommon-dl", -] - [[package]] name = "winit" version = "0.30.5" @@ -3004,13 +3143,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0be9e76a1f1077e04a411f0b989cbd3c93339e1771cb41e71ac4aee95bfd2c67" dependencies = [ "ahash", - "android-activity 0.6.0", + "android-activity", "atomic-waker", "bitflags 2.6.0", - "block2 0.5.1", + "block2", "bytemuck", - "calloop 0.13.0", - "cfg_aliases 0.2.1", + "calloop", + "cfg_aliases", "concurrent-queue", "core-foundation 0.9.4", "core-graphics", @@ -3019,19 +3158,20 @@ dependencies = [ "js-sys", "libc", "memmap2", - "ndk 0.9.0", - "objc2 0.5.2", + "ndk", + "objc2", "objc2-app-kit", "objc2-foundation", "objc2-ui-kit", "orbclient", "percent-encoding", "pin-project", + "raw-window-handle 0.5.2", "raw-window-handle 0.6.2", "redox_syscall 0.4.1", "rustix", "sctk-adwaita", - "smithay-client-toolkit 0.19.2", + "smithay-client-toolkit", "smol_str", "tracing", "unicode-segmentation", @@ -3039,10 +3179,10 @@ dependencies = [ "wasm-bindgen-futures", "wayland-backend", "wayland-client", - "wayland-protocols 0.32.4", - "wayland-protocols-plasma 0.3.4", + "wayland-protocols", + "wayland-protocols-plasma", "web-sys", - "web-time 1.1.0", + "web-time", "windows-sys 0.52.0", "x11-dl", "x11rb", @@ -3078,7 +3218,7 @@ dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading", + "libloading 0.8.5", "once_cell", "rustix", "x11rb-protocol", @@ -3090,17 +3230,6 @@ version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec107c4503ea0b4a98ef47356329af139c0a4f7750e621cf2973cd3385ebcb3d" -[[package]] -name = "xcb" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e75181b5a62b6eeaa72f303d3cef7dbb841e22885bf6d3e66fe23e88c55dc6" -dependencies = [ - "bitflags 1.3.2", - "libc", - "quick-xml 0.30.0", -] - [[package]] name = "xcursor" version = "0.3.8" diff --git a/Cargo.toml b/Cargo.toml index a8e8ebe..efe8edc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,8 +9,8 @@ all-features = true targets = ["x86_64-unknown-linux-gnu", "wasm32-unknown-unknown"] [dependencies] -egui = { version = "0.28", features = ["serde"] } -eframe = { version = "0.28", default-features = false, features = [ +egui = { version = "0.29", features = ["serde"] } +eframe = { version = "0.29", default-features = false, features = [ "default_fonts", # Embed the default egui fonts. "glow", # Use the glow rendering backend. Alternative: "wgpu". ] } @@ -18,20 +18,19 @@ log = "0.4" serde = { version = "1", features = ["derive"] } chrono = { version = "0.4.38", features = ["serde"] } -anyhow = "1.0.86" +anyhow = "1.0.89" toml = "0.8.19" directories = "5.0.1" -display-info = "0.5.1" rand = "0.8.5" serde_json = "1.0.128" -egui_extras = "0.28.1" -winit = "0.30.5" -glutin = "0.32.1" -femtovg = "0.9.2" +egui_extras = "0.29.1" +pixels = "0.14.0" +winit = { version = "0.30.5", features = ["rwh_05"] } +rayon = "1.10.0" # native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -env_logger = "0.10" +env_logger = "0.11" # web: [target.'cfg(target_arch = "wasm32")'.dependencies] @@ -39,7 +38,7 @@ wasm-bindgen-futures = "0.4" # to access the DOM (to hide the loading text) [target.'cfg(target_arch = "wasm32")'.dependencies.web-sys] -version = "0.3.4" +version = "0.3.70" [profile.release] opt-level = 2 # fast and small wasm diff --git a/src/dreamrunner.rs b/src/dreamrunner.rs index bf4f6b3..2a629b4 100644 --- a/src/dreamrunner.rs +++ b/src/dreamrunner.rs @@ -1,40 +1,53 @@ -use display_info::DisplayInfo; use log::info; use rand::Rng; +use std::collections::HashMap; use std::sync::{Arc, RwLock}; +use std::time::{Instant, SystemTime, UNIX_EPOCH}; use winit::application::ApplicationHandler; -use winit::dpi::{PhysicalPosition, PhysicalSize}; +use winit::dpi::{PhysicalPosition, PhysicalSize, Size}; use winit::event::WindowEvent; +use winit::event_loop::EventLoopProxy; use winit::monitor::MonitorHandle; +use winit::raw_window_handle::{HasRawWindowHandle, HasWindowHandle}; use winit::window::Window; -use winit::window::{Fullscreen, WindowAttributes}; +use winit::window::{Fullscreen, WindowAttributes, WindowId}; -use glutin::{ - config::ConfigTemplateBuilder, - context::ContextAttributesBuilder, - context::PossiblyCurrentContext, - display::GetGlDisplay, - prelude::*, - surface::{SurfaceAttributesBuilder, WindowSurface}, -}; +use rayon::prelude::*; + +use pixels::wgpu::Color; +use pixels::{Error, Pixels, SurfaceTexture}; use crate::app_settings::SETTINGS; use crate::dreams::*; use crate::fps_measure::FPSMeasureData; +use crate::user_event::UserLoopEvent; /// Creates windows using winit and displays dreams according to settings. pub struct DreamRunner { dream: Arc>, fps_measurement: FPSMeasureData, - windows: Vec, + windows: HashMap, + pixels: HashMap, + primary_window_id: Option, + pub event_loop_proxy: EventLoopProxy, + counter: usize, } impl DreamRunner { - pub fn new() -> Self { + pub fn new(event_loop_proxy: EventLoopProxy) -> Self { let dream = Self::select_active_dream(); let fps_measurement = FPSMeasureData::new(); - let windows = Vec::new(); - Self { dream, fps_measurement, windows } + let windows = HashMap::new(); + let pixels = HashMap::new(); + Self { + dream, + fps_measurement, + windows, + pixels, + primary_window_id: None, + event_loop_proxy, + counter: 100, + } } /// Return Arc with the dream that will be displayed. @@ -52,9 +65,9 @@ impl DreamRunner { } } -impl ApplicationHandler for DreamRunner { +impl ApplicationHandler for DreamRunner { fn resumed(&mut self, event_loop: &winit::event_loop::ActiveEventLoop) { - info!("Monitors information"); + info!("Winit resumed"); let primary_monitor = event_loop .primary_monitor() .expect("Could not detect primary monitor"); @@ -107,12 +120,15 @@ impl ApplicationHandler for DreamRunner { .with_title("Dream Spinner") /* .with_inner_size(display.size())*/ .with_fullscreen(Some(Fullscreen::Borderless(Some(display)))) + .with_visible(false) } // Create primary window let attr = build_window_attributes(primary_monitor.clone()); let pr_window = event_loop.create_window(attr).unwrap(); - self.windows.push(pr_window); + let pr_win_id = pr_window.id(); + self.primary_window_id = Some(pr_win_id); + self.windows.insert(pr_win_id, pr_window); // Create secondary windows if SETTINGS.read().unwrap().attempt_multiscreen { @@ -122,15 +138,35 @@ impl ApplicationHandler for DreamRunner { } let attr = build_window_attributes(display); let window = event_loop.create_window(attr).unwrap(); - self.windows.push(window); + self.windows.insert(window.id(), window); } } + + // Initialize GPU on windows + for window in self.windows.values() { + let window_size = window.inner_size(); + let surface_texture = SurfaceTexture::new( + window_size.width, + window_size.height, + &window, + ); + let pixels = Pixels::new( + window_size.width, + window_size.height, + surface_texture, + ) + .unwrap(); + let window_id = window.id(); + self.pixels.insert(window_id, pixels); + info!("Initialized GPU on window {:?}", window_id); + window.set_visible(true); + } } fn window_event( &mut self, event_loop: &winit::event_loop::ActiveEventLoop, - _window_id: winit::window::WindowId, + window_id: winit::window::WindowId, event: winit::event::WindowEvent, ) { match event { @@ -153,6 +189,51 @@ impl ApplicationHandler for DreamRunner { // applications which do not always need to. Applications that redraw continuously // can render here instead. //self.window.as_ref().unwrap().request_redraw(); + let pixels = self.pixels.get_mut(&window_id).unwrap(); + let frame = pixels.frame_mut(); + //frame.fill(255); + let now = SystemTime::now(); + let since_epoch = now + .duration_since(UNIX_EPOCH) + .expect("Time went backwards"); + let in_seconds = since_epoch.as_secs(); + let time_factor = (in_seconds % 6) as u8; + frame.par_chunks_exact_mut(4).for_each(|pixel| { + pixel[0] = 0x00; // R + pixel[1] = time_factor * 40; // G + pixel[2] = 0x00; // B + pixel[3] = 0xff; // A + }); + if let Err(err) = pixels.render() { + eprintln!("pixels.render error {}", err); + event_loop.exit(); + return; + } + + /*for (dst, &src) in pixels + .frame_mut() + .chunks_exact_mut(4) + .zip(shapes.frame().iter()) + { + dst[0] = (src >> 16) as u8; + dst[1] = (src >> 8) as u8; + dst[2] = src as u8; + dst[3] = (src >> 24) as u8; + }*/ + + //shapes.draw(now.elapsed().as_secs_f32()); + if window_id == self.primary_window_id.unwrap() { + self.fps_measurement.record_timestamp(); + if self.fps_measurement.is_changed() { + info!("FPS: {}", self.fps_measurement); + } + } + + self.event_loop_proxy + .send_event(UserLoopEvent::WindowFinishedRendering( + window_id, + )) + .unwrap(); } WindowEvent::MouseInput { device_id: _, state: _, button: _ } => { // Exit on any mouse click @@ -161,4 +242,33 @@ impl ApplicationHandler for DreamRunner { _ => (), } } + + fn user_event( + &mut self, + _event_loop: &winit::event_loop::ActiveEventLoop, + event: UserLoopEvent, + ) { + match event { + UserLoopEvent::WindowFinishedRendering(window_id) => { + if self.counter > 0 { + self.counter -= 1; + self.windows.values_mut().for_each(|window| { + window.request_redraw(); + }); + return; + } + + self.windows.get(&window_id).unwrap().request_redraw(); + } + } + } + + // fn about_to_wait( + // &mut self, + // event_loop: &winit::event_loop::ActiveEventLoop, + // ) { + // for window in self.windows.values_mut() { + // window.request_redraw(); + // } + // } } diff --git a/src/dreamspinner.rs b/src/dreamspinner.rs deleted file mode 100644 index 6ec861a..0000000 --- a/src/dreamspinner.rs +++ /dev/null @@ -1,204 +0,0 @@ -use std::sync::{Arc, RwLock}; - -use display_info::DisplayInfo; -use rand::Rng; - -use crate::app_settings::{ViewportMode, SETTINGS}; -use crate::dreams::*; -use crate::fps_measure::FPSMeasureData; - -/// The EGUI App object that provides selecting and displaying the dream -pub struct DreamSpinner { - first_frame: bool, - /// The dream chosen to be displayed. - dream: Arc>, - primary_display: DisplayInfo, - secondary_displays: Vec, - fps_measurement: FPSMeasureData, -} - -impl DreamSpinner { - /// Called once before the first frame. - pub fn new(_cc: &eframe::CreationContext<'_>) -> Self { - // This is also where you can customize the look and feel of egui using - // `cc.egui_ctx.set_visuals` and `cc.egui_ctx.set_fonts`. - - // Detect the displays. - let mut displays = DisplayInfo::all().unwrap(); - if displays.is_empty() { - panic!("Can't find any displays"); - } - // Find primary display - let primary_position = - displays.iter().position(|d| d.is_primary).unwrap(); - let primary_display = displays.swap_remove(primary_position); - displays.sort_by(|a, b| a.name.partial_cmp(&b.name).unwrap()); - // List secondary monitors for creating additional windows. - let secondary_displays = - match SETTINGS.read().unwrap().attempt_multiscreen { - true => displays, - false => Vec::new(), - }; - - let dream = Self::select_active_dream(); - - Self { - first_frame: true, - dream, - primary_display, - secondary_displays, - fps_measurement: FPSMeasureData::new(), - } - } - - /// Return Arc with the dream that will be displayed. - /// - /// Chooses randomly one of the dreams in selected list. Runs prepare on it. - fn select_active_dream() -> Arc> { - let selected_dreams = SETTINGS.read().unwrap().selected_dreams.clone(); - let mut rng = rand::thread_rng(); - let random_index = rng.gen_range(0..selected_dreams.len()); - let random_id = - selected_dreams.iter().nth(random_index).unwrap().to_string(); - let dream = build_dream_by_id(&random_id); - dream.write().unwrap().prepare_dream(); - dream - } -} - -impl eframe::App for DreamSpinner { - /// Called each time the UI needs repainting, which may be many times per second. - fn update(&mut self, ctx: &egui::Context, _frame: &mut eframe::Frame) { - // Get information on all displays - - if self.first_frame { - self.first_frame = false; - - // These viewport settings need to be set after the primary viewport - // has been created. Otherwise have DPI problems on Windows. - ctx.send_viewport_cmd(egui::ViewportCommand::OuterPosition( - [ - self.primary_display.x as f32 - / self.primary_display.scale_factor, - self.primary_display.y as f32 - / self.primary_display.scale_factor, - ] - .into(), - )); - ctx.send_viewport_cmd(egui::ViewportCommand::Fullscreen(true)); - } - egui::CentralPanel::default().show(ctx, |ui| { - // Create secondary windows - for (pos, display) in self.secondary_displays.iter().enumerate() { - let viewport_builder = egui::ViewportBuilder::default() - .with_position([ - display.x as f32 / display.scale_factor, - display.y as f32 / display.scale_factor, - ]) - .with_fullscreen(true) - .with_taskbar(false) - .with_drag_and_drop(false); - let viewport_id = egui::ViewportId::from_hash_of(display.id * pos as u32); - - let thread_dream_arc = self.dream.clone(); - - match SETTINGS.read().unwrap().viewport_mode { - ViewportMode::Immediate => { - ctx.show_viewport_immediate( - viewport_id, - viewport_builder, - move |ctx, class| { - assert!( - class == egui::ViewportClass::Immediate, - "This egui backend doesn't support multiple viewports" - ); - - egui::CentralPanel::default().show(ctx, |ui| { - let painter = thread_dream_arc.read().unwrap(); - painter.dream_egui(ui); - DreamSpinner::set_input(ui); - // No need to force updates of secondary viewports in immediate mode - }); - }, - ); - } - ViewportMode::Deferred => { - ctx.show_viewport_deferred( - viewport_id, - viewport_builder, - move |ctx, class| { - assert!( - class == egui::ViewportClass::Deferred, - "This egui backend doesn't support multiple viewports" - ); - - egui::CentralPanel::default().show(ctx, |ui| { - let painter = thread_dream_arc.read().unwrap(); - painter.dream_egui(ui); - DreamSpinner::set_input(ui); - request_updates(ui, false, thread_dream_arc.read().unwrap().preferred_update_rate()); - }); - }, - ); - } - } - } - // Paint primary window - if SETTINGS.read().unwrap().show_fps { - // Log render time - self.fps_measurement.record_timestamp(); - ui.label(self.fps_measurement.to_string()); - } - self.dream.read().unwrap().dream_egui(ui); - DreamSpinner::set_input(ui); - request_updates(ui, true, self.dream.read().unwrap().preferred_update_rate()); - }); - } -} - -impl DreamSpinner { - /// Adds input handling to dream windows. Basically, makes the window close - /// on most inputs, according to settings. - fn set_input(ui: &mut egui::Ui) { - let mut need_quit = false; - ui.input(|input| { - if input.pointer.any_released() { - need_quit = true; - } - }); - ui.output_mut(|o| o.cursor_icon = egui::CursorIcon::None); - if need_quit { - // Close the app by pressing close signal to every viewport and - // let egui handle the rest. - let mut ids: Vec = Vec::new(); - ui.ctx().input(|i| { - ids = i.raw.viewports.keys().cloned().collect(); - }); - for id in ids { - ui.ctx().send_viewport_cmd_to(id, egui::ViewportCommand::Close); - } - } - } -} - -/// Requests an update for the given viewport. Detects the appropriate time -/// to send with the update request. -fn request_updates( - ui: &mut egui::Ui, - is_primary_viewport: bool, - update_rate: DreamUpdateRate, -) { - if SETTINGS.read().unwrap().viewport_mode == ViewportMode::Immediate - && !is_primary_viewport - { - // Should not update secondary viewports in immediate mode. - return; - } - - match update_rate { - DreamUpdateRate::Smooth => ui.ctx().request_repaint(), - DreamUpdateRate::Fixed(n) => ui - .ctx() - .request_repaint_after(std::time::Duration::from_secs_f32(n)), - } -} diff --git a/src/fps_measure.rs b/src/fps_measure.rs index a7d0f3b..d96ac46 100644 --- a/src/fps_measure.rs +++ b/src/fps_measure.rs @@ -8,6 +8,7 @@ pub struct FPSMeasureData { avg: f32, worst: f32, render_timestamps: Vec, + changed: bool, } impl std::fmt::Display for FPSMeasureData { @@ -18,7 +19,12 @@ impl std::fmt::Display for FPSMeasureData { impl FPSMeasureData { pub fn new() -> Self { - Self { avg: -1.0, worst: -1.0, render_timestamps: Vec::new() } + Self { + avg: -1.0, + worst: -1.0, + render_timestamps: Vec::new(), + changed: false, + } } /// Call this once per frame pub fn record_timestamp(&mut self) { @@ -29,7 +35,9 @@ impl FPSMeasureData { .unwrap() .duration_since(self.render_timestamps.first().cloned().unwrap()) .as_secs_f32(); + self.changed = false; if sum > FPS_MEASURE_UPDATE_SECONDS { + self.changed = true; let mut durations: Vec = Vec::with_capacity(self.render_timestamps.len() - 1); for t in self.render_timestamps.windows(2) { @@ -44,4 +52,8 @@ impl FPSMeasureData { self.render_timestamps.clear(); } } + + pub fn is_changed(&self) -> bool { + self.changed + } } diff --git a/src/lib.rs b/src/lib.rs index b94af44..36e0f30 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -4,5 +4,5 @@ pub mod app_settings; pub mod dreamconfig; pub mod dreamrunner; pub mod dreams; -pub mod dreamspinner; pub mod fps_measure; +pub mod user_event; diff --git a/src/main.rs b/src/main.rs index e39eadb..8578bb0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,7 +1,10 @@ #![warn(clippy::all, rust_2018_idioms)] -#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release +//#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] // hide console window on Windows in release use anyhow::{bail, Result}; +use env_logger::Builder; +use log::LevelFilter; + use dream_spinner::app_settings::SETTINGS; use dream_spinner::dreamconfig::DreamConfigApp; use dream_spinner::dreamrunner::DreamRunner; @@ -112,9 +115,14 @@ fn parse_args(args_in: &[String]) -> Result { #[cfg(not(target_arch = "wasm32"))] fn main() -> anyhow::Result<()> { use anyhow::anyhow; + use dream_spinner::user_event::UserLoopEvent; use winit::event_loop::{ControlFlow, EventLoop}; - env_logger::init(); // Log to stderr (if you run with `RUST_LOG=debug`). + let mut builder = Builder::new(); + builder.filter_level(LevelFilter::Info); + builder.filter_module("wgpu_core", LevelFilter::Warn); + builder.filter_module("wgpu_hal", LevelFilter::Warn); + builder.init(); let args: Vec = std::env::args().collect(); let parsed = parse_args(&args).unwrap(); @@ -125,9 +133,11 @@ fn main() -> anyhow::Result<()> { // Display dreams match parsed.command { MainCommand::Show => { - let event_loop = EventLoop::new().unwrap(); + let event_loop: EventLoop = + EventLoop::with_user_event().build().unwrap(); event_loop.set_control_flow(ControlFlow::Poll); - let mut app = DreamRunner::new(); + let event_loop_proxy = event_loop.create_proxy(); + let mut app = DreamRunner::new(event_loop_proxy); //SETTINGS.write().unwrap().write_to_file_default()?; app_result = diff --git a/src/user_event.rs b/src/user_event.rs new file mode 100644 index 0000000..684d7b0 --- /dev/null +++ b/src/user_event.rs @@ -0,0 +1,6 @@ +use winit::window::WindowId; + +#[derive(Debug, Copy, Clone)] +pub enum UserLoopEvent { + WindowFinishedRendering(WindowId), +}