diff --git a/Cargo.lock b/Cargo.lock index 568fb12..d9fc838 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -28,15 +28,6 @@ dependencies = [ "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" @@ -88,7 +79,7 @@ dependencies = [ "log", "ndk", "ndk-context", - "ndk-sys", + "ndk-sys 0.6.0+11769913", "num_enum", "thiserror", ] @@ -204,11 +195,11 @@ checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" [[package]] name = "ash" -version = "0.37.3+1.3.251" +version = "0.38.0+1.3.281" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" dependencies = [ - "libloading 0.7.4", + "libloading", ] [[package]] @@ -223,35 +214,20 @@ 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" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "f0481a0e032742109b1133a095184ee93d88f3dc9e0d28a5d033dc77a073f44f" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "d2c54ff287cfc0a34f38a6b832ea1bd8e448a330b3e40a50859e6488bee07f22" [[package]] name = "bitflags" @@ -303,7 +279,7 @@ checksum = "0cc8b54b395f2fcfbb3d90c47b01c7f444d94d05bdeb775811dec868ac3bbc26" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] @@ -373,6 +349,12 @@ 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" @@ -429,10 +411,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] -name = "com-rs" -version = "0.2.1" +name = "com" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642" +checksum = "7e17887fd17353b65b1b2ef1c526c83e26cd72e74f598a8dc1bee13a48f3d9f6" +dependencies = [ + "com_macros", +] + +[[package]] +name = "com_macros" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d375883580a668c7481ea6631fc1a8863e33cc335bf56bfad8d7e6d4b04b13a5" +dependencies = [ + "com_macros_support", + "proc-macro2", + "syn 1.0.109", +] + +[[package]] +name = "com_macros_support" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad899a1087a9296d5644792d7cb72b8e34c1bec8e7d4fbc002230169a6e8710c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] name = "combine" @@ -545,12 +552,12 @@ checksum = "96a6ac251f4a2aca6b3f91340350eab87ae57c3f127ffeb585e92bd336717991" [[package]] name = "d3d12" -version = "0.7.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e16e44ab292b1dddfdaf7be62cfd8877df52f2f3fde5858d95bab606be259f20" +checksum = "bdbd1f579714e3c809ebd822c81ef148b1ceaeb3d535352afc73fd0c4c6a0017" dependencies = [ "bitflags 2.6.0", - "libloading 0.8.5", + "libloading", "winapi", ] @@ -587,7 +594,7 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.5", + "libloading", ] [[package]] @@ -623,7 +630,7 @@ dependencies = [ "egui_extras", "env_logger", "log", - "pixels", + "pollster", "rand", "rayon", "serde", @@ -631,6 +638,7 @@ dependencies = [ "toml", "wasm-bindgen-futures", "web-sys", + "wgpu", "winit", ] @@ -668,7 +676,7 @@ dependencies = [ "objc2-foundation", "parking_lot", "percent-encoding", - "raw-window-handle 0.6.2", + "raw-window-handle", "static_assertions", "wasm-bindgen", "wasm-bindgen-futures", @@ -704,7 +712,7 @@ dependencies = [ "arboard", "egui", "log", - "raw-window-handle 0.6.2", + "raw-window-handle", "smithay-clipboard", "web-time", "webbrowser", @@ -774,7 +782,7 @@ checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] @@ -785,7 +793,7 @@ checksum = "2f9ed6b3789237c8a0c1c505af1c7eb2c560df6186f01b098c3a1064ea532f38" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] @@ -894,7 +902,7 @@ checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] @@ -933,12 +941,6 @@ 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" @@ -952,9 +954,9 @@ dependencies = [ [[package]] name = "glow" -version = "0.12.3" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" +checksum = "bd348e04c43b32574f2de31c8bb397d96c9fcfa1371bd4ca6d8bdc464ab121b1" dependencies = [ "js-sys", "slotmap", @@ -981,19 +983,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec69412a0bf07ea7607e638b415447857a808846c2b685a43c8aa18bc6d5e499" dependencies = [ "bitflags 2.6.0", - "cfg_aliases", + "cfg_aliases 0.2.1", "cgl", "core-foundation 0.9.4", "dispatch", "glutin_egl_sys", "glutin_glx_sys", "glutin_wgl_sys", - "libloading 0.8.5", + "libloading", "objc2", "objc2-app-kit", "objc2-foundation", "once_cell", - "raw-window-handle 0.6.2", + "raw-window-handle", "wayland-sys", "windows-sys 0.52.0", "x11-dl", @@ -1005,9 +1007,9 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "85edca7075f8fc728f28cb8fbb111a96c3b89e930574369e3e9c27eb75d3788f" dependencies = [ - "cfg_aliases", + "cfg_aliases 0.2.1", "glutin", - "raw-window-handle 0.6.2", + "raw-window-handle", "winit", ] @@ -1061,12 +1063,12 @@ dependencies = [ [[package]] name = "gpu-allocator" -version = "0.22.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" +checksum = "fdd4240fc91d3433d5e5b0fc5b67672d771850dc19bbee03c1381e19322803d7" dependencies = [ - "backtrace", "log", + "presser", "thiserror", "winapi", "windows", @@ -1074,9 +1076,9 @@ dependencies = [ [[package]] name = "gpu-descriptor" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc11df1ace8e7e564511f53af41f3e42ddc95b56fd07b3f4445d2a6048bc682c" +checksum = "9c08c1f623a8d0b722b8b99f821eb0ba672a1618f0d3b16ddbee1cedd2dd8557" dependencies = [ "bitflags 2.6.0", "gpu-descriptor-types", @@ -1085,19 +1087,13 @@ dependencies = [ [[package]] name = "gpu-descriptor-types" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bf0b36e6f090b7e1d8a4b49c0cb81c1f8376f72198c65dd3ad9ff3556b8b78c" +checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" 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" @@ -1116,14 +1112,14 @@ checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "hassle-rs" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1397650ee315e8891a0df210707f0fc61771b0cc518c3023896064c5407cb3b0" +checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 1.3.2", - "com-rs", + "bitflags 2.6.0", + "com", "libc", - "libloading 0.7.4", + "libloading", "thiserror", "widestring", "winapi", @@ -1201,16 +1197,6 @@ dependencies = [ "png", ] -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - [[package]] name = "indexmap" version = "2.6.0" @@ -1275,12 +1261,12 @@ dependencies = [ [[package]] name = "khronos-egl" -version = "4.1.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.7.4", + "libloading", "pkg-config", ] @@ -1296,16 +1282,6 @@ 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" @@ -1400,9 +1376,9 @@ dependencies = [ [[package]] name = "metal" -version = "0.26.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "623b5e6cefd76e58f774bd3cc0c6f5c7615c58c03a97815245a25c3c9bdee318" +checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" dependencies = [ "bitflags 2.6.0", "block", @@ -1441,17 +1417,18 @@ dependencies = [ [[package]] name = "naga" -version = "0.13.0" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e" +checksum = "8bd5a652b6faf21496f2cfd88fc49989c8db0825d1f6746b1a71a6ede24a63ad" dependencies = [ + "arrayvec", "bit-set", "bitflags 2.6.0", + "cfg_aliases 0.1.1", "codespan-reporting", "hexf-parse", - "indexmap 1.9.3", + "indexmap", "log", - "num-traits", "rustc-hash", "spirv", "termcolor", @@ -1468,10 +1445,9 @@ dependencies = [ "bitflags 2.6.0", "jni-sys", "log", - "ndk-sys", + "ndk-sys 0.6.0+11769913", "num_enum", - "raw-window-handle 0.5.2", - "raw-window-handle 0.6.2", + "raw-window-handle", "thiserror", ] @@ -1481,6 +1457,15 @@ 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" @@ -1523,7 +1508,7 @@ dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] @@ -1533,7 +1518,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" dependencies = [ "malloc_buf", - "objc_exception", ] [[package]] @@ -1739,24 +1723,6 @@ dependencies = [ "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" @@ -1842,7 +1808,7 @@ checksum = "2f38a4412a78282e09a2cf38d195ea5420d15ba0602cb375210efbc877243965" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] @@ -1851,20 +1817,6 @@ 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" @@ -1920,6 +1872,12 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + [[package]] name = "proc-macro-crate" version = "3.2.0" @@ -1998,12 +1956,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8a99fddc9f0ba0a85884b8d14e3592853e787d581ca1816c91349b10e4eeab" -[[package]] -name = "raw-window-handle" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2ff9a1f06a88b01621b7ae906ef0211290d1c8a168a15542486a8f61c0833b9" - [[package]] name = "raw-window-handle" version = "0.6.2" @@ -2094,12 +2046,6 @@ 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" @@ -2125,15 +2071,6 @@ 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" @@ -2185,7 +2122,7 @@ checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] @@ -2292,12 +2229,11 @@ dependencies = [ [[package]] name = "spirv" -version = "0.2.0+1.5.4" +version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 1.3.2", - "num-traits", + "bitflags 2.6.0", ] [[package]] @@ -2312,6 +2248,17 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6637bab7722d379c8b41ba849228d680cc12d0a45ba1fa2b48f2a30577a06731" +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + [[package]] name = "syn" version = "2.0.79" @@ -2349,7 +2296,7 @@ checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] [[package]] @@ -2419,7 +2366,7 @@ version = "0.22.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ - "indexmap 2.6.0", + "indexmap", "serde", "serde_spanned", "toml_datetime", @@ -2448,15 +2395,6 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5be21190ff5d38e8b4a2d3b6a3ae57f612cc39c96e83cedeaf7abc338a8bac4a" -[[package]] -name = "ultraviolet" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a28554d13eb5daba527cc1b91b6c341372a0ae45ed277ffb2c6fbc04f319d7e" -dependencies = [ - "wide", -] - [[package]] name = "unicase" version = "2.7.0" @@ -2566,7 +2504,7 @@ dependencies = [ "once_cell", "proc-macro2", "quote", - "syn", + "syn 2.0.79", "wasm-bindgen-shared", ] @@ -2600,7 +2538,7 @@ checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -2760,18 +2698,19 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.17.2" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "752e44d3998ef35f71830dd1ad3da513e628e2e4d4aedb0ab580f850827a0b41" +checksum = "e1d1c4ba43f80542cf63a0a6ed3134629ae73e8ab51e4b765a67f3aa062eb433" dependencies = [ "arrayvec", - "cfg-if", + "cfg_aliases 0.1.1", + "document-features", "js-sys", "log", "naga", "parking_lot", "profiling", - "raw-window-handle 0.5.2", + "raw-window-handle", "smallvec", "static_assertions", "wasm-bindgen", @@ -2784,32 +2723,34 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.17.1" +version = "22.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f8a44dd301a30ceeed3c27d8c0090433d3da04d7b2a4042738095a424d12ae7" +checksum = "0348c840d1051b8e86c3bcd31206080c5e71e5933dabd79be1ce732b0b2f089a" dependencies = [ "arrayvec", "bit-vec", "bitflags 2.6.0", - "codespan-reporting", + "cfg_aliases 0.1.1", + "document-features", + "indexmap", "log", "naga", + "once_cell", "parking_lot", "profiling", - "raw-window-handle 0.5.2", + "raw-window-handle", "rustc-hash", "smallvec", "thiserror", - "web-sys", "wgpu-hal", "wgpu-types", ] [[package]] name = "wgpu-hal" -version = "0.17.2" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a80bf0e3c77399bb52850cb0830af9bad073d5cfcb9dd8253bef8125c42db17" +checksum = "f6bbf4b4de8b2a83c0401d9e5ae0080a2792055f25859a02bf9be97952bbed4f" dependencies = [ "android_system_properties", "arrayvec", @@ -2817,9 +2758,11 @@ dependencies = [ "bit-set", "bitflags 2.6.0", "block", + "cfg_aliases 0.1.1", "core-graphics-types", "d3d12", - "glow 0.12.3", + "glow 0.13.1", + "glutin_wgl_sys", "gpu-alloc", "gpu-allocator", "gpu-descriptor", @@ -2827,15 +2770,17 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.8.5", + "libloading", "log", "metal", "naga", + "ndk-sys 0.5.0+25.2.9519653", "objc", + "once_cell", "parking_lot", "profiling", "range-alloc", - "raw-window-handle 0.5.2", + "raw-window-handle", "renderdoc-sys", "rustc-hash", "smallvec", @@ -2848,25 +2793,15 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.17.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee64d7398d0c2f9ca48922c902ef69c42d000c759f3db41e355f4a570b052b67" +checksum = "bc9d91f0e2c4b51434dfa6db77846f2793149d8e73f800fa2e41f52b8eac3c5d" 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" @@ -2906,11 +2841,12 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.44.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be" dependencies = [ - "windows-targets 0.42.2", + "windows-core", + "windows-targets 0.52.6", ] [[package]] @@ -3149,7 +3085,7 @@ dependencies = [ "block2", "bytemuck", "calloop", - "cfg_aliases", + "cfg_aliases 0.2.1", "concurrent-queue", "core-foundation 0.9.4", "core-graphics", @@ -3166,8 +3102,7 @@ dependencies = [ "orbclient", "percent-encoding", "pin-project", - "raw-window-handle 0.5.2", - "raw-window-handle 0.6.2", + "raw-window-handle", "redox_syscall 0.4.1", "rustix", "sctk-adwaita", @@ -3218,7 +3153,7 @@ dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.8.5", + "libloading", "once_cell", "rustix", "x11rb-protocol", @@ -3279,5 +3214,5 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.79", ] diff --git a/Cargo.toml b/Cargo.toml index efe8edc..de8284e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,9 +24,10 @@ directories = "5.0.1" rand = "0.8.5" serde_json = "1.0.128" egui_extras = "0.29.1" -pixels = "0.14.0" -winit = { version = "0.30.5", features = ["rwh_05"] } +winit = { version = "0.30.5", features = ["rwh_06"] } rayon = "1.10.0" +wgpu = "22.1.0" +pollster = "0.3.0" # native: [target.'cfg(not(target_arch = "wasm32"))'.dependencies] diff --git a/src/dreamrunner.rs b/src/dreamrunner.rs index 2a629b4..66c65f8 100644 --- a/src/dreamrunner.rs +++ b/src/dreamrunner.rs @@ -1,52 +1,47 @@ +use chrono::Local; use log::info; use rand::Rng; -use std::collections::HashMap; -use std::sync::{Arc, RwLock}; -use std::time::{Instant, SystemTime, UNIX_EPOCH}; +use std::collections::{HashMap, HashSet}; +use std::sync::{Arc, Mutex, RwLock}; +use std::thread; +use std::time::SystemTime; use winit::application::ApplicationHandler; -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, WindowId}; -use rayon::prelude::*; - -use pixels::wgpu::Color; -use pixels::{Error, Pixels, SurfaceTexture}; +use wgpu; 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 { +pub struct DreamRunner<'dr> { dream: Arc>, - fps_measurement: FPSMeasureData, - windows: HashMap, - pixels: HashMap, + wgpu_data: HashMap>>>, primary_window_id: Option, pub event_loop_proxy: EventLoopProxy, - counter: usize, + window_finished_rendering: HashSet, + redraw_thread: Option>, } -impl DreamRunner { +impl<'dr> DreamRunner<'dr> { pub fn new(event_loop_proxy: EventLoopProxy) -> Self { let dream = Self::select_active_dream(); - let fps_measurement = FPSMeasureData::new(); - let windows = HashMap::new(); - let pixels = HashMap::new(); + //let fps_measurement = HashMap::new(); + let wgpu_data = HashMap::new(); + let window_finished_rendering = HashSet::new(); Self { dream, - fps_measurement, - windows, - pixels, + //fps_measurement, + wgpu_data, primary_window_id: None, event_loop_proxy, - counter: 100, + window_finished_rendering, + redraw_thread: None, } } @@ -63,9 +58,33 @@ impl DreamRunner { dream.write().unwrap().prepare_dream(); dream } + + fn redraw(&mut self, window_id: WindowId) { + let wgpu_data = self.wgpu_data.get(&window_id); + if wgpu_data.is_none() { + return; + } + + let mut wgpu_data = wgpu_data.unwrap().lock().unwrap(); + wgpu_data.update(); + match wgpu_data.render() { + Ok(_) => {} + // Reconfigure the surface if lost + Err(wgpu::SurfaceError::Lost) => { + let new_size = wgpu_data.size.clone(); + wgpu_data.resize(new_size); + } + // The system is out of memory, we should probably quit + Err(wgpu::SurfaceError::OutOfMemory) => { + // event_loop.exit(); + } + // All other errors (Outdated, Timeout) should be resolved by the next frame + Err(e) => eprintln!("{:?}", e), + } + } } -impl ApplicationHandler for DreamRunner { +impl<'dr> ApplicationHandler for DreamRunner<'dr> { fn resumed(&mut self, event_loop: &winit::event_loop::ActiveEventLoop) { info!("Winit resumed"); let primary_monitor = event_loop @@ -118,9 +137,8 @@ impl ApplicationHandler for DreamRunner { fn build_window_attributes(display: MonitorHandle) -> WindowAttributes { Window::default_attributes() .with_title("Dream Spinner") - /* .with_inner_size(display.size())*/ .with_fullscreen(Some(Fullscreen::Borderless(Some(display)))) - .with_visible(false) + .with_visible(true) } // Create primary window @@ -128,9 +146,13 @@ impl ApplicationHandler for DreamRunner { let pr_window = event_loop.create_window(attr).unwrap(); 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 + //self.windows.insert(pr_win_id, aw); + let mut created_windows = Vec::new(); + created_windows.push(pr_window); + + //Create secondary windows + if SETTINGS.read().unwrap().attempt_multiscreen { for display in event_loop.available_monitors() { if display == primary_monitor { @@ -138,29 +160,31 @@ impl ApplicationHandler for DreamRunner { } let attr = build_window_attributes(display); let window = event_loop.create_window(attr).unwrap(); - self.windows.insert(window.id(), window); + created_windows.push(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); + for window in created_windows.into_iter() { + let window_id = &window.id(); + window.request_redraw(); + let wgpu_data = pollster::block_on(WgpuData::<'dr>::new(window)); + let agpu = Arc::new(Mutex::new(wgpu_data)); + + info!("Initialized GPU on window {:?}", &window_id); + self.wgpu_data.insert(window_id.clone(), agpu); } + self.event_loop_proxy + .send_event(UserLoopEvent::WindowFinishedRendering(pr_win_id)) + .unwrap(); + + // self.redraw_thread = Some(thread::spawn(move || { + // for wgpu_rr in arcs { + // let mut wgpu = wgpu_rr.lock().unwrap(); + // wgpu.update(); + // wgpu.render(); + // } + // })); } fn window_event( @@ -189,45 +213,16 @@ 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();*/ + + //self.window_finished_rendering.insert(window_id); + + //self.event_loop_proxy.send_event(UserLoopEvent::WindowFinishedRendering(window_id)).unwrap(); self.event_loop_proxy .send_event(UserLoopEvent::WindowFinishedRendering( @@ -239,6 +234,7 @@ impl ApplicationHandler for DreamRunner { // Exit on any mouse click event_loop.exit(); } + _ => (), } } @@ -250,25 +246,176 @@ impl ApplicationHandler for DreamRunner { ) { 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.wgpu_data.get(&window_id).unwrap().lock().unwrap().window().request_redraw(); + // for wgpu_data in self.wgpu_data.values() { + // wgpu_data.lock().unwrap().window().request_redraw(); + // } + let ids: Vec = + self.wgpu_data.keys().cloned().collect(); + for id in ids { + self.redraw(id); } - - 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(); - // } - // } + fn about_to_wait( + &mut self, + event_loop: &winit::event_loop::ActiveEventLoop, + ) { + // for wgpu_data in self.wgpu_data.values() { + // let mut window = wgpu_data.lock().unwrap(); + // window.window().request_redraw(); + // } + self.event_loop_proxy + .send_event(UserLoopEvent::WindowFinishedRendering( + WindowId::dummy(), + )) + .unwrap(); + } +} + +struct WgpuData<'window> { + surface: wgpu::Surface<'window>, + device: wgpu::Device, + queue: wgpu::Queue, + config: wgpu::SurfaceConfiguration, + size: winit::dpi::PhysicalSize, + // The window must be declared after the surface so + // it gets dropped after it as the surface contains + // unsafe references to the window's resources. + window: Arc, +} + +impl<'window> WgpuData<'window> { + // Creating some of the wgpu types requires async code + async fn new(window: Window) -> WgpuData<'window> { + let window_size = window.inner_size(); + let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { + backends: wgpu::Backends::DX12, + ..Default::default() + }); + + let win = Arc::new(window); + + let surface = instance.create_surface(win.clone()).unwrap(); + + let adapter = instance + .request_adapter(&wgpu::RequestAdapterOptions { + power_preference: wgpu::PowerPreference::default(), + compatible_surface: Some(&surface), + force_fallback_adapter: false, + }) + .await + .unwrap(); + + let (device, queue) = adapter + .request_device( + &wgpu::DeviceDescriptor { + required_features: wgpu::Features::empty(), + required_limits: wgpu::Limits::default(), + label: None, + memory_hints: Default::default(), + }, + None, // Trace path + ) + .await + .unwrap(); + + let surface_caps = surface.get_capabilities(&adapter); + let surface_format = surface_caps + .formats + .iter() + .find(|f| f.is_srgb()) + .copied() + .unwrap_or(surface_caps.formats[0]); + let config = wgpu::SurfaceConfiguration { + usage: wgpu::TextureUsages::RENDER_ATTACHMENT, + format: surface_format, + width: window_size.width, + height: window_size.height, + present_mode: wgpu::PresentMode::AutoVsync, + alpha_mode: wgpu::CompositeAlphaMode::Opaque, + view_formats: vec![], + desired_maximum_frame_latency: 2, + }; + surface.configure(&device, &config); + let mut r = WgpuData { + surface, + device, + queue, + config, + size: window_size, + window: win, + }; + //r.resize(r.window.inner_size()); + r + } + + pub fn window(&self) -> &Window { + &self.window + } + + pub fn window_id(&self) -> WindowId { + self.window.id() + } + + pub fn resize(&mut self, new_size: winit::dpi::PhysicalSize) { + if new_size.width > 0 && new_size.height > 0 { + self.size = new_size; + self.config.width = new_size.width; + self.config.height = new_size.height; + self.surface.configure(&self.device, &self.config); + } + } + + fn input(&mut self, event: &WindowEvent) -> bool { + false + } + + fn update(&mut self) {} + + fn render(&mut self) -> Result<(), wgpu::SurfaceError> { + let output = self.surface.get_current_texture()?; + let view = + output.texture.create_view(&wgpu::TextureViewDescriptor::default()); + let mut encoder = self.device.create_command_encoder( + &wgpu::CommandEncoderDescriptor { label: Some("Render Encoder") }, + ); + { + let _render_pass = + encoder.begin_render_pass(&wgpu::RenderPassDescriptor { + label: Some("Render Pass"), + color_attachments: &[Some( + wgpu::RenderPassColorAttachment { + view: &view, + resolve_target: None, + ops: wgpu::Operations { + load: wgpu::LoadOp::Clear(wgpu::Color { + r: 0.1, + g: get_milliseconds_since_midnight(), + b: 0.3, + a: 1.0, + }), + store: wgpu::StoreOp::Store, + }, + }, + )], + depth_stencil_attachment: None, + occlusion_query_set: None, + timestamp_writes: None, + }); + } + + // submit will accept anything that implements IntoIter + self.queue.submit(std::iter::once(encoder.finish())); + output.present(); + + Ok(()) + } +} + +fn get_milliseconds_since_midnight() -> f64 { + let now = SystemTime::now().duration_since(SystemTime::UNIX_EPOCH).unwrap(); + (now.as_millis() % 3000) as f64 / 3000.0 } diff --git a/src/fps_measure.rs b/src/fps_measure.rs index d96ac46..56bbb7c 100644 --- a/src/fps_measure.rs +++ b/src/fps_measure.rs @@ -22,7 +22,9 @@ impl FPSMeasureData { Self { avg: -1.0, worst: -1.0, - render_timestamps: Vec::new(), + render_timestamps: Vec::with_capacity( + (FPS_MEASURE_UPDATE_SECONDS * 121.0) as usize, + ), changed: false, } }