diff --git a/Cargo.lock b/Cargo.lock index c4be851..cfcbb22 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -9,7 +9,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24606928a235e73cdef55a0c909719cadd72fce573e5713d58cb2952d8f5794c" dependencies = [ "ab_glyph_rasterizer", - "owned_ttf_parser 0.15.0", + "owned_ttf_parser", ] [[package]] @@ -33,6 +33,12 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" + [[package]] name = "ahash" version = "0.7.6" @@ -41,7 +47,6 @@ checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ "getrandom", "once_cell", - "serde", "version_check", ] @@ -93,7 +98,7 @@ version = "1.0.11" dependencies = [ "gumdrop", "log", - "nix 0.24.1", + "nix 0.24.2", "pidlock", "pretty_env_logger", "ron 0.7.1", @@ -141,20 +146,22 @@ dependencies = [ "amdgpu", "amdgpu-config", "amdmond-lib", - "egui", + "bytemuck", + "egui 0.18.1", "egui-winit", "egui_glium", "egui_glow", "egui_vulkano", - "epaint", + "epaint 0.18.1", "epi", - "glium", + "glium 0.32.1", "glow", - "glutin", + "glutin 0.29.1", "gumdrop", + "image", "log", - "nix 0.24.1", - "parking_lot 0.11.2", + "nix 0.25.0", + "parking_lot 0.12.1", "pretty_env_logger", "serde", "thiserror", @@ -163,7 +170,7 @@ dependencies = [ "vulkano", "vulkano-shaders", "vulkano-win", - "winit", + "winit 0.26.1", ] [[package]] @@ -226,19 +233,6 @@ dependencies = [ "toml", ] -[[package]] -name = "andrew" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" -dependencies = [ - "bitflags", - "rusttype", - "walkdir", - "xdg", - "xml-rs", -] - [[package]] name = "android_glue" version = "0.2.3" @@ -246,12 +240,50 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "000444226fcff248f2bc4c7625be32c63caccfecc2723a2b9f78a7487a49c407" [[package]] -name = "ash" -version = "0.33.3+1.2.191" +name = "android_system_properties" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc4f1d82f164f838ae413296d1131aa6fa79b917d25bebaa7033d25620c09219" +checksum = "d7ed72e1635e121ca3e79420540282af22da58be50de153d36f81ddc6b83aa9e" dependencies = [ - "libloading 0.7.3", + "libc", +] + +[[package]] +name = "arboard" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc120354d1b5ec6d7aaf4876b602def75595937b5e15d356eb554ab5177e08bb" +dependencies = [ + "clipboard-win", + "log", + "objc", + "objc-foundation", + "objc_id", + "parking_lot 0.12.1", + "thiserror", + "winapi", + "x11rb", +] + +[[package]] +name = "arrayref" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4c527152e37cf757a3f78aae5a06fbeefdb07ccc535c980a3208ee3060dd544" + +[[package]] +name = "arrayvec" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" + +[[package]] +name = "ash" +version = "0.36.0+1.3.206" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceea9c64653169f33f946debf0a41568afc4e23a4c37d29004a23b2ffbfb4034" +dependencies = [ + "libloading", ] [[package]] @@ -279,9 +311,9 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "backtrace" -version = "0.3.65" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11a17d453482a265fd5f8479f2a3f405566e6ca627837aaddb85af8b1ab8ef61" +checksum = "cab84319d616cfb654d03394f38ab7e6f0919e181b1b57e1fd15e7fb4077d9a7" dependencies = [ "addr2line", "cc", @@ -298,6 +330,12 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "bit_field" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcb6dd1c2376d2e096796e234a70e17e94cc2d5d54ff8ce42b28cef1d0d359a4" + [[package]] name = "bitflags" version = "1.3.2" @@ -329,19 +367,58 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "37ccbd214614c6783386c1af30caf03192f17891059cecc394b4fb119e363de3" [[package]] -name = "bytes" -version = "1.1.0" +name = "bytemuck" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" +checksum = "2f5715e491b5a1598fc2bef5a606847b5dc1d48ea625bd3c02c00de8285591da" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b9e1f5fa78f69496407a27ae9ed989e3c3b072310286f5ef385525e4cbc24a9" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec8a7b6a70fde80372154c65702f00a0f56f3e1c36abbc6c440484be248856db" [[package]] name = "calloop" -version = "0.6.5" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" +checksum = "bf2eec61efe56aa1e813f5126959296933cf0700030e4314786c48779a66ab82" dependencies = [ "log", - "nix 0.18.0", + "nix 0.22.3", +] + +[[package]] +name = "calloop" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22a6a8f622f797120d452c630b0ab12e1331a1a753e2039ce7868d4ac77b4ee" +dependencies = [ + "log", + "nix 0.24.2", + "slotmap", + "thiserror", + "vec_map", ] [[package]] @@ -356,6 +433,12 @@ version = "1.0.73" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" +[[package]] +name = "cesu8" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + [[package]] name = "cfg-if" version = "0.1.10" @@ -379,25 +462,28 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" dependencies = [ - "libc", + "iana-time-zone", + "js-sys", "num-integer", "num-traits", "serde", "time", + "wasm-bindgen", "winapi", ] [[package]] name = "clipboard-win" -version = "3.1.1" +version = "4.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9fdf5e01086b6be750428ba4a40619f847eb2e95756eee84b18e06e5f0b50342" +checksum = "c4ab1b92798304eedc095b53942963240037c0516452cb11aeba709d420b2219" dependencies = [ - "lazy-bytes-cast", + "error-code", + "str-buf", "winapi", ] @@ -420,7 +506,7 @@ dependencies = [ "block", "core-foundation 0.7.0", "core-graphics 0.19.2", - "foreign-types", + "foreign-types 0.3.2", "libc", "objc", ] @@ -436,7 +522,7 @@ dependencies = [ "cocoa-foundation", "core-foundation 0.9.3", "core-graphics 0.22.3", - "foreign-types", + "foreign-types 0.3.2", "libc", "objc", ] @@ -451,23 +537,25 @@ dependencies = [ "block", "core-foundation 0.9.3", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "libc", "objc", ] [[package]] -name = "copypasta" -version = "0.7.1" +name = "color_quant" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4423d79fed83ebd9ab81ec21fa97144300a961782158287dc9bf7eddac37ff0b" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + +[[package]] +name = "combine" +version = "4.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35ed6e9d84f0b51a7f52daf1c7d71dd136fd7a3f41a8462b8cdb8c78d920fad4" dependencies = [ - "clipboard-win", - "objc", - "objc-foundation", - "objc_id", - "smithay-clipboard", - "x11-clipboard", + "bytes", + "memchr", ] [[package]] @@ -510,7 +598,7 @@ checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" dependencies = [ "bitflags", "core-foundation 0.7.0", - "foreign-types", + "foreign-types 0.3.2", "libc", ] @@ -523,7 +611,7 @@ dependencies = [ "bitflags", "core-foundation 0.9.3", "core-graphics-types", - "foreign-types", + "foreign-types 0.3.2", "libc", ] @@ -535,7 +623,19 @@ checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" dependencies = [ "bitflags", "core-foundation 0.9.3", - "foreign-types", + "foreign-types 0.3.2", + "libc", +] + +[[package]] +name = "core-text" +version = "19.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d74ada66e07c1cefa18f8abfba765b486f250de2e4a999e5727fc0dd4b4a25" +dependencies = [ + "core-foundation 0.9.3", + "core-graphics 0.22.3", + "foreign-types 0.3.2", "libc", ] @@ -553,10 +653,19 @@ dependencies = [ ] [[package]] -name = "crossbeam" -version = "0.8.1" +name = "crc32fast" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae5588f6b3c3cb05239e90bd110f257254aecd01e4635400391aeae07497845" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if 1.0.0", +] + +[[package]] +name = "crossbeam" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2801af0d36612ae591caa9568261fddce32ce6e08a7275ea334a06a4ad021a2c" dependencies = [ "cfg-if 1.0.0", "crossbeam-channel", @@ -568,9 +677,9 @@ dependencies = [ [[package]] name = "crossbeam-channel" -version = "0.5.4" +version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaa7bd5fb665c6864b5f963dd9097905c54125909c7aa94c9e18507cdbe6c53" +checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -578,9 +687,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" +checksum = "715e8152b692bba2d374b53d4875445368fdf21a94751410af607a5ac677d1fc" dependencies = [ "cfg-if 1.0.0", "crossbeam-epoch", @@ -589,23 +698,23 @@ dependencies = [ [[package]] name = "crossbeam-epoch" -version = "0.9.8" +version = "0.9.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1145cf131a2c6ba0615079ab6a638f7e1973ac9c2634fcbeaaad6114246efe8c" +checksum = "045ebe27666471bb549370b4b0b3e51b07f56325befa4284db65fc89c02511b1" dependencies = [ "autocfg", "cfg-if 1.0.0", "crossbeam-utils", - "lazy_static", "memoffset", + "once_cell", "scopeguard", ] [[package]] name = "crossbeam-queue" -version = "0.3.5" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f25d8400f4a7a5778f0e4e52384a48cbd9b5c495d110786187fc750075277a2" +checksum = "1cd42583b04998a5363558e5f9291ee5a5ff6b49944332103f251e7479a82aa7" dependencies = [ "cfg-if 1.0.0", "crossbeam-utils", @@ -613,12 +722,35 @@ dependencies = [ [[package]] name = "crossbeam-utils" -version = "0.8.8" +version = "0.8.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bf124c720b7686e3c2663cf54062ab0f68a88af2fb6a030e87e30bf721fcb38" +checksum = "51887d4adc7b564537b15adcfb307936f8075dfcd5f00dde9a9f1d29383682bc" dependencies = [ "cfg-if 1.0.0", - "lazy_static", + "once_cell", +] + +[[package]] +name = "crossfont" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f66b1c1979c4362323f03ab6bf7fb522902bfc418e0c37319ab347f9561d980f" +dependencies = [ + "cocoa 0.24.0", + "core-foundation 0.9.3", + "core-foundation-sys 0.8.3", + "core-graphics 0.22.3", + "core-text", + "dwrote", + "foreign-types 0.5.0", + "freetype-rs", + "libc", + "log", + "objc", + "once_cell", + "pkg-config", + "servo-fontconfig", + "winapi", ] [[package]] @@ -630,7 +762,7 @@ dependencies = [ "bitflags", "crossterm_winapi", "libc", - "mio 0.8.3", + "mio", "parking_lot 0.12.1", "signal-hook", "signal-hook-mio", @@ -654,7 +786,7 @@ checksum = "22813a6dc45b335f9bade10bf7271dc477e81113e89eb251a0bc2a8a81c536e1" dependencies = [ "bstr", "csv-core", - "itoa", + "itoa 0.4.8", "ryu", "serde", ] @@ -676,9 +808,9 @@ checksum = "b365fabc795046672053e29c954733ec3b05e4be654ab130fe8f1f94d7051f35" [[package]] name = "darling" -version = "0.10.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" dependencies = [ "darling_core", "darling_macro", @@ -686,9 +818,9 @@ dependencies = [ [[package]] name = "darling_core" -version = "0.10.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" dependencies = [ "fnv", "ident_case", @@ -700,9 +832,9 @@ dependencies = [ [[package]] name = "darling_macro" -version = "0.10.2" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" dependencies = [ "darling_core", "quote", @@ -710,44 +842,12 @@ dependencies = [ ] [[package]] -name = "directories-next" -version = "2.0.0" +name = "deflate" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +checksum = "c86f7e25f518f4b81808a2cf1c50996a61f5c2eb394b2393bd87f2a4780a432f" dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] - -[[package]] -name = "dirs" -version = "4.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3aa72a6f96ea37bbc5aa912f6788242832f75369bdfdadcb0e38423f100059" -dependencies = [ - "dirs-sys", -] - -[[package]] -name = "dirs-sys" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b1d1d91c932ef41c0f2663aa8b0ca0342d444d842c06914aa0a7e352d0bada6" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", + "adler32", ] [[package]] @@ -756,22 +856,13 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd0c93bb4b0c6d9b77f4435b0ae98c24d17f1c45b2ff844c6151a07256ca923b" -[[package]] -name = "dlib" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" -dependencies = [ - "libloading 0.6.7", -] - [[package]] name = "dlib" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" dependencies = [ - "libloading 0.7.3", + "libloading", ] [[package]] @@ -781,78 +872,116 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] -name = "egui" -version = "0.15.0" +name = "dwrote" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c8d416a3343cbfc6f4d17bb1cba46b4d7efecb9ee541967763e0b5e04e5fae7" +checksum = "439a1c2ba5611ad3ed731280541d36d2e9c4ac5e7fb818a27b604bdc5a6aa65b" +dependencies = [ + "lazy_static", + "libc", + "serde", + "serde_derive", + "winapi", + "wio", +] + +[[package]] +name = "egui" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a3cd1d47e12f7a17912595241622e373aa652a4e0fa90b3f9278f90a64aedf7" dependencies = [ "ahash", - "epaint", + "epaint 0.17.0", "nohash-hasher", - "ron 0.7.1", - "serde", +] + +[[package]] +name = "egui" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb095a8b9feb9b7ff8f00b6776dffcef059538a3f4a91238e03c900e9c9ad9a2" +dependencies = [ + "ahash", + "epaint 0.18.1", + "nohash-hasher", + "tracing", ] [[package]] name = "egui-winit" -version = "0.15.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc403e91d1bd693239f1c734193cdf0eb38c8682bbfb9990c4b6cd2db5ee368e" +checksum = "b040afd583fd95a9b9578d4399214a13d948ed26bc0ff7cc0104502501f34e68" dependencies = [ - "copypasta", - "egui", - "epi", - "serde", + "arboard", + "egui 0.18.1", + "instant", + "tracing", "webbrowser", - "winit", + "winit 0.26.1", ] [[package]] name = "egui_glium" -version = "0.15.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26478ec89b8c9c41a45687a90f9c8fc18106e3ffd8a08559285d625185a2ac92" +checksum = "38243eb1ae916be2861d4aeba8cf564492a65d7729a0713e5c4b4cd5603ac082" dependencies = [ - "egui", + "ahash", + "bytemuck", + "egui 0.18.1", "egui-winit", - "epi", - "glium", + "glium 0.31.0", ] [[package]] name = "egui_glow" -version = "0.15.0" +version = "0.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fba815b217b8d4c17dcd080497d9ea2ad0e2047aec8d584db1c7c4a28e978db" +checksum = "af43ed7ec7199907ab5853c3bb3883ae1e741ab540aa127a798a60b7bdb906f1" dependencies = [ - "egui", - "egui-winit", - "epi", + "bytemuck", + "egui 0.18.1", "glow", - "glutin", "memoffset", + "tracing", + "wasm-bindgen", + "web-sys", ] [[package]] name = "egui_vulkano" -version = "0.4.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7606011e9ea06cef4f81fde8baffb6b8d43314ca424b4b3f3c06c4c47c842403" +checksum = "a8b9f32026b6b6d27f8c15d32c695169e3e1a9c52344a6c93bf9646f4ba2cb0c" dependencies = [ - "egui", - "epaint", + "bytemuck", + "egui 0.18.1", "thiserror", "vulkano", "vulkano-shaders", ] [[package]] -name = "emath" -version = "0.15.0" +name = "either" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24a1aaa922d55da6a2bf32957c3d153e7fb9d52ed8d69777a75092240172eb6e" +checksum = "3f107b87b6afc2a64fd13cac55fe06d6c8859f12d4b14cbcdd2c67d0976781be" + +[[package]] +name = "emath" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a977a80456be58a2c2d48e69c1d0baadef46cecef5a0c98df141c468da006f12" + +[[package]] +name = "emath" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c223f58c7e38abe1770f367b969f1b3fbd4704b67666bcb65dbb1adb0980ba72" dependencies = [ - "serde", + "bytemuck", ] [[package]] @@ -870,29 +999,99 @@ dependencies = [ [[package]] name = "epaint" -version = "0.15.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16bb4d3b8bbbd132c99d2a5efec8567e8b6d09b742f758ae6cf1e4b104fe0231" +checksum = "033292846059f08e03a71e1b5db2ee6ab7c9622c3b48da21f4bd13258ebee2db" dependencies = [ "ab_glyph", "ahash", "atomic_refcell", - "emath", + "emath 0.17.0", "nohash-hasher", - "parking_lot 0.11.2", - "serde", +] + +[[package]] +name = "epaint" +version = "0.18.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c29567088888e8ac3e8f61bbb2ddc820207ebb8d69eefde5bcefa06d65e4e89" +dependencies = [ + "ab_glyph", + "ahash", + "atomic_refcell", + "bytemuck", + "emath 0.18.0", + "nohash-hasher", + "parking_lot 0.12.1", ] [[package]] name = "epi" -version = "0.15.0" +version = "0.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f5e4e08127f9b86e2c450c96a3032764b63546eb170c2fc54684dc70ff3fc82" +checksum = "c95445deccef4d29fa30488d3f7f2e942dd343eef01228becc7cefd5b918176e" dependencies = [ - "directories-next", - "egui", - "ron 0.7.1", - "serde", + "egui 0.17.0", + "tracing", +] + +[[package]] +name = "error-code" +version = "2.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64f18991e7bf11e7ffee451b5318b5c1a73c52d0d0ada6e5a3017c8c1ced6a21" +dependencies = [ + "libc", + "str-buf", +] + +[[package]] +name = "expat-sys" +version = "2.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658f19728920138342f68408b7cf7644d90d4784353d8ebc32e7e8663dbe45fa" +dependencies = [ + "cmake", + "pkg-config", +] + +[[package]] +name = "exr" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14cc0e06fb5f67e5d6beadf3a382fec9baca1aa751c6d5368fdeee7e5932c215" +dependencies = [ + "bit_field", + "deflate", + "flume", + "half", + "inflate", + "lebe", + "smallvec", + "threadpool", +] + +[[package]] +name = "flate2" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f82b0f4c27ad9f8bfd1f3208d882da2b09c301bc1c828fd3a00d0216d2fbbff6" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "flume" +version = "0.10.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1657b4441c3403d9f7b3409e47575237dac27b1b5726df654a6ecbf92f0f7577" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "pin-project", + "spin", ] [[package]] @@ -907,7 +1106,28 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8469d0d40519bc608ec6863f1cc88f3f1deee15913f2f3b3e573d81ed38cccc" +dependencies = [ + "proc-macro2", + "quote", + "syn", ] [[package]] @@ -917,10 +1137,48 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" [[package]] -name = "futures" -version = "0.3.21" +name = "foreign-types-shared" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f73fe65f54d1e12b726f517d3e2135ca3125a437b6d998caf1962961f7172d9e" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + +[[package]] +name = "form_urlencoded" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] + +[[package]] +name = "freetype-rs" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74eadec9d0a5c28c54bb9882e54787275152a4e36ce206b45d7451384e5bf5fb" +dependencies = [ + "bitflags", + "freetype-sys", + "libc", +] + +[[package]] +name = "freetype-sys" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a37d4011c0cc628dfa766fcc195454f4b068d7afdc2adfd28861191d866e731a" +dependencies = [ + "cmake", + "libc", + "pkg-config", +] + +[[package]] +name = "futures" +version = "0.3.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab30e97ab6aacfe635fad58f22c2bb06c8b685f7421eb1e064a729e2a5f481fa" dependencies = [ "futures-channel", "futures-core", @@ -933,9 +1191,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3083ce4b914124575708913bca19bfe887522d6e2e6d0952943f5eac4a74010" +checksum = "2bfc52cbddcfd745bf1740338492bb0bd83d76c67b445f91c5fb29fae29ecaa1" dependencies = [ "futures-core", "futures-sink", @@ -943,15 +1201,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c09fd04b7e4073ac7156a9539b57a484a8ea920f79c7c675d05d289ab6110d3" +checksum = "d2acedae88d38235936c3922476b10fced7b2b68136f5e3c03c2d5be348a1115" [[package]] name = "futures-executor" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9420b90cfa29e327d0429f19be13e7ddb68fa1cccb09d65e5706b8c7a749b8a6" +checksum = "1d11aa21b5b587a64682c0094c2bdd4df0076c5324961a40cc3abd7f37930528" dependencies = [ "futures-core", "futures-task", @@ -960,15 +1218,15 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc4045962a5a5e935ee2fdedaa4e08284547402885ab326734432bed5d12966b" +checksum = "93a66fc6d035a26a3ae255a6d2bca35eda63ae4c5512bef54449113f7a1228e5" [[package]] name = "futures-macro" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33c1e13800337f4d4d7a316bf45a567dbcb6ffe087f16424852d97e97a91f512" +checksum = "0db9cce532b0eae2ccf2766ab246f114b56b9cf6d445e00c2549fbc100ca045d" dependencies = [ "proc-macro2", "quote", @@ -977,21 +1235,21 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21163e139fa306126e6eedaf49ecdb4588f939600f0b1e770f4205ee4b7fa868" +checksum = "ca0bae1fe9752cf7fd9b0064c674ae63f97b37bc714d745cbde0afb7ec4e6765" [[package]] name = "futures-task" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c66a976bf5909d801bbef33416c41372779507e7a6b3a5e25e4749c58f776a" +checksum = "842fc63b931f4056a24d59de13fb1272134ce261816e063e634ad0c15cdc5306" [[package]] name = "futures-util" -version = "0.3.21" +version = "0.3.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8b7abd5d659d9b90c8cba917f6ec750a74e2dc23902ef9cd4cc8c8b22e6036a" +checksum = "f0828a5471e340229c11c77ca80017937ce3c58cb788a17e5f1c2d5c485a9577" dependencies = [ "futures-channel", "futures-core", @@ -1005,6 +1263,16 @@ dependencies = [ "slab", ] +[[package]] +name = "gethostname" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1ebd34e35c46e00bb73e81363248d627782724609fe1b6396f553f68fe3862e" +dependencies = [ + "libc", + "winapi", +] + [[package]] name = "getrandom" version = "0.2.7" @@ -1012,15 +1280,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4eb1a864a501629691edf6c15a593b7a51eebaa1e8468e9ddc623de7c9b58ec6" dependencies = [ "cfg-if 1.0.0", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "gif" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3edd93c6756b4dfaf2709eafcc345ba2636565295c198a9cfbf75fa5e3e00b06" +dependencies = [ + "color_quant", + "weezl", ] [[package]] name = "gimli" -version = "0.26.1" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78cc372d058dcf6d5ecd98510e7fbc9e5aec4d21de70f65fea8fecebcd881bd4" +checksum = "22030e2c5a68ec659fde1e949a745124b48e6fa8b045b7ed5bd1fe4ccc5c4e5d" [[package]] name = "gl_generator" @@ -1035,14 +1315,30 @@ dependencies = [ [[package]] name = "glium" -version = "0.30.2" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "506a2aa1564891d447ae5d1ba37519a8efd6d01ea3e7952da81aa30430c90007" +checksum = "0ab4f09b43d8ee427a700cb9ed3b20e0e858d62a509edded1a98ca5707d68e19" dependencies = [ "backtrace", "fnv", "gl_generator", - "glutin", + "glutin 0.28.0", + "lazy_static", + "memoffset", + "smallvec", + "takeable-option", +] + +[[package]] +name = "glium" +version = "0.32.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2766728ecb86014b91d3d687614b32d65aacbbdc887f424a7b03cba3ab593bf" +dependencies = [ + "backtrace", + "fnv", + "gl_generator", + "glutin 0.29.1", "lazy_static", "memoffset", "smallvec", @@ -1063,9 +1359,9 @@ dependencies = [ [[package]] name = "glutin" -version = "0.27.0" +version = "0.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "762d6cd2e1b855d99668ebe591cc9058659d85ac39a9a2078000eb122ddba8f0" +checksum = "00ea9dbe544bc8a657c4c4a798c2d16cd01b549820e47657297549d28371f6d2" dependencies = [ "android_glue", "cgl", @@ -1077,22 +1373,48 @@ dependencies = [ "glutin_glx_sys", "glutin_wgl_sys", "lazy_static", - "libloading 0.7.3", + "libloading", "log", "objc", "osmesa-sys", "parking_lot 0.11.2", - "wayland-client 0.28.6", + "wayland-client", "wayland-egl", "winapi", - "winit", + "winit 0.26.1", +] + +[[package]] +name = "glutin" +version = "0.29.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444c9ad294fdcaf20ccf6726b78f380b5450275540c9b68ab62f49726ad1c713" +dependencies = [ + "cgl", + "cocoa 0.24.0", + "core-foundation 0.9.3", + "glutin_egl_sys", + "glutin_gles2_sys", + "glutin_glx_sys", + "glutin_wgl_sys", + "libloading", + "log", + "objc", + "once_cell", + "osmesa-sys", + "parking_lot 0.12.1", + "raw-window-handle 0.5.0", + "wayland-client", + "wayland-egl", + "winapi", + "winit 0.27.2", ] [[package]] name = "glutin_egl_sys" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2abb6aa55523480c4adc5a56bbaa249992e2dddb2fc63dc96e04a3355364c211" +checksum = "68900f84b471f31ea1d1355567eb865a2cf446294f06cef8d653ed7bcf5f013d" dependencies = [ "gl_generator", "winapi", @@ -1116,9 +1438,9 @@ dependencies = [ [[package]] name = "glutin_glx_sys" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e393c8fc02b807459410429150e9c4faffdb312d59b8c038566173c81991351" +checksum = "d93d0575865098580c5b3a423188cd959419912ea60b1e48e8b3b526f6d02468" dependencies = [ "gl_generator", "x11-dl", @@ -1161,18 +1483,15 @@ checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" [[package]] name = "hashbrown" -version = "0.11.2" +version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "heck" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c" -dependencies = [ - "unicode-segmentation", -] +checksum = "2540771e65fc8cb83cd6e8a237f70c319bd5c29f78ed1084ba5d50eeac86f7f9" [[package]] name = "hermit-abi" @@ -1192,6 +1511,19 @@ dependencies = [ "quick-error", ] +[[package]] +name = "iana-time-zone" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5528d9c2817db4e10cc78f8d4c8228906e5854f389ff6b076cee3572a09d35" +dependencies = [ + "android_system_properties", + "core-foundation-sys 0.8.3", + "js-sys", + "wasm-bindgen", + "winapi", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1199,15 +1531,54 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] -name = "indexmap" -version = "1.8.2" +name = "idna" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6012d540c5baa3589337a98ce73408de9b5a25ec9fc2c6fd6be8f0d39e0ca5a" +checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8" +dependencies = [ + "matches", + "unicode-bidi", + "unicode-normalization", +] + +[[package]] +name = "image" +version = "0.24.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e30ca2ecf7666107ff827a8e481de6a132a9b687ed3bb20bb1c144a36c00964" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "exr", + "gif", + "jpeg-decoder", + "num-rational", + "num-traits", + "png", + "scoped_threadpool", + "tiff", +] + +[[package]] +name = "indexmap" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10a35a97730320ffe8e2d410b5d3b69279b98d2c14bdb8b70ea89ecf7888d41e" dependencies = [ "autocfg", "hashbrown", ] +[[package]] +name = "inflate" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff" +dependencies = [ + "adler32", +] + [[package]] name = "instant" version = "0.1.12" @@ -1215,6 +1586,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] @@ -1223,6 +1597,26 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +[[package]] +name = "itoa" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8af84674fe1f223a982c933a0ee1086ac4d4052aa0fb8060c12c6ad838e754" + +[[package]] +name = "jni" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" +dependencies = [ + "cesu8", + "combine", + "jni-sys", + "log", + "thiserror", + "walkdir", +] + [[package]] name = "jni-sys" version = "0.3.0" @@ -1230,10 +1624,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] -name = "js-sys" -version = "0.3.58" +name = "jpeg-decoder" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3fac17f7123a73ca62df411b1bf727ccc805daa070338fda671c86dac1bdc27" +checksum = "9478aa10f73e7528198d75109c8be5cd7d15fb530238040148d5f9a22d4c5b3b" +dependencies = [ + "rayon", +] + +[[package]] +name = "js-sys" +version = "0.3.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258451ab10b34f8af53416d1fdab72c22e805f0c92a1136d59470ec0b11138b2" dependencies = [ "wasm-bindgen", ] @@ -1244,12 +1647,6 @@ version = "3.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" -[[package]] -name = "lazy-bytes-cast" -version = "5.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10257499f089cd156ad82d0a9cd57d9501fa2c989068992a97eb3c27836f206b" - [[package]] name = "lazy_static" version = "1.4.0" @@ -1257,20 +1654,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] -name = "libc" -version = "0.2.126" +name = "lebe" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349d5a591cd28b49e1d1037471617a32ddcda5731b99419008085f72d5a53836" +checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" [[package]] -name = "libloading" -version = "0.6.7" +name = "libc" +version = "0.2.132" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "351a32417a12d5f7e82c368a66781e307834dae04c6ce0cd4456d52989229883" -dependencies = [ - "cfg-if 1.0.0", - "winapi", -] +checksum = "8371e4e5341c3a96db127eb2465ac681ced4c433e01dd0e938adbef26ba93ba5" [[package]] name = "libloading" @@ -1310,6 +1703,12 @@ dependencies = [ "libc", ] +[[package]] +name = "matches" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a3e378b66a060d48947b590737b30a1be76706c8dd7b8ba0f2fe3989c68a853f" + [[package]] name = "memchr" version = "2.5.0" @@ -1318,18 +1717,18 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memmap2" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" +checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" dependencies = [ "libc", ] [[package]] name = "memmap2" -version = "0.3.1" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b6c2ebff6180198788f5db08d7ce3bc1d0b617176678831a7510825973e357" +checksum = "95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498" dependencies = [ "libc", ] @@ -1353,7 +1752,7 @@ dependencies = [ "block", "cocoa 0.20.2", "core-graphics 0.19.2", - "foreign-types", + "foreign-types 0.3.2", "log", "objc", ] @@ -1375,22 +1774,9 @@ dependencies = [ [[package]] name = "mio" -version = "0.7.14" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" -dependencies = [ - "libc", - "log", - "miow", - "ntapi", - "winapi", -] - -[[package]] -name = "mio" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "713d550d9b44d89174e066b7a6217ae06234c10cb47819a88290d2b353c31799" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" dependencies = [ "libc", "log", @@ -1399,60 +1785,114 @@ dependencies = [ ] [[package]] -name = "mio-misc" -version = "1.2.2" +name = "nanorand" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b47412f3a52115b936ff2a229b803498c7b4d332adeb87c2f1498c9da54c398c" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" dependencies = [ - "crossbeam", - "crossbeam-queue", - "log", - "mio 0.7.14", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", + "getrandom", ] [[package]] name = "ndk" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8794322172319b972f528bf90c6b467be0079f1fa82780ffb431088e741a73ab" +checksum = "96d868f654c72e75f8687572699cdabe755f03effbb62542768e995d5b8d699d" dependencies = [ + "bitflags", "jni-sys", - "ndk-sys", + "ndk-sys 0.2.2", "num_enum", "thiserror", ] [[package]] -name = "ndk-glue" -version = "0.3.0" +name = "ndk" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5caf0c24d51ac1c905c27d4eda4fa0635bbe0de596b8f79235e0b17a4d29385" +checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys 0.3.0", + "num_enum", + "thiserror", +] + +[[package]] +name = "ndk" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys 0.4.0", + "num_enum", + "raw-window-handle 0.5.0", + "thiserror", +] + +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + +[[package]] +name = "ndk-glue" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71bee8ea72d685477e28bd004cfe1bf99c754d688cd78cad139eae4089484d4" dependencies = [ "lazy_static", "libc", "log", - "ndk", + "ndk 0.5.0", + "ndk-context", "ndk-macro", - "ndk-sys", + "ndk-sys 0.2.2", +] + +[[package]] +name = "ndk-glue" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d0c4a7b83860226e6b4183edac21851f05d5a51756e97a1144b7f5a6b63e65f" +dependencies = [ + "lazy_static", + "libc", + "log", + "ndk 0.6.0", + "ndk-context", + "ndk-macro", + "ndk-sys 0.3.0", +] + +[[package]] +name = "ndk-glue" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0434fabdd2c15e0aab768ca31d5b7b333717f03cf02037d5a0a3ff3c278ed67f" +dependencies = [ + "libc", + "log", + "ndk 0.7.0", + "ndk-context", + "ndk-macro", + "ndk-sys 0.4.0", + "once_cell", + "parking_lot 0.12.1", ] [[package]] name = "ndk-macro" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +checksum = "0df7ac00c4672f9d5aece54ee3347520b7e20f158656c7db2e6de01902eb7a6c" dependencies = [ "darling", - "proc-macro-crate 0.1.5", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -1465,27 +1905,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e1bcdd74c20ad5d95aacd60ef9ba40fdf77f767051040541df557b7a9b2a2121" [[package]] -name = "nix" -version = "0.18.0" +name = "ndk-sys" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" +checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" dependencies = [ - "bitflags", - "cc", - "cfg-if 0.1.10", - "libc", + "jni-sys", ] [[package]] -name = "nix" -version = "0.20.0" +name = "ndk-sys" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa9b4819da1bc61c0ea48b63b7bc8604064dd43013e7cc325df098d49cd7c18a" +checksum = "21d83ec9c63ec5bf950200a8e508bdad6659972187b625469f58ef8c08e29046" dependencies = [ - "bitflags", - "cc", - "cfg-if 1.0.0", - "libc", + "jni-sys", ] [[package]] @@ -1516,9 +1950,9 @@ dependencies = [ [[package]] name = "nix" -version = "0.24.1" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f17df307904acd05aa8e32e97bb20f2a0df1728bbc2d771ae8f9a90463441e9" +checksum = "195cdbc1741b8134346d515b3a56a1c94b0912758009cfd53f99ea0f57b065fc" dependencies = [ "bitflags", "cfg-if 1.0.0", @@ -1526,6 +1960,20 @@ dependencies = [ "memoffset", ] +[[package]] +name = "nix" +version = "0.25.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e322c04a9e3440c327fca7b6c8a63e6890a32fa2ad689db972425f07e0d22abb" +dependencies = [ + "autocfg", + "bitflags", + "cfg-if 1.0.0", + "libc", + "memoffset", + "pin-utils", +] + [[package]] name = "nohash-hasher" version = "0.2.0" @@ -1542,15 +1990,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "ntapi" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c28774a7fd2fbb4f0babd8237ce554b73af68021b5f695a3cebd6c59bac0980f" -dependencies = [ - "winapi", -] - [[package]] name = "num-integer" version = "0.1.45" @@ -1561,6 +2000,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.15" @@ -1595,7 +2045,7 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" dependencies = [ - "proc-macro-crate 1.1.3", + "proc-macro-crate", "proc-macro2", "quote", "syn", @@ -1642,18 +2092,18 @@ dependencies = [ [[package]] name = "object" -version = "0.28.4" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e42c982f2d955fac81dd7e1d0e1426a7d702acd9c98d19ab01083a6a0328c424" +checksum = "21158b2c33aa6d4561f1c0a6ea283ca92bc54802a93b263e910746d679a7eb53" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.12.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" +checksum = "074864da206b4973b84eb91683020dbefd6a8c3f0f38e054d93954e891935e4e" [[package]] name = "osmesa-sys" @@ -1666,20 +2116,11 @@ dependencies = [ [[package]] name = "owned_ttf_parser" -version = "0.6.0" +version = "0.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" +checksum = "07ef1a404ae479dd6906f4fa2c88b3c94028f1284beb42a47c183a7c27ee9a3e" dependencies = [ - "ttf-parser 0.6.2", -] - -[[package]] -name = "owned_ttf_parser" -version = "0.15.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb1e509cfe7a12db2a90bfa057dfcdbc55a347f5da677c506b53dd099cfec9d" -dependencies = [ - "ttf-parser 0.15.1", + "ttf-parser", ] [[package]] @@ -1746,6 +2187,26 @@ dependencies = [ "log", ] +[[package]] +name = "pin-project" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + [[package]] name = "pin-project-lite" version = "0.2.9" @@ -1764,6 +2225,18 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df8c4ec4b0627e53bdf214615ad287367e482558cf84b109250b37464dc03ae" +[[package]] +name = "png" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc38c0ad57efb786dd57b9864e5b18bae478c00c824dc55a38bbc9da95dde3ba" +dependencies = [ + "bitflags", + "crc32fast", + "deflate", + "miniz_oxide", +] + [[package]] name = "pretty_env_logger" version = "0.4.0" @@ -1776,28 +2249,20 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "0.1.5" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" -dependencies = [ - "toml", -] - -[[package]] -name = "proc-macro-crate" -version = "1.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17d47ce914bf4de440332250b0edd23ce48c005f59fab39d3335866b114f11a" +checksum = "eda0fc3b0fb7c975631757e14d9049da17374063edb6ebbcbc54d880d4fe94e9" dependencies = [ + "once_cell", "thiserror", "toml", ] [[package]] name = "proc-macro2" -version = "1.0.39" +version = "1.0.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c54b25569025b7fc9651de43004ae593a75ad88543b17178aa5e1b9c4f15f56f" +checksum = "0a2ca2c61bc9f3d74d2886294ab7b9853abd9c1ad903a3ac7815c58989bb7bab" dependencies = [ "unicode-ident", ] @@ -1808,34 +2273,15 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" -[[package]] -name = "quick-xml" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8533f14c8382aaad0d592c812ac3b826162128b65662331e1127b45c3d18536b" -dependencies = [ - "memchr", -] - [[package]] name = "quote" -version = "1.0.18" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1feb54ed693b93a84e14094943b84b7c4eae204c512b7ccb95ab0c66d278ad1" +checksum = "bbe448f377a7d6961e30f5955f9b8d106c3f5e449d493ee1b125c1d43c2b5179" dependencies = [ "proc-macro2", ] -[[package]] -name = "raw-window-handle" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e28f55143d0548dad60bb4fbdc835a3d7ac6acc3324506450c5fdd6e42903a76" -dependencies = [ - "libc", - "raw-window-handle 0.4.3", -] - [[package]] name = "raw-window-handle" version = "0.4.3" @@ -1846,30 +2292,52 @@ dependencies = [ ] [[package]] -name = "redox_syscall" -version = "0.2.13" +name = "raw-window-handle" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f25bc4c7e55e0b0b7a1d43fb893f4fa1361d0abe38b9ce4f323c2adfe6ef42" +checksum = "ed7e3d950b66e19e0c372f3fa3fbbcf85b1746b571f74e0c2af6042a5c93420a" +dependencies = [ + "cty", +] + +[[package]] +name = "rayon" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd99e5772ead8baa5215278c9b15bf92087709e9c1b2d1f97cdb5a183c933a7d" +dependencies = [ + "autocfg", + "crossbeam-deque", + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "258bcdb5ac6dad48491bb2992db6b7cf74878b0384908af124823d118c99683f" +dependencies = [ + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-utils", + "num_cpus", +] + +[[package]] +name = "redox_syscall" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" dependencies = [ "bitflags", ] -[[package]] -name = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom", - "redox_syscall", - "thiserror", -] - [[package]] name = "regex" -version = "1.5.6" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d83f127d94bdbcda4c8cc2e50f6f84f4b611f69c902699ca385a39c3a75f9ff1" +checksum = "4c4eb3267174b8c6c2f654116623910a0fef09c4753f8dd83db29c48a0df988b" dependencies = [ "aho-corasick", "memchr", @@ -1884,9 +2352,9 @@ checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" [[package]] name = "regex-syntax" -version = "0.6.26" +version = "0.6.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" +checksum = "a3f87b73ce11b1619a3c6332f45341e0047173771e8b8b73f87bfeefb7b56244" [[package]] name = "ron" @@ -1915,20 +2383,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] -name = "rusttype" -version = "0.9.2" +name = "ryu" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" -dependencies = [ - "ab_glyph_rasterizer", - "owned_ttf_parser 0.6.0", -] +checksum = "4501abdff3ae82a1c1b477a17252eb69cee9e66eb915c1abaa4f44d873df9f09" [[package]] -name = "ryu" -version = "1.0.10" +name = "safe_arch" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3f6f92acf49d1b98f7a81226834412ada05458b7364277387724a237f062695" +checksum = "c1ff3d6d9696af502cc3110dacce942840fb06ff4514cad92236ecc455f2ce05" +dependencies = [ + "bytemuck", +] [[package]] name = "same-file" @@ -1945,6 +2412,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" +[[package]] +name = "scoped_threadpool" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d51f5df5af43ab3f1360b429fa5e0152ac5ce8c0bd6485cae490332e96846a8" + [[package]] name = "scopeguard" version = "1.1.0" @@ -1952,25 +2425,69 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] -name = "serde" -version = "1.0.137" +name = "sctk-adwaita" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61ea8d54c77f8315140a05f4c7237403bf38b72704d031543aa1d16abbf517d1" +checksum = "04b7c47a572f73de28bee5b5060d085b42b6ce1e4ee2b49c956ea7b25e94b6f0" +dependencies = [ + "crossfont", + "log", + "smithay-client-toolkit 0.16.0", + "tiny-skia", +] + +[[package]] +name = "serde" +version = "1.0.143" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "53e8e5d5b70924f74ff5c6d64d9a5acd91422117c60f48c4e07855238a254553" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.137" +version = "1.0.143" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f26faba0c3959972377d3b2d306ee9f71faee9714294e41bb777f83f88578be" +checksum = "d3d8e8de557aee63c26b85b947f5e59b690d0454c753f3adeb5cd7835ab88391" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "serde_json" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38dd04e3c8279e75b31ef29dbdceebfe5ad89f4d0937213c53f7d49d01b3d5a7" +dependencies = [ + "itoa 1.0.3", + "ryu", + "serde", +] + +[[package]] +name = "servo-fontconfig" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7e3e22fe5fd73d04ebf0daa049d3efe3eae55369ce38ab16d07ddd9ac5c217c" +dependencies = [ + "libc", + "servo-fontconfig-sys", +] + +[[package]] +name = "servo-fontconfig-sys" +version = "5.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e36b879db9892dfa40f95da1c38a835d41634b825fbd8c4c418093d53c24b388" +dependencies = [ + "expat-sys", + "freetype-sys", + "pkg-config", +] + [[package]] name = "shaderc" version = "0.7.4" @@ -2018,7 +2535,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "29ad2e15f37ec9a6cc544097b78a1ec90001e9f71b81338ca39f430adaca99af" dependencies = [ "libc", - "mio 0.8.3", + "mio", "signal-hook", ] @@ -2033,9 +2550,12 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.6" +version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb703cfe953bccee95685111adeedb76fabe4e97549a58d16f03ea7b9367bb32" +checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" +dependencies = [ + "autocfg", +] [[package]] name = "slotmap" @@ -2048,28 +2568,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.8.0" +version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2dd574626839106c320a323308629dcb1acfc96e32a8cba364ddc61ac23ee83" - -[[package]] -name = "smithay-client-toolkit" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4750c76fd5d3ac95fa3ed80fe667d6a3d8590a960e5b575b98eea93339a80b80" -dependencies = [ - "andrew", - "bitflags", - "calloop", - "dlib 0.4.2", - "lazy_static", - "log", - "memmap2 0.1.0", - "nix 0.18.0", - "wayland-client 0.28.6", - "wayland-cursor 0.28.6", - "wayland-protocols 0.28.6", -] +checksum = "2fd0db749597d91ff862fd1d55ea87f7855a744a8425a64695b6fca237d1dad1" [[package]] name = "smithay-client-toolkit" @@ -2078,25 +2579,35 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a28f16a97fa0e8ce563b2774d1e732dd5d4025d2772c5dba0a41a0f90a29da3" dependencies = [ "bitflags", - "dlib 0.5.0", + "calloop 0.9.3", + "dlib", "lazy_static", "log", "memmap2 0.3.1", "nix 0.22.3", "pkg-config", - "wayland-client 0.29.4", - "wayland-cursor 0.29.4", - "wayland-protocols 0.29.4", + "wayland-client", + "wayland-cursor", + "wayland-protocols", ] [[package]] -name = "smithay-clipboard" -version = "0.6.5" +name = "smithay-client-toolkit" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "610b551bd25378bfd2b8e7a0fcbd83d427e8f2f6a40c47ae0f70688e9949dd55" +checksum = "f307c47d32d2715eb2e0ece5589057820e0e5e70d07c247d1063e844e107f454" dependencies = [ - "smithay-client-toolkit 0.15.4", - "wayland-client 0.29.4", + "bitflags", + "calloop 0.10.1", + "dlib", + "lazy_static", + "log", + "memmap2 0.5.7", + "nix 0.24.2", + "pkg-config", + "wayland-client", + "wayland-cursor", + "wayland-protocols", ] [[package]] @@ -2110,20 +2621,25 @@ dependencies = [ ] [[package]] -name = "spirv_headers" -version = "1.5.0" +name = "spin" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f5b132530b1ac069df335577e3581765995cba5a13995cdbbdbc8fb057c532c" +checksum = "7f6002a767bff9e83f8eeecf883ecb8011875a21ae8da43bffb817a57e78cc09" dependencies = [ - "bitflags", - "num-traits", + "lock_api", ] [[package]] -name = "strsim" -version = "0.9.3" +name = "str-buf" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" +checksum = "9e08d8363704e6c71fc928674353e6b7c23dcea9d82d7012c8faf2a3a025f8d0" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "sudo" @@ -2137,9 +2653,9 @@ dependencies = [ [[package]] name = "syn" -version = "1.0.96" +version = "1.0.99" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0748dd251e24453cb8717f0354206b91557e4ec8703673a4b30208f2abaf1ebf" +checksum = "58dbef6ec655055e20b86b15a8cc6d439cca19b667537ac6a1369572d151ab13" dependencies = [ "proc-macro2", "quote", @@ -2163,24 +2679,44 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd829fe32373d27f76265620b5309d0340cb8550f523c1dda251d6298069069a" +checksum = "f5f6586b7f764adc0231f4c79be7b920e766bb2f3e51b3661cdb263828f19994" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.31" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0396bc89e626244658bef819e22d0cc459e795a5ebe878e6ec336d1674a8d79a" +checksum = "12bafc5b54507e0149cdf1b145a5d80ab80a90bcd9275df43d4fff68460f6c21" dependencies = [ "proc-macro2", "quote", "syn", ] +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "tiff" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7259662e32d1e219321eb309d5f9d898b779769d81b76e762c07c8e5d38fcb65" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + [[package]] name = "time" version = "0.1.44" @@ -2193,15 +2729,56 @@ dependencies = [ ] [[package]] -name = "tokio" -version = "1.19.2" +name = "tiny-skia" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51a52ed6686dd62c320f9b89299e9dfb46f730c7a48e635c19f21d116cb1439" +checksum = "642680569bb895b16e4b9d181c60be1ed136fa0c9c7f11d004daf053ba89bf82" dependencies = [ + "arrayref", + "arrayvec", + "bytemuck", + "cfg-if 1.0.0", + "png", + "safe_arch", + "tiny-skia-path", +] + +[[package]] +name = "tiny-skia-path" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c114d32f0c2ee43d585367cb013dfaba967ab9f62b90d9af0d696e955e70fa6c" +dependencies = [ + "arrayref", + "bytemuck", +] + +[[package]] +name = "tinyvec" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + +[[package]] +name = "tokio" +version = "1.20.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a8325f63a7d4774dd041e363b2409ed1c5cbbd0f867795e661df066b2b0a581" +dependencies = [ + "autocfg", "bytes", "libc", "memchr", - "mio 0.8.3", + "mio", "num_cpus", "once_cell", "parking_lot 0.12.1", @@ -2233,16 +2810,42 @@ dependencies = [ ] [[package]] -name = "ttf-parser" -version = "0.6.2" +name = "tracing" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" +checksum = "2fce9567bd60a67d08a16488756721ba392f24f29006402881e43b19aac64307" +dependencies = [ + "cfg-if 1.0.0", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11c75893af559bc8e10716548bdef5cb2b983f8e637db9d0e15126b61b484ee2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5aeea4303076558a00714b823f9ad67d58a3bbda1df83d8827d21193156e22f7" +dependencies = [ + "once_cell", +] [[package]] name = "ttf-parser" -version = "0.15.1" +version = "0.15.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42d4b50cba812f0f04f0707bb6a0eaa5fae4ae05d90fc2a377998d2f21e77a1c" +checksum = "7b3e06c9b9d80ed6b745c7159c40b311ad2916abb34a49e9be2653b90db0d8dd" [[package]] name = "tui" @@ -2258,10 +2861,25 @@ dependencies = [ ] [[package]] -name = "unicode-ident" -version = "1.0.1" +name = "unicode-bidi" +version = "0.3.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bd2fe26506023ed7b5e1e315add59d6f584c621d037f9368fea9cfb988f368c" +checksum = "099b7128301d285f79ddd55b9a83d5e6b9e97c92e0ea0daebee7263e932de992" + +[[package]] +name = "unicode-ident" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4f5b37a154999a8f3f98cc23a628d850e154479cd94decf3414696e12e31aaf" + +[[package]] +name = "unicode-normalization" +version = "0.1.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "854cbdc4f7bc6ae19c820d44abdc3277ac3e1b2b93db20a636825d9322fb60e6" +dependencies = [ + "tinyvec", +] [[package]] name = "unicode-segmentation" @@ -2275,6 +2893,24 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" +[[package]] +name = "url" +version = "2.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a507c383b2d33b5fc35d1861e77e6b383d158b2da5e14fe51b83dfedf6fd578c" +dependencies = [ + "form_urlencoded", + "idna", + "matches", + "percent-encoding", +] + +[[package]] +name = "vec_map" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" + [[package]] name = "version_check" version = "0.9.4" @@ -2283,28 +2919,32 @@ checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "vk-parse" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c1538fa783f47fb5a6eb495f024f426599a4fe66ff3773ff2252156c64d350a" +checksum = "29f3bfdc05ca5a9f385f50daa1d714b60324b68814b3bae99d797f0952e13e84" dependencies = [ "xml-rs", ] [[package]] name = "vulkano" -version = "0.25.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e631daf0d54bf36908ccff9f38ced7ff253a327e396ac13503a11401bee8c38" +checksum = "3663883d6bf6e3d34c891432fe5ce5829ad75f0cc2e43b3d079340385c2d81e0" dependencies = [ "ash", + "bytemuck", "crossbeam-queue", - "fnv", "half", "heck", "indexmap", "lazy_static", - "parking_lot 0.11.2", + "parking_lot 0.12.1", + "proc-macro2", + "quote", "regex", + "serde", + "serde_json", "shared_library", "smallvec", "vk-parse", @@ -2312,30 +2952,30 @@ dependencies = [ [[package]] name = "vulkano-shaders" -version = "0.25.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f45834e124ae0fdc95a358d83f163d9b14e9ec7780d99cd5aecbf4e76b1a67e" +checksum = "a462137ae796894a271b4d8048ef33597a8173e0ae3e4ec54fc72e70c2d1a977" dependencies = [ - "num-traits", + "heck", "proc-macro2", "quote", "shaderc", - "spirv_headers", "syn", + "vulkano", ] [[package]] name = "vulkano-win" -version = "0.25.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5a84fe7d636a1aefdaecabb89b8c47d0b3a785653a38ffbc69a34fb46f6784" +checksum = "ba30adc8d7b317e155e43343b6d30195d335df139d168d2ae5ece7837d57e887" dependencies = [ "cocoa 0.20.2", "metal", "objc", - "raw-window-handle 0.3.4", + "raw-window-handle 0.4.3", "vulkano", - "winit", + "winit 0.26.1", ] [[package]] @@ -2363,9 +3003,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c53b543413a17a202f4be280a7e5c62a1c69345f5de525ee64f8cfdbc954994" +checksum = "fc7652e3f6c4706c8d9cd54832c4a4ccb9b5336e2c3bd154d5cccfbf1c1f5f7d" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -2373,13 +3013,13 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5491a68ab4500fa6b4d726bd67408630c3dbe9c4fe7bda16d5c82a1fd8c7340a" +checksum = "662cd44805586bd52971b9586b1df85cdbbd9112e4ef4d8f41559c334dc6ac3f" dependencies = [ "bumpalo", - "lazy_static", "log", + "once_cell", "proc-macro2", "quote", "syn", @@ -2388,9 +3028,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c441e177922bc58f1e12c022624b6216378e5febc2f0533e41ba443d505b80aa" +checksum = "b260f13d3012071dfb1512849c033b1925038373aea48ced3012c09df952c602" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -2398,9 +3038,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d94ac45fcf608c1f45ef53e748d35660f168490c10b23704c7779ab8f5c3048" +checksum = "5be8e654bdd9b79216c2929ab90721aa82faf65c48cdf08bdc4e7f51357b80da" dependencies = [ "proc-macro2", "quote", @@ -2411,25 +3051,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a89911bd99e5f3659ec4acf9c4d93b0a90fe4a2a11f15328472058edc5261be" - -[[package]] -name = "wayland-client" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e3ab332350e502f159382201394a78e3cc12d0f04db863429260164ea40e0355" -dependencies = [ - "bitflags", - "downcast-rs", - "libc", - "nix 0.20.0", - "scoped-tls", - "wayland-commons 0.28.6", - "wayland-scanner 0.28.6", - "wayland-sys 0.28.6", -] +checksum = "6598dd0bd3c7d51095ff6531a5b23e02acdc81804e30d8f07afb77b7215a140a" [[package]] name = "wayland-client" @@ -2442,21 +3066,9 @@ dependencies = [ "libc", "nix 0.22.3", "scoped-tls", - "wayland-commons 0.29.4", - "wayland-scanner 0.29.4", - "wayland-sys 0.29.4", -] - -[[package]] -name = "wayland-commons" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21817947c7011bbd0a27e11b17b337bfd022e8544b071a2641232047966fbda" -dependencies = [ - "nix 0.20.0", - "once_cell", - "smallvec", - "wayland-sys 0.28.6", + "wayland-commons", + "wayland-scanner", + "wayland-sys", ] [[package]] @@ -2468,18 +3080,7 @@ dependencies = [ "nix 0.22.3", "once_cell", "smallvec", - "wayland-sys 0.29.4", -] - -[[package]] -name = "wayland-cursor" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be610084edd1586d45e7bdd275fe345c7c1873598caa464c4fb835dee70fa65a" -dependencies = [ - "nix 0.20.0", - "wayland-client 0.28.6", - "xcursor", + "wayland-sys", ] [[package]] @@ -2489,30 +3090,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c52758f13d5e7861fc83d942d3d99bf270c83269575e52ac29e5b73cb956a6bd" dependencies = [ "nix 0.22.3", - "wayland-client 0.29.4", + "wayland-client", "xcursor", ] [[package]] name = "wayland-egl" -version = "0.28.6" +version = "0.29.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99ba1ab1e18756b23982d36f08856d521d7df45015f404a2d7c4f0b2d2f66956" +checksum = "83281d69ee162b59031c666385e93bde4039ec553b90c4191cdb128ceea29a3a" dependencies = [ - "wayland-client 0.28.6", - "wayland-sys 0.28.6", -] - -[[package]] -name = "wayland-protocols" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "286620ea4d803bacf61fa087a4242ee316693099ee5a140796aaba02b29f861f" -dependencies = [ - "bitflags", - "wayland-client 0.28.6", - "wayland-commons 0.28.6", - "wayland-scanner 0.28.6", + "wayland-client", + "wayland-sys", ] [[package]] @@ -2522,20 +3111,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60147ae23303402e41fe034f74fb2c35ad0780ee88a1c40ac09a3be1e7465741" dependencies = [ "bitflags", - "wayland-client 0.29.4", - "wayland-commons 0.29.4", - "wayland-scanner 0.29.4", -] - -[[package]] -name = "wayland-scanner" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce923eb2deb61de332d1f356ec7b6bf37094dc5573952e1c8936db03b54c03f1" -dependencies = [ - "proc-macro2", - "quote", - "xml-rs", + "wayland-client", + "wayland-commons", + "wayland-scanner", ] [[package]] @@ -2549,33 +3127,22 @@ dependencies = [ "xml-rs", ] -[[package]] -name = "wayland-sys" -version = "0.28.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d841fca9aed7febf9bed2e9796c49bf58d4152ceda8ac949ebe00868d8f0feb8" -dependencies = [ - "dlib 0.5.0", - "lazy_static", - "pkg-config", -] - [[package]] name = "wayland-sys" version = "0.29.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9341df79a8975679188e37dab3889bfa57c44ac2cb6da166f519a81cbe452d4" dependencies = [ - "dlib 0.5.0", + "dlib", "lazy_static", "pkg-config", ] [[package]] name = "web-sys" -version = "0.3.58" +version = "0.3.59" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fed94beee57daf8dd7d51f2b15dc2bcde92d7a72304cdf662a4371008b71b90" +checksum = "ed055ab27f941423197eb86b2035720b1a3ce40504df082cac2ecc6ed73335a1" dependencies = [ "js-sys", "wasm-bindgen", @@ -2583,20 +3150,29 @@ dependencies = [ [[package]] name = "webbrowser" -version = "0.5.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecad156490d6b620308ed411cfee90d280b3cbd13e189ea0d3fada8acc89158a" +checksum = "fc6a3cffdb686fbb24d9fb8f03a213803277ed2300f11026a3afe1f108dc021b" dependencies = [ + "jni", + "ndk-glue 0.6.2", + "url", "web-sys", "widestring", "winapi", ] [[package]] -name = "widestring" -version = "0.4.3" +name = "weezl" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c168940144dd21fd8046987c16a46a33d5fc84eec29ef9dcddc2ac9e31526b7c" +checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" + +[[package]] +name = "widestring" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983" [[package]] name = "winapi" @@ -2623,6 +3199,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "winapi-wsapoll" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c17110f57155602a80dca10be03852116403c9ff3cd25b079d666f2aa3df6e" +dependencies = [ + "winapi", +] + [[package]] name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" @@ -2674,9 +3259,9 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" [[package]] name = "winit" -version = "0.25.0" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79610794594d5e86be473ef7763f604f2159cbac8c94debd00df8fb41e86c2f8" +checksum = "9b43cc931d58b99461188607efd7acb2a093e65fc621f54cad78517a6063e73a" dependencies = [ "bitflags", "cocoa 0.24.0", @@ -2688,36 +3273,70 @@ dependencies = [ "lazy_static", "libc", "log", - "mio 0.7.14", - "mio-misc", - "ndk", - "ndk-glue", - "ndk-sys", + "mio", + "ndk 0.5.0", + "ndk-glue 0.5.2", + "ndk-sys 0.2.2", "objc", "parking_lot 0.11.2", "percent-encoding", - "raw-window-handle 0.3.4", - "scopeguard", - "smithay-client-toolkit 0.12.3", - "wayland-client 0.28.6", + "raw-window-handle 0.4.3", + "smithay-client-toolkit 0.15.4", + "wasm-bindgen", + "wayland-client", + "wayland-protocols", + "web-sys", "winapi", "x11-dl", ] [[package]] -name = "x11-clipboard" -version = "0.5.3" +name = "winit" +version = "0.27.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "473068b7b80ac86a18328824f1054e5e007898c47b5bbc281bd7abe32bc3653c" +checksum = "83a8f3e9d742401efcfe833b8f84960397482ff049cb7bf59a112e14a4be97f7" dependencies = [ - "xcb", + "bitflags", + "cocoa 0.24.0", + "core-foundation 0.9.3", + "core-graphics 0.22.3", + "dispatch", + "instant", + "libc", + "log", + "mio", + "ndk 0.7.0", + "ndk-glue 0.7.0", + "objc", + "once_cell", + "parking_lot 0.12.1", + "percent-encoding", + "raw-window-handle 0.4.3", + "raw-window-handle 0.5.0", + "sctk-adwaita", + "smithay-client-toolkit 0.16.0", + "wasm-bindgen", + "wayland-client", + "wayland-protocols", + "web-sys", + "windows-sys", + "x11-dl", +] + +[[package]] +name = "wio" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" +dependencies = [ + "winapi", ] [[package]] name = "x11-dl" -version = "2.19.1" +version = "2.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" +checksum = "0c83627bc137605acc00bb399c7b908ef460b621fc37c953db2b09f88c449ea6" dependencies = [ "lazy_static", "libc", @@ -2725,14 +3344,15 @@ dependencies = [ ] [[package]] -name = "xcb" -version = "0.10.1" +name = "x11rb" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771e2b996df720cd1c6dd9ff90f62d91698fd3610cc078388d0564bdd6622a9c" +checksum = "6e99be55648b3ae2a52342f9a870c0e138709a3493261ce9b469afe6e4df6d8a" dependencies = [ - "libc", - "log", - "quick-xml", + "gethostname", + "nix 0.22.3", + "winapi", + "winapi-wsapoll", ] [[package]] @@ -2744,15 +3364,6 @@ dependencies = [ "nom", ] -[[package]] -name = "xdg" -version = "2.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c4583db5cbd4c4c0303df2d15af80f0539db703fa1c68802d4cbbd2dd0f88f6" -dependencies = [ - "dirs", -] - [[package]] name = "xml-rs" version = "0.8.4" diff --git a/amdfan/src/main.rs b/amdfan/src/main.rs index 534558f..347a982 100644 --- a/amdfan/src/main.rs +++ b/amdfan/src/main.rs @@ -1,17 +1,20 @@ +use std::io; +use std::path::PathBuf; +use std::time::{Duration, Instant}; + use amdgpu_config::fan::{MatrixPoint, DEFAULT_FAN_CONFIG_PATH}; -use crossterm::{ - event::{self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode}, - execute, - terminal::{disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen}, +use crossterm::event::{self, DisableMouseCapture, EnableMouseCapture, Event, KeyCode}; +use crossterm::execute; +use crossterm::terminal::{ + disable_raw_mode, enable_raw_mode, EnterAlternateScreen, LeaveAlternateScreen, }; use gumdrop::Options; -use std::path::PathBuf; -use std::time::Instant; -use std::{io, time::Duration}; -use tui::backend::Backend; +use tui::backend::{Backend, CrosstermBackend}; +use tui::layout::*; use tui::style::{Color, Modifier, Style}; use tui::symbols::Marker; -use tui::{backend::CrosstermBackend, layout::*, widgets::*, Frame, Terminal}; +use tui::widgets::*; +use tui::{Frame, Terminal}; #[derive(Options)] struct Opts { diff --git a/amdfand/src/change_mode.rs b/amdfand/src/change_mode.rs index 3c2a229..8b5a295 100644 --- a/amdfand/src/change_mode.rs +++ b/amdfand/src/change_mode.rs @@ -1,7 +1,6 @@ -use gumdrop::Options; - use amdgpu::utils::hw_mons; use amdgpu_config::fan::Config; +use gumdrop::Options; use crate::command::Fan; use crate::{AmdFanError, FanMode}; diff --git a/amdfand/src/command.rs b/amdfand/src/command.rs index 8fd199d..231b96c 100644 --- a/amdfand/src/command.rs +++ b/amdfand/src/command.rs @@ -1,5 +1,3 @@ -use gumdrop::Options; - use amdgpu::hw_mon::HwMon; use amdgpu::utils::{linear_map, load_temp_inputs}; use amdgpu::{ @@ -7,6 +5,7 @@ use amdgpu::{ PULSE_WIDTH_MODULATION_MIN, PULSE_WIDTH_MODULATION_MODE, }; use amdgpu_config::fan::Config; +use gumdrop::Options; use crate::{change_mode, service}; @@ -90,7 +89,8 @@ impl Fan { v.into_iter().map(|hw| Self::wrap(hw, config)).collect() } - /// Change fan speed to given value if it's between minimal and maximal value + /// Change fan speed to given value if it's between minimal and maximal + /// value pub fn set_speed(&mut self, speed: f64) -> crate::Result<()> { let min = self.pwm_min() as f64; let max = self.pwm_max() as f64; @@ -99,15 +99,16 @@ impl Fan { Ok(()) } - /// Change gpu fan speed management to manual (amdfand will manage speed) instead of - /// GPU embedded manager + /// Change gpu fan speed management to manual (amdfand will manage speed) + /// instead of GPU embedded manager pub fn write_manual(&self) -> crate::Result<()> { self.hw_mon_write(MODULATION_ENABLED_FILE, 1) .map_err(FanError::ManualSpeedFailed)?; Ok(()) } - /// Change gpu fan speed management to automatic, speed will be managed by GPU embedded manager + /// Change gpu fan speed management to automatic, speed will be managed by + /// GPU embedded manager pub fn write_automatic(&self) -> crate::Result<()> { self.hw_mon_write("pwm1_enable", 2) .map_err(FanError::AutomaticSpeedFailed)?; @@ -132,8 +133,8 @@ impl Fan { } /// Get maximal GPU temperature from all inputs. - /// This is not recommended since GPU can heat differently in different parts and usually only - /// temp1 should be taken for consideration. + /// This is not recommended since GPU can heat differently in different + /// parts and usually only temp1 should be taken for consideration. pub fn max_gpu_temp(&self) -> crate::Result { if let Some(input) = self.temp_input.as_ref() { let value = self.read_gpu_temp(&input.as_string())?; diff --git a/amdfand/src/main.rs b/amdfand/src/main.rs index 4d5eac1..d209735 100644 --- a/amdfand/src/main.rs +++ b/amdfand/src/main.rs @@ -1,12 +1,9 @@ extern crate log; -use gumdrop::Options; - -use amdgpu::{ - lock_file::PidLock, - utils::{ensure_config_dir, hw_mons}, -}; +use amdgpu::lock_file::PidLock; +use amdgpu::utils::{ensure_config_dir, hw_mons}; use amdgpu_config::fan::{load_config, Config, DEFAULT_FAN_CONFIG_PATH}; +use gumdrop::Options; use crate::command::FanCommand; use crate::error::AmdFanError; diff --git a/amdfand/src/service.rs b/amdfand/src/service.rs index 3cc13f5..00e7589 100644 --- a/amdfand/src/service.rs +++ b/amdfand/src/service.rs @@ -1,13 +1,13 @@ -use gumdrop::Options; - use amdgpu::utils::hw_mons; use amdgpu::{config_reloaded, is_reload_required, listen_unix_signal}; use amdgpu_config::fan::Config; +use gumdrop::Options; use crate::command::Fan; use crate::AmdFanError; -/// Start service which will change fan speed according to config and GPU temperature +/// Start service which will change fan speed according to config and GPU +/// temperature pub fn run(mut config: Config) -> crate::Result<()> { listen_unix_signal(); diff --git a/amdgpu-config/src/fan.rs b/amdgpu-config/src/fan.rs index 3578ab0..7fe4f3e 100644 --- a/amdgpu-config/src/fan.rs +++ b/amdgpu-config/src/fan.rs @@ -28,7 +28,8 @@ impl MatrixPoint { pub struct Config { #[serde(skip)] path: String, - /// One of temperature inputs /sys/class/drm/card{X}/device/hwmon/hwmon{Y}/temp{Z}_input + /// One of temperature inputs + /// /sys/class/drm/card{X}/device/hwmon/hwmon{Y}/temp{Z}_input /// If nothing is provided higher reading will be taken (this is not good!) temp_input: Option, log_level: LogLevel, @@ -242,9 +243,8 @@ pub fn load_config(config_path: &str) -> Result { #[cfg(test)] mod parse_config { - use serde::Deserialize; - use amdgpu::{AmdGpuError, Card, TempInput}; + use serde::Deserialize; #[derive(Deserialize, PartialEq, Eq, Debug)] pub struct Foo { diff --git a/amdgpu-config/src/monitor.rs b/amdgpu-config/src/monitor.rs index 881ec26..065b73f 100644 --- a/amdgpu-config/src/monitor.rs +++ b/amdgpu-config/src/monitor.rs @@ -1,7 +1,6 @@ -use serde::{Deserialize, Serialize}; - use amdgpu::utils::ensure_config; use amdgpu::LogLevel; +use serde::{Deserialize, Serialize}; pub static DEFAULT_MONITOR_CONFIG_PATH: &str = "/etc/amdfand/monitor.toml"; diff --git a/amdgpu/src/error.rs b/amdgpu/src/error.rs index 6e559a0..38242f9 100644 --- a/amdgpu/src/error.rs +++ b/amdgpu/src/error.rs @@ -1,10 +1,12 @@ -#[cfg(feature = "gui-helper")] -use crate::helper_cmd::GuiHelperError; -use crate::lock_file::LockFileError; -use crate::ports::PortsError; -use pidlock::PidlockError; use std::fmt::{Debug, Display, Formatter}; +use pidlock::PidlockError; + +use crate::lock_file::LockFileError; +#[cfg(feature = "gui-helper")] +use crate::pidfile::helper_cmd::GuiHelperError; +use crate::pidfile::ports::PortsError; + pub struct IoFailure { pub io: std::io::Error, pub path: std::path::PathBuf, diff --git a/amdgpu/src/lib.rs b/amdgpu/src/lib.rs index 9cc0917..4b1e551 100644 --- a/amdgpu/src/lib.rs +++ b/amdgpu/src/lib.rs @@ -1,16 +1,14 @@ -use serde::{Deserialize, Serialize}; - pub use card::*; pub use error::*; +use serde::{Deserialize, Serialize}; pub use temp_input::*; mod card; mod error; #[cfg(feature = "gui-helper")] -pub mod helper_cmd; pub mod hw_mon; pub mod lock_file; -pub mod ports; +pub mod pidfile; mod temp_input; pub mod utils; @@ -28,7 +26,9 @@ pub static PULSE_WIDTH_MODULATION_MAX: &str = "pwm1_max"; /// pulse width modulation fan level (0-255) pub static PULSE_WIDTH_MODULATION: &str = "pwm1"; -/// pulse width modulation fan control method (0: no fan speed control, 1: manual fan speed control using pwm interface, 2: automatic fan speed control) +/// pulse width modulation fan control method (0: no fan speed control, 1: +/// manual fan speed control using pwm interface, 2: automatic fan speed +/// control) pub static PULSE_WIDTH_MODULATION_MODE: &str = "pwm1_enable"; // static PULSE_WIDTH_MODULATION_DISABLED: &str = "0"; diff --git a/amdgpu/src/lock_file.rs b/amdgpu/src/lock_file.rs index 588c68b..9c2d346 100644 --- a/amdgpu/src/lock_file.rs +++ b/amdgpu/src/lock_file.rs @@ -1,11 +1,13 @@ //! Create lock file and prevent running 2 identical services. //! NOTE: For 2 amdfand services you may just give 2 different names -use crate::helper_cmd::Pid; -use crate::IoFailure; -use nix::libc; use std::path::Path; +use nix::libc; + +use crate::pidfile::Pid; +use crate::IoFailure; + #[derive(Debug, thiserror::Error)] pub enum LockFileError { #[error("Failed to read {path}. {err:?}")] @@ -56,7 +58,8 @@ impl PidLock { /// Create new lock file. File will be created if: /// * pid file does not exists /// * pid file exists but process is dead - /// * old pid and current pid have different names (lock file exists after reboot and PID was taken by other process) + /// * old pid and current pid have different names (lock file exists after + /// reboot and PID was taken by other process) pub fn acquire(&mut self) -> Result<(), crate::error::AmdGpuError> { log::debug!("PID LOCK acquiring {}", self.pid_path); let pid = self.process_pid(); @@ -84,7 +87,7 @@ impl PidLock { log::warn!("Conflicting {} and {} for process {}", old.0, pid.0, name); return Err(LockFileError::Conflict { pid: old, name }.into()); } - Ok(name /*name isn't the same*/) => { + Ok(name /* name isn't the same */) => { log::debug!( "Old process {:?} and current process {:?} have different names, overriding....", name, self.name diff --git a/amdgpu/src/helper_cmd.rs b/amdgpu/src/pidfile/helper_cmd.rs similarity index 87% rename from amdgpu/src/helper_cmd.rs rename to amdgpu/src/pidfile/helper_cmd.rs index a369d78..f86275f 100644 --- a/amdgpu/src/helper_cmd.rs +++ b/amdgpu/src/pidfile/helper_cmd.rs @@ -1,9 +1,10 @@ //! AMD GUI helper communication toolkit use std::io::{Read, Write}; -use std::ops::Deref; use std::os::unix::net::UnixStream; +use crate::pidfile::{Pid, PidResponse}; + #[derive(Debug, thiserror::Error)] pub enum GuiHelperError { #[error("GUI Helper socket file not found. Is service running?")] @@ -14,18 +15,6 @@ pub enum GuiHelperError { Serialize(#[from] ron::Error), } -#[derive(Debug, Copy, Clone, serde::Serialize, serde::Deserialize)] -#[serde(transparent)] -pub struct Pid(pub i32); - -impl Deref for Pid { - type Target = i32; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - #[derive(Debug, serde::Serialize, serde::Deserialize)] pub enum Command { ReloadConfig { pid: Pid }, @@ -41,6 +30,12 @@ pub enum Response { ConfigFileSaveFailed(String), } +impl PidResponse for Response { + fn kill_response() -> Self { + Self::NoOp + } +} + pub fn sock_file() -> std::path::PathBuf { std::path::Path::new("/tmp").join("amdgui-helper.sock") } diff --git a/amdgpu/src/pidfile/mod.rs b/amdgpu/src/pidfile/mod.rs new file mode 100644 index 0000000..e7b6095 --- /dev/null +++ b/amdgpu/src/pidfile/mod.rs @@ -0,0 +1,133 @@ +use std::fmt::Debug; +use std::io::{Read, Write}; +use std::marker::PhantomData; +use std::net::Shutdown; +use std::ops::Deref; +use std::os::unix::net::UnixStream; + +use serde::de::DeserializeOwned; +use serde::Serialize; + +pub mod helper_cmd; +pub mod ports; + +#[derive(Debug, Copy, Clone, serde::Serialize, serde::Deserialize)] +#[serde(transparent)] +pub struct Pid(pub i32); + +impl Deref for Pid { + type Target = i32; + + fn deref(&self) -> &Self::Target { + &self.0 + } +} + +pub fn handle_connection(stream: UnixStream, handle_command: HandleCmd) +where + HandleCmd: FnOnce(Service, Cmd) + Copy, + Cmd: DeserializeOwned + Serialize + Debug, + Res: DeserializeOwned + Serialize + Debug + PidResponse, +{ + let mut service = Service::::new(stream); + + let command = match service.read_command() { + Some(s) => s, + _ => return service.kill(), + }; + + log::info!("Incoming {:?}", command); + let cmd = match ron::from_str::(command.trim()) { + Ok(cmd) => cmd, + Err(e) => { + log::warn!("Invalid message {:?}. {:?}", command, e); + return service.kill(); + } + }; + handle_command(service, cmd); +} + +pub trait PidResponse: Sized { + fn kill_response() -> Self; +} + +pub struct Service(UnixStream, PhantomData) +where + Response: serde::Serialize + Debug + PidResponse; + +impl Service +where + Response: serde::Serialize + Debug + PidResponse, +{ + pub fn new(file: UnixStream) -> Self { + Self(file, Default::default()) + } + + /// Serialize and send command + pub fn write_response(&mut self, res: Response) { + write_response(&mut self.0, res) + } + + /// Read from `.sock` file new line separated commands + pub fn read_command(&mut self) -> Option { + read_command(&mut self.0) + } + + /// Close connection with no operation response + pub fn kill(mut self) { + self.write_response(Response::kill_response()); + self.close(); + } + + pub fn close(self) { + let _ = self.0.shutdown(Shutdown::Both); + } +} + +/// Serialize and send command +pub fn write_response(file: &mut UnixStream, res: Response) +where + Response: serde::Serialize + Debug, +{ + match ron::to_string(&res) { + Ok(buffer) => match file.write_all(buffer.as_bytes()) { + Ok(_) => { + log::info!("Response successfully written") + } + Err(e) => log::warn!("Failed to write response. {:?}", e), + }, + Err(e) => { + log::warn!("Failed to serialize response {:?}. {:?}", res, e) + } + } +} + +/// Read from `.sock` file new line separated commands +pub fn read_command(file: &mut UnixStream) -> Option { + let mut command = String::with_capacity(100); + log::info!("Reading stream..."); + read_line(file, &mut command); + if command.is_empty() { + return None; + } + Some(command) +} + +pub fn read_line(stream: &mut UnixStream, command: &mut String) { + let mut buffer = [0]; + while stream.read_exact(&mut buffer).is_ok() { + if buffer[0] == b'\n' { + break; + } + match std::str::from_utf8(&buffer) { + Ok(s) => { + command.push_str(s); + } + Err(e) => { + log::error!("Failed to read from client. {:?}", e); + let _ = stream.shutdown(Shutdown::Both); + continue; + } + } + } +} diff --git a/amdgpu/src/ports.rs b/amdgpu/src/pidfile/ports.rs similarity index 92% rename from amdgpu/src/ports.rs rename to amdgpu/src/pidfile/ports.rs index 3d0b17e..d232ad0 100644 --- a/amdgpu/src/ports.rs +++ b/amdgpu/src/pidfile/ports.rs @@ -1,12 +1,13 @@ //! AMD GUI helper communication toolkit use std::io::{Read, Write}; -use std::ops::Deref; use std::os::unix::net::UnixStream; use std::path::PathBuf; use serde::{Deserialize, Serialize}; +use crate::pidfile::PidResponse; + #[derive(Debug, thiserror::Error)] pub enum PortsError { #[error("AMD GPU ports socket file not found. Is service running?")] @@ -74,18 +75,6 @@ impl Output { } } -#[derive(Debug, Copy, Clone, serde::Serialize, serde::Deserialize)] -#[serde(transparent)] -pub struct Pid(pub i32); - -impl Deref for Pid { - type Target = i32; - - fn deref(&self) -> &Self::Target { - &self.0 - } -} - #[derive(Debug, serde::Serialize, serde::Deserialize)] pub enum Command { Ports, @@ -97,6 +86,12 @@ pub enum Response { NoOp, } +impl PidResponse for Response { + fn kill_response() -> Self { + Self::NoOp + } +} + pub fn sock_file() -> PathBuf { std::path::Path::new("/tmp").join("amdgpu-ports.sock") } diff --git a/amdgpu/src/temp_input.rs b/amdgpu/src/temp_input.rs index 7656b25..8cbd36b 100644 --- a/amdgpu/src/temp_input.rs +++ b/amdgpu/src/temp_input.rs @@ -1,6 +1,7 @@ -use crate::AmdGpuError; use serde::Serializer; +use crate::AmdGpuError; + #[derive(PartialEq, Eq, Debug, Copy, Clone)] pub struct TempInput(pub u16); diff --git a/amdgui-helper/src/main.rs b/amdgui-helper/src/main.rs index 8753520..3cfd742 100644 --- a/amdgui-helper/src/main.rs +++ b/amdgui-helper/src/main.rs @@ -1,23 +1,26 @@ -//! Special daemon with root privileges. Since GUI should not have (and sometimes can't have) root -//! privileges and service processes are designed to be as small as possible this is proxy. +//! Special daemon with root privileges. Since GUI should not have (and +//! sometimes can't have) root privileges and service processes are designed to +//! be as small as possible this is proxy. //! //! It is responsible for: -//! * Loading all amdfand processes. In order to do this process needs to be killed with signal 0 to check if it still is alive +//! * Loading all amdfand processes. In order to do this process needs to be +//! killed with signal 0 to check if it still is alive //! * Reload amdfand process with signal SIGHUP //! * Save changed config file //! -//! It is using `/tmp/amdgui-helper.sock` file and `ron` serialization for communication. -//! After each operation connection is terminated so each command needs new connection. +//! It is using `/tmp/amdgui-helper.sock` file and `ron` serialization for +//! communication. After each operation connection is terminated so each command +//! needs new connection. #![allow(clippy::non_octal_unix_permissions)] -use amdgpu::helper_cmd::{Command, Pid, Response}; -use amdgpu::IoFailure; use std::ffi::OsStr; use std::fs::Permissions; -use std::io::{Read, Write}; -use std::net::Shutdown; use std::os::unix::fs::PermissionsExt; -use std::os::unix::net::{UnixListener, UnixStream}; +use std::os::unix::net::UnixListener; + +use amdgpu::pidfile::helper_cmd::{Command, Response}; +use amdgpu::pidfile::{handle_connection, Pid}; +use amdgpu::IoFailure; #[derive(Debug, thiserror::Error)] pub enum Error { @@ -38,7 +41,7 @@ fn main() -> Result<()> { let mut lock = amdgpu::lock_file::PidLock::new("amdgui", String::from("helper"))?; lock.acquire()?; - let sock_path = amdgpu::helper_cmd::sock_file(); + let sock_path = amdgpu::pidfile::helper_cmd::sock_file(); let listener = { let _ = std::fs::remove_file(&sock_path); @@ -52,86 +55,27 @@ fn main() -> Result<()> { } while let Ok((stream, _addr)) = listener.accept() { - handle_connection(stream); + handle_connection::<_, Command, Response>(stream, handle_command); } lock.release()?; Ok(()) } -pub struct Service(UnixStream); +pub type Service = amdgpu::pidfile::Service; -impl Service { - /// Serialize and send command - pub fn write_response(&mut self, res: amdgpu::helper_cmd::Response) { - match ron::to_string(&res) { - Ok(buffer) => match self.0.write_all(buffer.as_bytes()) { - Ok(_) => { - log::info!("Response successfully written") - } - Err(e) => log::warn!("Failed to write response. {:?}", e), - }, - Err(e) => { - log::warn!("Failed to serialize response {:?}. {:?}", res, e) - } - } - } - - /// Read from `.sock` file new line separated commands - pub fn read_command(&mut self) -> Option { - let mut command = String::with_capacity(100); - log::info!("Reading stream..."); - read_line(&mut self.0, &mut command); - if command.is_empty() { - return None; - } - Some(command) - } - - /// Close connection with no operation response - pub fn kill(mut self) { - self.write_response(Response::NoOp); - self.close(); - } - - pub fn close(self) { - let _ = self.0.shutdown(Shutdown::Both); - } -} - -fn handle_connection(stream: UnixStream) { - let mut service = Service(stream); - - let command = match service.read_command() { - Some(s) => s, - _ => return service.kill(), - }; - - log::info!("Incoming {:?}", command); - let cmd = match ron::from_str::(command.trim()) { - Ok(cmd) => cmd, - Err(e) => { - log::warn!("Invalid message {:?}. {:?}", command, e); - return service.kill(); - } - }; - handle_command(service, cmd); -} - -fn handle_command(mut service: Service, cmd: Command) { +fn handle_command(service: Service, cmd: Command) { match cmd { Command::ReloadConfig { pid } => { log::info!("Reloading config file for pid {:?}", pid); handle_reload_config(service, pid); } Command::FanServices => handle_fan_services(service), - Command::SaveFanConfig { path, content } => { - handle_save_fan_config(&mut service, path, content) - } + Command::SaveFanConfig { path, content } => handle_save_fan_config(service, path, content), } } -fn handle_save_fan_config(service: &mut Service, path: String, content: String) { +fn handle_save_fan_config(mut service: Service, path: String, content: String) { match std::fs::write(path, content) { Err(e) => service.write_response(Response::ConfigFileSaveFailed(format!("{:?}", e))), Ok(..) => service.write_response(Response::ConfigFileSaved), @@ -145,25 +89,6 @@ fn handle_fan_services(mut service: Service) { service.write_response(Response::Services(services)); } -fn read_line(stream: &mut UnixStream, command: &mut String) { - let mut buffer = [0]; - while stream.read_exact(&mut buffer).is_ok() { - if buffer[0] == b'\n' { - break; - } - match std::str::from_utf8(&buffer) { - Ok(s) => { - command.push_str(s); - } - Err(e) => { - log::error!("Failed to read from client. {:?}", e); - let _ = stream.shutdown(Shutdown::Both); - continue; - } - } - } -} - fn handle_reload_config(service: Service, pid: Pid) { unsafe { nix::libc::kill(pid.0, nix::sys::signal::Signal::SIGHUP as i32); diff --git a/amdguid/Cargo.toml b/amdguid/Cargo.toml index 13522aa..b7c6dfe 100644 --- a/amdguid/Cargo.toml +++ b/amdguid/Cargo.toml @@ -40,28 +40,31 @@ gumdrop = { version = "0.8" } log = { version = "0.4" } pretty_env_logger = { version = "0.4" } -egui = { version = "0.15", optional = true } -epaint = { version = "0.15", features = ["serialize"], optional = true } -epi = { version = "0.15", optional = true } -winit = { version = "0.25", optional = true } -egui-winit = { version = "0.15", optional = true } +egui = { version = "0.18", optional = true, features = [] } +epaint = { version = "0.18", features = [], optional = true } +epi = { version = "0.17.0", optional = true } +winit = { version = "0.26", optional = true } +egui-winit = { version = "0.18", optional = true } # vulkan -egui_vulkano = { version = "0.4", optional = true } -vulkano-win = { version = "0.25", optional = true } -vulkano = { version = "0.25", optional = true } -vulkano-shaders = { version = "0.25", optional = true } +egui_vulkano = { version = "0.8.0", optional = true } +vulkano-win = { version = "0.29.0", optional = true } +vulkano = { version = "0.29.0", optional = true } +vulkano-shaders = { version = "0.29.0", optional = true } +bytemuck = { version = "*" } # xorg glium -glium = { version = "0.30", optional = true } -egui_glium = { version = "0.15", optional = true } +glium = { version = "0.32.1", optional = true } +egui_glium = { version = "0.18.0", optional = true } # xorg glow -glutin = { version = "0.27", optional = true } +glutin = { version = "0.29", optional = true } glow = { version = "0.11", optional = true } -egui_glow = { version = "0.15", optional = true } +egui_glow = { version = "0.18", optional = true } tokio = { version = "1.15", features = ["full"] } -parking_lot = { version = "0.11" } +parking_lot = { version = "0.12" } -nix = { version = "0.24" } +nix = { version = "0.25" } + +image = { version = "0.24.2" } [dev-dependencies] amdgpu = { path = "../amdgpu", version = "1.0", features = ["gui-helper"] } diff --git a/amdguid/assets/icons/html_port-512.png b/amdguid/assets/icons/html_port-512.png new file mode 100644 index 0000000..8819ee3 Binary files /dev/null and b/amdguid/assets/icons/html_port-512.png differ diff --git a/amdguid/assets/icons/ports.jpg b/amdguid/assets/icons/ports.jpg new file mode 100644 index 0000000..c1e5d3f Binary files /dev/null and b/amdguid/assets/icons/ports.jpg differ diff --git a/amdguid/assets/icons/vga_port-512.png b/amdguid/assets/icons/vga_port-512.png new file mode 100644 index 0000000..3f79ee6 Binary files /dev/null and b/amdguid/assets/icons/vga_port-512.png differ diff --git a/amdguid/src/app.rs b/amdguid/src/app.rs index 13ee593..046f6e6 100644 --- a/amdguid/src/app.rs +++ b/amdguid/src/app.rs @@ -1,10 +1,14 @@ -use crate::widgets::{ChangeFanSettings, CoolingPerformance}; -use amdgpu::helper_cmd::Pid; -use egui::{CtxRef, Ui}; +use std::collections::{BTreeMap, HashMap}; +use std::sync::Arc; + +use amdgpu::pidfile::ports::Output; +use amdgpu::pidfile::Pid; +use egui::Ui; use epi::Frame; use parking_lot::Mutex; -use std::collections::HashMap; -use std::sync::Arc; + +use crate::widgets::outputs_settings::OutputsSettings; +use crate::widgets::{ChangeFanSettings, CoolingPerformance}; pub enum ChangeState { New, @@ -61,6 +65,7 @@ impl From> for FanServices { pub enum Page { Config, Monitoring, + Outputs, Settings, } @@ -85,14 +90,16 @@ pub struct StatefulConfig { pub struct AmdGui { pub page: Page, pid_files: FanServices, + outputs: BTreeMap>, cooling_performance: CoolingPerformance, change_fan_settings: ChangeFanSettings, + outputs_settings: OutputsSettings, config: StatefulConfig, reload_pid_list_delay: u8, } impl epi::App for AmdGui { - fn update(&mut self, _ctx: &CtxRef, _frame: &mut Frame<'_>) {} + fn update(&mut self, _ctx: &epi::egui::Context, _frame: &Frame) {} fn name(&self) -> &str { "AMD GUI" @@ -104,8 +111,10 @@ impl AmdGui { Self { page: Default::default(), pid_files: FanServices::from(vec![]), + outputs: Default::default(), cooling_performance: CoolingPerformance::new(100, config.clone()), change_fan_settings: ChangeFanSettings::new(config.clone()), + outputs_settings: OutputsSettings::default(), config: StatefulConfig { config, state: ChangeState::New, @@ -124,6 +133,10 @@ impl AmdGui { self.cooling_performance.draw(ui, &self.pid_files); } Page::Settings => {} + Page::Outputs => { + self.outputs_settings + .draw(ui, &mut self.config, &self.outputs); + } } } @@ -131,20 +144,71 @@ impl AmdGui { self.cooling_performance.tick(); if self.pid_files.0.is_empty() || self.reload_pid_list_delay.checked_sub(1).is_none() { self.reload_pid_list_delay = RELOAD_PID_LIST_DELAY; - match amdgpu::helper_cmd::send_command(amdgpu::helper_cmd::Command::FanServices) { - Ok(amdgpu::helper_cmd::Response::Services(services)) - if self.pid_files.list_changed(&services) => - { - self.pid_files = FanServices::from(services); + + { + use amdgpu::pidfile::helper_cmd::{send_command, Command, Response}; + + match send_command(Command::FanServices) { + Ok(Response::Services(services)) if self.pid_files.list_changed(&services) => { + self.pid_files = FanServices::from(services); + } + Ok(Response::Services(_services)) => { + // SKIP + } + Ok(res) => { + log::warn!("Unexpected response {:?} while loading fan services", res); + } + Err(e) => { + log::warn!("Failed to load amd fan services pid list. {:?}", e); + } } - Ok(amdgpu::helper_cmd::Response::Services(_services)) => { - // SKIP - } - Ok(res) => { - log::warn!("Unexpected response {:?} while loading fan services", res); - } - Err(e) => { - log::warn!("Failed to load amd fan services pid list. {:?}", e); + } + + { + use amdgpu::pidfile::ports::{send_command, Command, Response}; + + match send_command(Command::Ports) { + Ok(Response::NoOp) => {} + Ok(Response::Ports(outputs)) => { + let mut names = outputs.iter().fold( + Vec::with_capacity(outputs.len()), + |mut set, output| { + set.push(format!("{}", output.card)); + set + }, + ); + names.sort(); + + let mut tree = BTreeMap::new(); + names.into_iter().for_each(|name| { + tree.insert(name, Vec::with_capacity(6)); + }); + + self.outputs = outputs.into_iter().fold(tree, |mut agg, output| { + let v = agg + .entry(output.card.clone()) + .or_insert_with(|| Vec::with_capacity(6)); + v.push(output); + v.sort_by(|a, b| { + format!( + "{}{}{}", + a.port_type, + a.port_name.as_deref().unwrap_or_default(), + a.port_number, + ) + .cmp(&format!( + "{}{}{}", + b.port_type, + b.port_name.as_deref().unwrap_or_default(), + b.port_number, + )) + }); + agg + }); + } + Err(e) => { + log::warn!("Failed to load amd fan services pid list. {:?}", e); + } } } } else { diff --git a/amdguid/src/backend/glium_backend.rs b/amdguid/src/backend/glium_backend.rs index a0ca948..40e987c 100644 --- a/amdguid/src/backend/glium_backend.rs +++ b/amdguid/src/backend/glium_backend.rs @@ -1,10 +1,11 @@ -use parking_lot::Mutex; use std::sync::Arc; + +use glium::glutin; +use parking_lot::Mutex; use tokio::sync::mpsc::UnboundedReceiver; use crate::app::AmdGui; use crate::backend::create_ui; -use glium::glutin; fn create_display(event_loop: &glutin::event_loop::EventLoop<()>) -> glium::Display { let window_builder = glutin::window::WindowBuilder::new() diff --git a/amdguid/src/backend/glow_backend.rs b/amdguid/src/backend/glow_backend.rs index 7cbdc9d..69c464d 100644 --- a/amdguid/src/backend/glow_backend.rs +++ b/amdguid/src/backend/glow_backend.rs @@ -108,7 +108,9 @@ pub fn run_app(amd_gui: Arc>, mut receiver: UnboundedReceiver { egui.destroy(&gl); diff --git a/amdguid/src/backend/mod.rs b/amdguid/src/backend/mod.rs index 9a4273e..4deda97 100644 --- a/amdguid/src/backend/mod.rs +++ b/amdguid/src/backend/mod.rs @@ -5,39 +5,52 @@ pub mod glow_backend; #[cfg(feature = "wayland")] pub mod wayland_backend; +use std::sync::Arc; + use egui::panel::TopBottomSide; use egui::{Layout, PointerButton}; -use epaint::TextStyle; +#[cfg(feature = "xorg-glium")] +pub use glium_backend::run_app; +#[cfg(feature = "xorg-glow")] +pub use glow_backend::run_app; use parking_lot::Mutex; -use std::sync::Arc; #[cfg(feature = "wayland")] pub use wayland_backend::run_app; -#[cfg(feature = "xorg-glow")] -pub use glow_backend::run_app; - use crate::app::Page; use crate::AmdGui; -#[cfg(feature = "xorg-glium")] -pub use glium_backend::run_app; -pub fn create_ui(amd_gui: Arc>, ctx: &egui::CtxRef) { +pub fn create_ui(amd_gui: Arc>, ctx: &egui::Context) { egui::containers::TopBottomPanel::new(TopBottomSide::Top, "menu").show(ctx, |ui| { let mut child = ui.child_ui(ui.available_rect_before_wrap(), Layout::left_to_right()); if child - .add(egui::Button::new("Config").text_style(TextStyle::Heading)) + .add( + egui::Button::new("Outputs"), /* .text_style(TextStyle::Heading) */ + ) + .clicked_by(PointerButton::Primary) + { + amd_gui.lock().page = Page::Outputs; + } + if child + .add( + egui::Button::new("Config"), /* .text_style(TextStyle::Heading) */ + ) .clicked_by(PointerButton::Primary) { amd_gui.lock().page = Page::Config; } if child - .add(egui::Button::new("Monitoring").text_style(TextStyle::Heading)) + .add( + egui::Button::new("Monitoring"), /* .text_style(TextStyle::Heading) */ + ) .clicked_by(PointerButton::Primary) { amd_gui.lock().page = Page::Monitoring; } if child - .add(egui::Button::new("Settings").text_style(TextStyle::Heading)) + .add( + egui::Button::new("Settings"), /* .text_style(TextStyle::Heading) */ + ) .clicked_by(PointerButton::Primary) { amd_gui.lock().page = Page::Settings; @@ -54,6 +67,9 @@ pub fn create_ui(amd_gui: Arc>, ctx: &egui::CtxRef) { Page::Monitoring => { gui.ui(ui); } + Page::Outputs => { + gui.ui(ui); + } Page::Settings => { ctx.settings_ui(ui); } diff --git a/amdguid/src/backend/wayland_backend.rs b/amdguid/src/backend/wayland_backend.rs index f03bbae..d3acf3f 100644 --- a/amdguid/src/backend/wayland_backend.rs +++ b/amdguid/src/backend/wayland_backend.rs @@ -1,112 +1,156 @@ -use crate::app::AmdGui; -use crate::backend::create_ui; -use parking_lot::Mutex; +use std::convert::{TryFrom, TryInto}; use std::sync::Arc; + +use bytemuck::{Pod, Zeroable}; +use egui_vulkano::UpdateTexturesResult; +use parking_lot::Mutex; use tokio::sync::mpsc::UnboundedReceiver; -use vulkano::buffer::{BufferUsage, CpuAccessibleBuffer}; -use vulkano::command_buffer::{ - AutoCommandBufferBuilder, CommandBufferUsage, DynamicState, SubpassContents, -}; +use vulkano::buffer::{BufferUsage, CpuAccessibleBuffer, TypedBufferAccess}; +use vulkano::command_buffer::{AutoCommandBufferBuilder, CommandBufferUsage, SubpassContents}; +use vulkano::device::physical::{PhysicalDevice, PhysicalDeviceType}; +use vulkano::device::{Device, DeviceCreateInfo, DeviceExtensions, QueueCreateInfo}; use vulkano::format::Format; use vulkano::image::view::ImageView; -use vulkano::image::{ImageUsage, SwapchainImage}; -use vulkano::render_pass::{Framebuffer, FramebufferAbstract, RenderPass, Subpass}; -use vulkano::swapchain::{AcquireError, ColorSpace, Swapchain, SwapchainCreationError}; -use vulkano::sync::{FlushError, GpuFuture}; -use vulkano::{swapchain, sync, Version}; +use vulkano::image::{ImageAccess, ImageUsage, SwapchainImage}; +use vulkano::instance::{Instance, InstanceCreateInfo}; +use vulkano::pipeline::graphics::input_assembly::InputAssemblyState; +use vulkano::pipeline::graphics::vertex_input::BuffersDefinition; +use vulkano::pipeline::graphics::viewport::{Viewport, ViewportState}; +use vulkano::pipeline::GraphicsPipeline; +use vulkano::render_pass::{Framebuffer, FramebufferCreateInfo, RenderPass, Subpass}; +use vulkano::swapchain::{AcquireError, Swapchain, SwapchainCreateInfo, SwapchainCreationError}; +use vulkano::sync::{FenceSignalFuture, FlushError, GpuFuture}; +use vulkano::{swapchain, sync}; use vulkano_win::VkSurfaceBuild; -use winit::dpi::PhysicalSize; use winit::event::{Event, WindowEvent}; -use winit::event_loop::ControlFlow; -use winit::window::Window; +use winit::event_loop::{ControlFlow, EventLoop}; +use winit::window::{Fullscreen, Window, WindowBuilder}; -pub mod vs { - vulkano_shaders::shader! { - ty: "vertex", - src: " - #version 450 - layout(location = 0) in vec2 position; - void main() { - gl_Position = vec4(position, 0.0, 1.0); - } - " - } -} +use crate::app::AmdGui; +use crate::backend::create_ui; -pub mod fs { - vulkano_shaders::shader! { - ty: "fragment", - src: " - #version 450 - layout(location = 0) out vec4 f_color; - void main() { - f_color = vec4(1.0, 0.0, 0.0, 1.0); - } - " - } -} - -#[derive(Default, Debug, Clone)] +#[repr(C)] +#[derive(Clone, Copy, Debug, Default, Zeroable, Pod)] struct Vertex { position: [f32; 2], + color: [f32; 4], +} + +pub enum FrameEndFuture { + FenceSignalFuture(FenceSignalFuture), + BoxedFuture(Box), +} + +impl FrameEndFuture { + pub fn now(device: Arc) -> Self { + Self::BoxedFuture(sync::now(device).boxed()) + } + + pub fn get(self) -> Box { + match self { + FrameEndFuture::FenceSignalFuture(f) => f.boxed(), + FrameEndFuture::BoxedFuture(f) => f, + } + } +} + +impl AsMut for FrameEndFuture { + fn as_mut(&mut self) -> &mut (dyn GpuFuture + 'static) { + match self { + FrameEndFuture::FenceSignalFuture(f) => f, + FrameEndFuture::BoxedFuture(f) => f, + } + } } pub fn run_app(amd_gui: Arc>, _receiver: UnboundedReceiver) { let required_extensions = vulkano_win::required_extensions(); - let instance = - vulkano::instance::Instance::new(None, Version::V1_0, &required_extensions, None).unwrap(); - let physical = vulkano::device::physical::PhysicalDevice::enumerate(&instance) - .next() - .unwrap(); + let instance = Instance::new(InstanceCreateInfo { + enabled_extensions: required_extensions, + ..Default::default() + }) + .unwrap(); - let event_loop = winit::event_loop::EventLoop::new(); - let surface = winit::window::WindowBuilder::new() - .with_inner_size(PhysicalSize::new(1024, 768)) - .with_title("AMD GUI") + let physical = PhysicalDevice::enumerate(&instance).next().unwrap(); + + println!( + "Using device: {} (type: {:?})", + physical.properties().device_name, + physical.properties().device_type, + ); + + let event_loop = EventLoop::new(); + let surface = WindowBuilder::new() + .with_title("egui_vulkano demo") + .with_fullscreen(Some(Fullscreen::Borderless(None))) .build_vk_surface(&event_loop, instance.clone()) .unwrap(); - // vulkan - let queue_family = physical - .queue_families() - .find(|&q| q.supports_graphics() && surface.is_supported(q).unwrap_or(false)) + let device_extensions = DeviceExtensions { + khr_swapchain: true, + ..DeviceExtensions::none() + }; + + let (physical_device, queue_family) = PhysicalDevice::enumerate(&instance) + .filter(|&p| p.supported_extensions().is_superset_of(&device_extensions)) + .filter_map(|p| { + p.queue_families() + .find(|&q| q.supports_graphics() && q.supports_surface(&surface).unwrap_or(false)) + .map(|q| (p, q)) + }) + .min_by_key(|(p, _)| match p.properties().device_type { + PhysicalDeviceType::DiscreteGpu => 0, + PhysicalDeviceType::IntegratedGpu => 1, + PhysicalDeviceType::VirtualGpu => 2, + PhysicalDeviceType::Cpu => 3, + PhysicalDeviceType::Other => 4, + }) .unwrap(); - let device_ext = vulkano::device::DeviceExtensions { - khr_swapchain: true, - ..vulkano::device::DeviceExtensions::none() - }; - let (device, mut queues) = vulkano::device::Device::new( - physical, - physical.supported_features(), - &device_ext, - [(queue_family, 0.5)].iter().cloned(), + let (device, mut queues) = Device::new( + physical_device, + DeviceCreateInfo { + enabled_extensions: physical_device + .required_extensions() + .union(&device_extensions), + queue_create_infos: vec![QueueCreateInfo::family(queue_family)], + ..Default::default() + }, ) .unwrap(); let queue = queues.next().unwrap(); let (mut swapchain, images) = { - let caps = surface.capabilities(physical).unwrap(); - let alpha = caps.supported_composite_alpha.iter().next().unwrap(); + let caps = physical_device + .surface_capabilities(&surface, Default::default()) + .unwrap(); + let composite_alpha = caps.supported_composite_alpha.iter().next().unwrap(); - assert!(&caps - .supported_formats - .contains(&(Format::B8G8R8A8Srgb, ColorSpace::SrgbNonLinear))); - let format = Format::B8G8R8A8Srgb; - let dimensions: [u32; 2] = surface.window().inner_size().into(); + let image_format = Some(Format::B8G8R8A8_SRGB); + let image_extent: [u32; 2] = surface.window().inner_size().into(); - Swapchain::start(device.clone(), surface.clone()) - .num_images(caps.min_image_count) - .format(format) - .dimensions(dimensions) - .usage(ImageUsage::color_attachment()) - .sharing_mode(&queue) - .composite_alpha(alpha) - .build() - .unwrap() + Swapchain::new( + device.clone(), + surface.clone(), + SwapchainCreateInfo { + min_image_count: caps.min_image_count, + image_format, + image_extent, + image_usage: ImageUsage::color_attachment(), + composite_alpha, + + ..Default::default() + }, + ) + .unwrap() }; + #[derive(Default, Debug, Clone, Copy, Pod, Zeroable)] + #[repr(C)] + struct Vertex { + position: [f32; 2], + } vulkano::impl_vertex!(Vertex, position); let vertex_buffer = { @@ -131,59 +175,82 @@ pub fn run_app(amd_gui: Arc>, _receiver: UnboundedReceiver) .unwrap() }; - let vs = vs::Shader::load(device.clone()).unwrap(); - let fs = fs::Shader::load(device.clone()).unwrap(); + mod vs { + vulkano_shaders::shader! { + ty: "vertex", + src: " + #version 450 - let render_pass = Arc::new( - vulkano::ordered_passes_renderpass!( - device.clone(), - attachments: { - color: { - load: Clear, - store: Store, - format: swapchain.format(), - samples: 1, - } - }, - passes: [ - { color: [color], depth_stencil: {}, input: [] }, - { color: [color], depth_stencil: {}, input: [] } // Create a second render pass to draw egui - ] - ) - .unwrap(), - ); + layout(location = 0) in vec2 position; - let pipeline = Arc::new( - vulkano::pipeline::GraphicsPipeline::start() - .vertex_input_single_buffer::() - .vertex_shader(vs.main_entry_point(), ()) - .triangle_list() - .viewports_dynamic_scissors_irrelevant(1) - .fragment_shader(fs.main_entry_point(), ()) - .render_pass(Subpass::from(render_pass.clone(), 0).unwrap()) - .build(device.clone()) - .unwrap(), - ); + void main() { + gl_Position = vec4(position, 0.0, 1.0); + } + " + } + } - let mut dynamic_state = DynamicState { - line_width: None, - viewports: None, - scissors: None, - compare_mask: None, - write_mask: None, - reference: None, + mod fs { + vulkano_shaders::shader! { + ty: "fragment", + src: " + #version 450 + + layout(location = 0) out vec4 f_color; + + void main() { + f_color = vec4(1.0, 0.0, 0.0, 1.0); + } + " + } + } + + let vs = vs::load(device.clone()).unwrap(); + let fs = fs::load(device.clone()).unwrap(); + + let render_pass = vulkano::ordered_passes_renderpass!( + device.clone(), + attachments: { + color: { + load: Clear, + store: Store, + format: swapchain.image_format(), + samples: 1, + } + }, + passes: [ + { color: [color], depth_stencil: {}, input: [] }, + { color: [color], depth_stencil: {}, input: [] } // Create a second renderpass to draw egui + ] + ) + .unwrap(); + + let pipeline = GraphicsPipeline::start() + .vertex_input_state(BuffersDefinition::new().vertex::()) + .vertex_shader(vs.entry_point("main").unwrap(), ()) + .input_assembly_state(InputAssemblyState::new()) + .viewport_state(ViewportState::viewport_dynamic_scissor_irrelevant()) + .fragment_shader(fs.entry_point("main").unwrap(), ()) + .render_pass(Subpass::from(render_pass.clone().into(), 0).unwrap()) + .build(device.clone()) + .unwrap(); + + let mut viewport = Viewport { + origin: [0.0, 0.0], + dimensions: [0.0, 0.0], + depth_range: 0.0..1.0, }; - let mut framebuffers = - window_size_dependent_setup(&images, render_pass.clone(), &mut dynamic_state); + let mut framebuffers = window_size_dependent_setup(&images, render_pass.clone(), &mut viewport); - let mut recreate_swap_chain = false; + let mut recreate_swapchain = false; - let mut previous_frame_end = Some(sync::now(device.clone()).boxed()); + let mut previous_frame_end = Some(FrameEndFuture::now(device.clone())); + //Set up everything need to draw the gui let window = surface.window(); - let mut egui_ctx = egui::CtxRef::default(); - let mut egui_winit = egui_winit::State::new(window); + let egui_ctx = egui::Context::default(); + let mut egui_winit = egui_winit::State::new(4096, window); let mut egui_painter = egui_vulkano::Painter::new( device.clone(), @@ -192,6 +259,11 @@ pub fn run_app(amd_gui: Arc>, _receiver: UnboundedReceiver) ) .unwrap(); + //Set up some window to look at for the test + + // let mut my_texture = egui_ctx.load_texture("my_texture", + // ColorImage::example()); + event_loop.run(move |event, _, control_flow| { match event { Event::WindowEvent { @@ -204,7 +276,7 @@ pub fn run_app(amd_gui: Arc>, _receiver: UnboundedReceiver) event: WindowEvent::Resized(_), .. } => { - recreate_swap_chain = true; + recreate_swapchain = true; } Event::WindowEvent { event, .. } => { let egui_consumed_event = egui_winit.on_event(&egui_ctx, &event); @@ -212,39 +284,47 @@ pub fn run_app(amd_gui: Arc>, _receiver: UnboundedReceiver) // do your own event handling here }; } - Event::UserEvent(_) | Event::RedrawEventsCleared => { - previous_frame_end.as_mut().unwrap().cleanup_finished(); + Event::RedrawEventsCleared => { + previous_frame_end + .as_mut() + .unwrap() + .as_mut() + .cleanup_finished(); - if recreate_swap_chain { + if recreate_swapchain { let dimensions: [u32; 2] = surface.window().inner_size().into(); - let (new_swap_chain, new_images) = - match swapchain.recreate().dimensions(dimensions).build() { + let (new_swapchain, new_images) = + match swapchain.recreate(SwapchainCreateInfo { + image_extent: surface.window().inner_size().into(), + ..swapchain.create_info() + }) { Ok(r) => r, - Err(SwapchainCreationError::UnsupportedDimensions) => return, - Err(e) => panic!("Failed to recreate swap chain: {:?}", e), + Err(SwapchainCreationError::ImageExtentNotSupported { .. }) => return, + Err(e) => panic!("Failed to recreate swapchain: {:?}", e), }; - swapchain = new_swap_chain; + swapchain = new_swapchain; framebuffers = window_size_dependent_setup( &new_images, render_pass.clone(), - &mut dynamic_state, + &mut viewport, ); - recreate_swap_chain = false; + viewport.dimensions = [dimensions[0] as f32, dimensions[1] as f32]; + recreate_swapchain = false; } let (image_num, suboptimal, acquire_future) = match swapchain::acquire_next_image(swapchain.clone(), None) { Ok(r) => r, Err(AcquireError::OutOfDate) => { - recreate_swap_chain = true; + recreate_swapchain = true; return; } Err(e) => panic!("Failed to acquire next image: {:?}", e), }; if suboptimal { - recreate_swap_chain = true; + recreate_swapchain = true; } let clear_values = vec![[0.0, 0.0, 1.0, 1.0].into()]; @@ -255,6 +335,20 @@ pub fn run_app(amd_gui: Arc>, _receiver: UnboundedReceiver) ) .unwrap(); + egui_ctx.begin_frame(egui_winit.take_egui_input(surface.window())); + + create_ui(amd_gui.clone(), &egui_ctx); + + let egui_output = egui_ctx.end_frame(); + let platform_output = egui_output.platform_output; + egui_winit.handle_platform_output(surface.window(), &egui_ctx, platform_output); + + let result = egui_painter + .update_textures(egui_output.textures_delta, &mut builder) + .expect("egui texture error"); + + let wait_for_last_frame = result == UpdateTexturesResult::Changed; + // Do your usual rendering builder .begin_render_pass( @@ -263,29 +357,23 @@ pub fn run_app(amd_gui: Arc>, _receiver: UnboundedReceiver) clear_values, ) .unwrap() - .draw( - pipeline.clone(), - &dynamic_state, - vertex_buffer.clone(), - (), - (), - ) + .set_viewport(0, [viewport.clone()]) + .bind_pipeline_graphics(pipeline.clone()) + .bind_vertex_buffers(0, vertex_buffer.clone()) + .draw(vertex_buffer.len().try_into().unwrap(), 1, 0, 0) .unwrap(); // Don't end the render pass yet - egui_ctx.begin_frame(egui_winit.take_egui_input(surface.window())); + // Build your gui - create_ui(amd_gui.clone(), &egui_ctx); - - let (egui_output, clipped_shapes) = egui_ctx.end_frame(); - egui_winit.handle_output(surface.window(), &egui_ctx, egui_output); + // Automatically start the next render subpass and draw the gui let size = surface.window().inner_size(); + let sf: f32 = surface.window().scale_factor() as f32; egui_painter .draw( &mut builder, - &dynamic_state, - [size.width as f32, size.height as f32], + [(size.width as f32) / sf, (size.height as f32) / sf], &egui_ctx, - clipped_shapes, + egui_output.shapes, ) .unwrap(); @@ -294,9 +382,16 @@ pub fn run_app(amd_gui: Arc>, _receiver: UnboundedReceiver) let command_buffer = builder.build().unwrap(); + if wait_for_last_frame { + if let Some(FrameEndFuture::FenceSignalFuture(ref mut f)) = previous_frame_end { + f.wait(None).unwrap(); + } + } + let future = previous_frame_end .take() .unwrap() + .get() .join(acquire_future) .then_execute(queue.clone(), command_buffer) .unwrap() @@ -305,15 +400,15 @@ pub fn run_app(amd_gui: Arc>, _receiver: UnboundedReceiver) match future { Ok(future) => { - previous_frame_end = Some(future.boxed()); + previous_frame_end = Some(FrameEndFuture::FenceSignalFuture(future)); } Err(FlushError::OutOfDate) => { - recreate_swap_chain = true; - previous_frame_end = Some(sync::now(device.clone()).boxed()); + recreate_swapchain = true; + previous_frame_end = Some(FrameEndFuture::now(device.clone())); } Err(e) => { println!("Failed to flush future: {:?}", e); - previous_frame_end = Some(sync::now(device.clone()).boxed()); + previous_frame_end = Some(FrameEndFuture::now(device.clone())); } } } @@ -325,28 +420,23 @@ pub fn run_app(amd_gui: Arc>, _receiver: UnboundedReceiver) fn window_size_dependent_setup( images: &[Arc>], render_pass: Arc, - dynamic_state: &mut DynamicState, -) -> Vec> { - let dimensions = images[0].dimensions(); - - let viewport = vulkano::pipeline::viewport::Viewport { - origin: [0.0, 0.0], - dimensions: [dimensions[0] as f32, dimensions[1] as f32], - depth_range: 0.0..1.0, - }; - dynamic_state.viewports = Some(vec![viewport]); + viewport: &mut Viewport, +) -> Vec> { + let dimensions = images[0].dimensions().width_height(); + viewport.dimensions = [dimensions[0] as f32, dimensions[1] as f32]; images .iter() .map(|image| { - let view = ImageView::new(image.clone()).unwrap(); - Arc::new( - Framebuffer::start(render_pass.clone()) - .add(view) - .unwrap() - .build() - .unwrap(), - ) as Arc + let view = ImageView::new_default(image.clone()).unwrap(); + Framebuffer::new( + render_pass.clone(), + FramebufferCreateInfo { + attachments: vec![view], + ..Default::default() + }, + ) + .unwrap() }) .collect::>() } diff --git a/amdguid/src/items.rs b/amdguid/src/items.rs index 8045f93..064a704 100644 --- a/amdguid/src/items.rs +++ b/amdguid/src/items.rs @@ -2,10 +2,9 @@ use std::ops::RangeInclusive; +pub use arrows::*; use egui::Pos2; use epaint::{Color32, Shape, Stroke}; - -pub use arrows::*; pub use h_line::*; pub use line::*; pub use marker_shape::*; @@ -129,7 +128,8 @@ impl ToString for LineStyle { // ---------------------------------------------------------------------------- -/// Describes a function y = f(x) with an optional range for x and a number of points. +/// Describes a function y = f(x) with an optional range for x and a number of +/// points. pub struct ExplicitGenerator { function: Box f64>, x_range: RangeInclusive, @@ -138,8 +138,8 @@ pub struct ExplicitGenerator { // ---------------------------------------------------------------------------- -/// Returns the x-coordinate of a possible intersection between a line segment from `p1` to `p2` and -/// a horizontal line at the given y-coordinate. +/// Returns the x-coordinate of a possible intersection between a line segment +/// from `p1` to `p2` and a horizontal line at the given y-coordinate. #[inline(always)] pub fn y_intersection(p1: &Pos2, p2: &Pos2, y: f32) -> Option { ((p1.y > y && p2.y < y) || (p1.y < y && p2.y > y)) diff --git a/amdguid/src/items/arrows.rs b/amdguid/src/items/arrows.rs index eabb9b4..7ab0f2b 100644 --- a/amdguid/src/items/arrows.rs +++ b/amdguid/src/items/arrows.rs @@ -1,9 +1,11 @@ +use std::ops::RangeInclusive; + +use egui::Ui; +use epaint::{Color32, Shape}; + use crate::items::plot_item::PlotItem; use crate::items::values::Values; use crate::transform::{Bounds, ScreenTransform}; -use egui::Ui; -use epaint::{Color32, Shape}; -use std::ops::RangeInclusive; /// A set of arrows. pub struct Arrows { diff --git a/amdguid/src/items/h_line.rs b/amdguid/src/items/h_line.rs index 8a545b7..623625f 100644 --- a/amdguid/src/items/h_line.rs +++ b/amdguid/src/items/h_line.rs @@ -1,11 +1,13 @@ +use std::ops::RangeInclusive; + +use egui::Ui; +use epaint::{Color32, Shape, Stroke}; + use crate::items::plot_item::PlotItem; use crate::items::value::Value; use crate::items::values::Values; use crate::items::LineStyle; use crate::transform::{Bounds, ScreenTransform}; -use egui::Ui; -use epaint::{Color32, Shape, Stroke}; -use std::ops::RangeInclusive; /// A horizontal line in a plot, filling the full width #[derive(Clone, Debug, PartialEq)] @@ -28,7 +30,8 @@ impl HLine { } } - /// Stroke color. Default is `Color32::TRANSPARENT` which means a color will be auto-assigned. + /// Stroke color. Default is `Color32::TRANSPARENT` which means a color will + /// be auto-assigned. #[must_use] pub fn color(mut self, color: impl Into) -> Self { self.stroke.color = color.into(); diff --git a/amdguid/src/items/line.rs b/amdguid/src/items/line.rs index 779e8dc..339fa0a 100644 --- a/amdguid/src/items/line.rs +++ b/amdguid/src/items/line.rs @@ -1,12 +1,14 @@ +use std::ops::RangeInclusive; + +use egui::{pos2, NumExt, Ui}; +use epaint::{Color32, Mesh, Rgba, Shape, Stroke}; + use crate::items; use crate::items::plot_item::PlotItem; use crate::items::value::Value; use crate::items::values::Values; use crate::items::{LineStyle, DEFAULT_FILL_ALPHA}; use crate::transform::{Bounds, ScreenTransform}; -use egui::{pos2, NumExt, Ui}; -use epaint::{Color32, Mesh, Rgba, Shape, Stroke}; -use std::ops::RangeInclusive; impl PlotItem for Line { fn get_shapes(&self, _ui: &mut Ui, transform: &ScreenTransform, shapes: &mut Vec) { @@ -120,7 +122,8 @@ impl Line { } } - /// Stroke color. Default is `Color32::TRANSPARENT` which means a color will be auto-assigned. + /// Stroke color. Default is `Color32::TRANSPARENT` which means a color will + /// be auto-assigned. #[must_use] pub fn color(mut self, color: impl Into) -> Self { self.stroke.color = color.into(); diff --git a/amdguid/src/items/plot_image.rs b/amdguid/src/items/plot_image.rs index 1cd131e..797234b 100644 --- a/amdguid/src/items/plot_image.rs +++ b/amdguid/src/items/plot_image.rs @@ -1,10 +1,12 @@ +use std::ops::RangeInclusive; + +use egui::{pos2, Image, Rect, Ui, Vec2}; +use epaint::{Color32, Shape, Stroke, TextureId}; + use crate::items::plot_item::PlotItem; use crate::items::value::Value; use crate::items::values::Values; use crate::transform::{Bounds, ScreenTransform}; -use egui::{pos2, Image, Rect, Ui, Vec2}; -use epaint::{Color32, Shape, Stroke, TextureId}; -use std::ops::RangeInclusive; /// An image in the plot. pub struct PlotImage { @@ -65,8 +67,8 @@ impl PlotImage { /// /// This name will show up in the plot legend, if legends are turned on. /// - /// Multiple plot items may share the same name, in which case they will also share an entry in - /// the legend. + /// Multiple plot items may share the same name, in which case they will + /// also share an entry in the legend. #[allow(clippy::needless_pass_by_value)] #[must_use] pub fn name(mut self, name: impl ToString) -> Self { diff --git a/amdguid/src/items/plot_item.rs b/amdguid/src/items/plot_item.rs index 38c6982..bb4a75f 100644 --- a/amdguid/src/items/plot_item.rs +++ b/amdguid/src/items/plot_item.rs @@ -1,8 +1,10 @@ -use crate::items::Values; -use crate::transform::{Bounds, ScreenTransform}; +use std::ops::RangeInclusive; + use egui::Ui; use epaint::{Color32, Shape}; -use std::ops::RangeInclusive; + +use crate::items::Values; +use crate::transform::{Bounds, ScreenTransform}; /// Trait shared by things that can be drawn in the plot. pub trait PlotItem { diff --git a/amdguid/src/items/points.rs b/amdguid/src/items/points.rs index 0c8a074..97ea387 100644 --- a/amdguid/src/items/points.rs +++ b/amdguid/src/items/points.rs @@ -1,17 +1,20 @@ +use std::ops::RangeInclusive; + +use egui::{pos2, vec2, Pos2, Ui}; +use epaint::{Color32, Shape, Stroke}; + use crate::items::marker_shape::MarkerShape; use crate::items::plot_item::PlotItem; use crate::items::value::Value; use crate::items::values::Values; use crate::transform::{Bounds, ScreenTransform}; -use egui::{pos2, vec2, Pos2, Ui}; -use epaint::{Color32, Shape, Stroke}; -use std::ops::RangeInclusive; /// A set of points. pub struct Points { pub(crate) series: Values, pub(crate) shape: MarkerShape, - /// Color of the marker. `Color32::TRANSPARENT` means that it will be picked automatically. + /// Color of the marker. `Color32::TRANSPARENT` means that it will be picked + /// automatically. pub(crate) color: Color32, /// Whether to fill the marker. Does not apply to all types. pub(crate) filled: bool, @@ -64,7 +67,8 @@ impl Points { self } - /// Whether to add stems between the markers and a horizontal reference line. + /// Whether to add stems between the markers and a horizontal reference + /// line. #[must_use] pub fn stems(mut self, y_reference: impl Into) -> Self { self.stems = Some(y_reference.into()); @@ -82,8 +86,8 @@ impl Points { /// /// This name will show up in the plot legend, if legends are turned on. /// - /// Multiple plot items may share the same name, in which case they will also share an entry in - /// the legend. + /// Multiple plot items may share the same name, in which case they will + /// also share an entry in the legend. #[allow(clippy::needless_pass_by_value)] #[must_use] pub fn name(mut self, name: impl ToString) -> Self { diff --git a/amdguid/src/items/polygons.rs b/amdguid/src/items/polygons.rs index f0a579b..7821cb1 100644 --- a/amdguid/src/items/polygons.rs +++ b/amdguid/src/items/polygons.rs @@ -1,10 +1,12 @@ +use std::ops::RangeInclusive; + +use egui::{NumExt, Ui}; +use epaint::{Color32, Rgba, Shape, Stroke}; + use crate::items::plot_item::PlotItem; use crate::items::values::Values; use crate::items::{LineStyle, DEFAULT_FILL_ALPHA}; use crate::transform::{Bounds, ScreenTransform}; -use egui::{NumExt, Ui}; -use epaint::{Color32, Rgba, Shape, Stroke}; -use std::ops::RangeInclusive; /// A convex polygon. pub struct Polygon { @@ -28,8 +30,8 @@ impl Polygon { } } - /// Highlight this polygon in the plot by scaling up the stroke and reducing the fill - /// transparency. + /// Highlight this polygon in the plot by scaling up the stroke and reducing + /// the fill transparency. #[must_use] pub fn highlight(mut self) -> Self { self.highlight = true; @@ -50,7 +52,8 @@ impl Polygon { self } - /// Stroke color. Default is `Color32::TRANSPARENT` which means a color will be auto-assigned. + /// Stroke color. Default is `Color32::TRANSPARENT` which means a color will + /// be auto-assigned. #[must_use] pub fn color(mut self, color: impl Into) -> Self { self.stroke.color = color.into(); @@ -75,8 +78,8 @@ impl Polygon { /// /// This name will show up in the plot legend, if legends are turned on. /// - /// Multiple plot items may share the same name, in which case they will also share an entry in - /// the legend. + /// Multiple plot items may share the same name, in which case they will + /// also share an entry in the legend. #[allow(clippy::needless_pass_by_value)] #[must_use] pub fn name(mut self, name: impl ToString) -> Self { diff --git a/amdguid/src/items/text.rs b/amdguid/src/items/text.rs index 53e25fb..784cd74 100644 --- a/amdguid/src/items/text.rs +++ b/amdguid/src/items/text.rs @@ -1,10 +1,12 @@ +use std::ops::RangeInclusive; + +use egui::{Align2, Rect, TextStyle, Ui}; +use epaint::{Color32, Shape, Stroke}; + use crate::items::plot_item::PlotItem; use crate::items::value::Value; use crate::items::values::Values; use crate::transform::{Bounds, ScreenTransform}; -use egui::{Align2, Rect, Ui}; -use epaint::{Color32, Shape, Stroke, TextStyle}; -use std::ops::RangeInclusive; /// Text inside the plot. pub struct Text { @@ -45,7 +47,8 @@ impl Text { self } - /// Text color. Default is `Color32::TRANSPARENT` which means a color will be auto-assigned. + /// Text color. Default is `Color32::TRANSPARENT` which means a color will + /// be auto-assigned. #[must_use] pub fn color(mut self, color: impl Into) -> Self { self.color = color.into(); @@ -63,8 +66,8 @@ impl Text { /// /// This name will show up in the plot legend, if legends are turned on. /// - /// Multiple plot items may share the same name, in which case they will also share an entry in - /// the legend. + /// Multiple plot items may share the same name, in which case they will + /// also share an entry in the legend. #[allow(clippy::needless_pass_by_value)] #[must_use] pub fn name(mut self, name: impl ToString) -> Self { @@ -80,10 +83,11 @@ impl PlotItem for Text { } else { self.color }; + let fond_id = ui.style().text_styles.get(&self.style).unwrap(); let pos = transform.position_from_value(&self.position); let galley = ui .fonts() - .layout_no_wrap(self.text.clone(), self.style, color); + .layout_no_wrap(self.text.clone(), fond_id.clone(), color); let rect = self .anchor .anchor_rect(Rect::from_min_size(pos, galley.size())); diff --git a/amdguid/src/items/v_line.rs b/amdguid/src/items/v_line.rs index c61a30e..4d6f7b7 100644 --- a/amdguid/src/items/v_line.rs +++ b/amdguid/src/items/v_line.rs @@ -1,11 +1,13 @@ +use std::ops::RangeInclusive; + +use egui::Ui; +use epaint::{Color32, Shape, Stroke}; + use crate::items::plot_item::PlotItem; use crate::items::value::Value; use crate::items::values::Values; use crate::items::LineStyle; use crate::transform::{Bounds, ScreenTransform}; -use egui::Ui; -use epaint::{Color32, Shape, Stroke}; -use std::ops::RangeInclusive; impl PlotItem for VLine { fn get_shapes(&self, _ui: &mut Ui, transform: &ScreenTransform, shapes: &mut Vec) { @@ -95,7 +97,8 @@ impl VLine { self } - /// Stroke color. Default is `Color32::TRANSPARENT` which means a color will be auto-assigned. + /// Stroke color. Default is `Color32::TRANSPARENT` which means a color will + /// be auto-assigned. #[must_use] pub fn color(mut self, color: impl Into) -> Self { self.stroke.color = color.into(); @@ -113,8 +116,8 @@ impl VLine { /// /// This name will show up in the plot legend, if legends are turned on. /// - /// Multiple plot items may share the same name, in which case they will also share an entry in - /// the legend. + /// Multiple plot items may share the same name, in which case they will + /// also share an entry in the legend. #[allow(clippy::needless_pass_by_value)] #[must_use] pub fn name(mut self, name: impl ToString) -> Self { diff --git a/amdguid/src/items/value.rs b/amdguid/src/items/value.rs index 807670f..92d1677 100644 --- a/amdguid/src/items/value.rs +++ b/amdguid/src/items/value.rs @@ -4,8 +4,8 @@ /// large values (e.g. unix time on x axis). #[derive(Clone, Copy, Debug, PartialEq)] pub struct Value { - /// This is often something monotonically increasing, such as time, but doesn't have to be. - /// Goes from left to right. + /// This is often something monotonically increasing, such as time, but + /// doesn't have to be. Goes from left to right. pub x: f64, /// Goes from bottom to top (inverse of everything else in egui!). pub y: f64, diff --git a/amdguid/src/items/values.rs b/amdguid/src/items/values.rs index 6b0efd0..0ea6cf5 100644 --- a/amdguid/src/items/values.rs +++ b/amdguid/src/items/values.rs @@ -1,8 +1,9 @@ -use crate::items::{ExplicitGenerator, Value}; -use crate::transform::Bounds; use std::collections::Bound; use std::ops::{RangeBounds, RangeInclusive}; +use crate::items::{ExplicitGenerator, Value}; +use crate::transform::Bounds; + pub struct Values { pub values: Vec, generator: Option, @@ -20,7 +21,8 @@ impl Values { Self::from_values(iter.collect()) } - /// Draw a line based on a function `y=f(x)`, a range (which can be infinite) for x and the number of points. + /// Draw a line based on a function `y=f(x)`, a range (which can be + /// infinite) for x and the number of points. pub fn from_explicit_callback( function: impl Fn(f64) -> f64 + 'static, x_range: impl RangeBounds, @@ -48,8 +50,9 @@ impl Values { } } - /// Draw a line based on a function `(x,y)=f(t)`, a range for t and the number of points. - /// The range may be specified as start..end or as start..=end. + /// Draw a line based on a function `(x,y)=f(t)`, a range for t and the + /// number of points. The range may be specified as start..end or as + /// start..=end. pub fn from_parametric_callback( function: impl Fn(f64) -> (f64, f64), t_range: impl RangeBounds, @@ -92,13 +95,14 @@ impl Values { Self::from_values(values) } - /// Returns true if there are no data points available and there is no function to generate any. + /// Returns true if there are no data points available and there is no + /// function to generate any. pub fn is_empty(&self) -> bool { self.generator.is_none() && self.values.is_empty() } - /// If initialized with a generator function, this will generate `n` evenly spaced points in the - /// given range. + /// If initialized with a generator function, this will generate `n` evenly + /// spaced points in the given range. pub fn generate_points(&mut self, x_range: RangeInclusive) { if let Some(generator) = self.generator.take() { if let Some(intersection) = Self::range_intersection(&x_range, &generator.x_range) { diff --git a/amdguid/src/transform.rs b/amdguid/src/transform.rs index c22a919..ffdcc0d 100644 --- a/amdguid/src/transform.rs +++ b/amdguid/src/transform.rs @@ -117,7 +117,8 @@ impl Bounds { } } -/// Contains the screen rectangle and the plot bounds and provides methods to transform them. +/// Contains the screen rectangle and the plot bounds and provides methods to +/// transform them. #[derive(Clone)] pub struct ScreenTransform { /// The screen rectangle. diff --git a/amdguid/src/widgets/change_fan_settings.rs b/amdguid/src/widgets/change_fan_settings.rs index daed7ee..027ff69 100644 --- a/amdguid/src/widgets/change_fan_settings.rs +++ b/amdguid/src/widgets/change_fan_settings.rs @@ -1,12 +1,13 @@ -use amdgpu::helper_cmd::Command; +use amdgpu::pidfile::helper_cmd::{send_command, Command, Response}; use amdgpu_config::fan::MatrixPoint; use egui::{emath, pos2, Layout, PointerButton, Ui}; use epaint::Color32; use crate::app::{ChangeState, FanConfig, FanServices, StatefulConfig}; +use crate::widgets; use crate::widgets::drag_plot::PlotMsg; use crate::widgets::reload_section::ReloadSection; -use crate::{widgets, widgets::ConfigFile}; +use crate::widgets::ConfigFile; pub struct ChangeFanSettings { config: FanConfig, @@ -139,10 +140,10 @@ impl ChangeFanSettings { ui.label("Saving..."); } ChangeState::Success => { - ui.add(egui::Label::new("Saved").text_color(Color32::GREEN)); + ui.add(egui::Label::new("Saved")/*.text_color(Color32::GREEN)*/); } ChangeState::Failure(msg) => { - ui.add(egui::Label::new(format!("Failure. {}", msg)).text_color(Color32::RED)); + ui.add(egui::Label::new(format!("Failure. {}", msg))/*.text_color(Color32::RED)*/); } } }); @@ -164,11 +165,11 @@ impl ChangeFanSettings { path: String::from(config.path()), content, }; - match amdgpu::helper_cmd::send_command(command) { - Ok(amdgpu::helper_cmd::Response::ConfigFileSaveFailed(msg)) => { + match send_command(command) { + Ok(Response::ConfigFileSaveFailed(msg)) => { state.state = ChangeState::Failure(msg); } - Ok(amdgpu::helper_cmd::Response::ConfigFileSaved) => { + Ok(Response::ConfigFileSaved) => { state.state = ChangeState::Success; } _ => {} diff --git a/amdguid/src/widgets/config_file.rs b/amdguid/src/widgets/config_file.rs index c4e1793..46892f9 100644 --- a/amdguid/src/widgets/config_file.rs +++ b/amdguid/src/widgets/config_file.rs @@ -1,6 +1,5 @@ -use egui::{PointerButton, Response, Sense, Ui, Widget}; - use amdgpu_config::fan::MatrixPoint; +use egui::{PointerButton, Response, Sense, Ui, Widget}; use crate::app::FanConfig; diff --git a/amdguid/src/widgets/cooling_performance.rs b/amdguid/src/widgets/cooling_performance.rs index b70f84c..1999783 100644 --- a/amdguid/src/widgets/cooling_performance.rs +++ b/amdguid/src/widgets/cooling_performance.rs @@ -1,11 +1,13 @@ -use crate::app::{FanConfig, FanServices}; -use amdgpu::Card; -use amdmond_lib::AmdMon; use core::option::Option; use core::option::Option::Some; -use egui::Ui; use std::collections::vec_deque::VecDeque; +use amdgpu::Card; +use amdmond_lib::AmdMon; +use egui::Ui; + +use crate::app::{FanConfig, FanServices}; + pub struct CoolingPerformance { capacity: usize, data: VecDeque, @@ -55,18 +57,20 @@ impl CoolingPerformance { .name("Overheating") .color(Color32::DARK_RED); - let plot = Plot::new("cooling performance") + ui.label("Temperature"); + Plot::new("cooling performance") .allow_drag(false) .allow_zoom(false) .height(600.0) - .line(curve) - .hline(zero) - .hline(optimal) - .hline(target) - .legend(Legend::default()); + .show(ui, |plot_ui| { + plot_ui.line(curve); + plot_ui.hline(zero); + plot_ui.hline(optimal); + plot_ui.hline(target); + // plot_ui.legend(Legend::default()); + }); - ui.label("Temperature"); - ui.add(plot); + // ui.add(plot); ui.horizontal(|ui| { ui.label("Current temperature"); ui.label(format!("{:<3.2}°C", current)); diff --git a/amdguid/src/widgets/drag_plot.rs b/amdguid/src/widgets/drag_plot.rs index 83c7a5b..8ed831b 100644 --- a/amdguid/src/widgets/drag_plot.rs +++ b/amdguid/src/widgets/drag_plot.rs @@ -1,10 +1,9 @@ use egui::{emath, vec2, CursorIcon, Id, NumExt, PointerButton, Response, Sense, Ui, Vec2}; use epaint::ahash::AHashSet; use epaint::color::Hsva; -use epaint::Color32; +use epaint::{Color32, Rounding}; -use crate::items::HLine; -use crate::items::*; +use crate::items::{HLine, *}; use crate::transform::{Bounds, ScreenTransform}; use crate::widgets::drag_plot_prepared::DragPlotPrepared; use crate::widgets::legend::Legend; @@ -16,7 +15,8 @@ pub enum PlotMsg { Drag(emath::Vec2), } -#[derive(Clone, serde::Serialize, serde::Deserialize)] +// , serde::Serialize, serde::Deserialize +#[derive(Clone)] struct PlotMemory { bounds: Bounds, auto_bounds: bool, @@ -125,12 +125,13 @@ where self.next_auto_color_idx += 1; let golden_ratio = (5.0_f32.sqrt() - 1.0) / 2.0; // 0.61803398875 let h = i as f32 * golden_ratio; - Hsva::new(h, 0.85, 0.5, 1.0).into() // TODO: OkLab or some other perspective color space + Hsva::new(h, 0.85, 0.5, 1.0).into() // TODO: OkLab or some other + // perspective color space } /// width / height ratio of the data. - /// For instance, it can be useful to set this to `1.0` for when the two axes show the same - /// unit. + /// For instance, it can be useful to set this to `1.0` for when the two + /// axes show the same unit. /// By default the plot window's aspect ratio is used. #[must_use] pub fn data_aspect(mut self, data_aspect: f32) -> Self { @@ -139,7 +140,8 @@ where } /// width / height ratio of the plot region. - /// By default no fixed aspect ratio is set (and width/height will fill the ui it is in). + /// By default no fixed aspect ratio is set (and width/height will fill the + /// ui it is in). #[must_use] pub fn view_aspect(mut self, view_aspect: f32) -> Self { self.view_aspect = Some(view_aspect); @@ -147,7 +149,8 @@ where } /// Width of plot. By default a plot will fill the ui it is in. - /// If you set [`Self::view_aspect`], the width can be calculated from the height. + /// If you set [`Self::view_aspect`], the width can be calculated from the + /// height. #[must_use] pub fn width(mut self, width: f32) -> Self { self.min_size.x = width; @@ -156,7 +159,8 @@ where } /// Height of plot. By default a plot will fill the ui it is in. - /// If you set [`Self::view_aspect`], the height can be calculated from the width. + /// If you set [`Self::view_aspect`], the height can be calculated from the + /// width. #[must_use] pub fn height(mut self, height: f32) -> Self { self.min_size.y = height; @@ -240,9 +244,9 @@ where } = self; let plot_id = ui.make_persistent_id(id); let memory = ui - .memory() - .id_data - .get_mut_or_insert_with(plot_id, || PlotMemory { + .ctx() + .data() + .get_persisted_mut_or_insert_with(plot_id, || PlotMemory { bounds: min_auto_bounds, auto_bounds: false, hovered_entry: None, @@ -284,11 +288,11 @@ where }; let (rect, response) = ui.allocate_exact_size(size, Sense::click_and_drag()); - let plot_painter = ui.painter().sub_region(rect); + let plot_painter = ui.painter().with_clip_rect(rect); plot_painter.add(epaint::RectShape { rect, - corner_radius: 2.0, + rounding: Rounding::from(2.0), fill: ui.visuals().extreme_bg_color, stroke: ui.visuals().widgets.noninteractive.bg_stroke, }); @@ -408,16 +412,15 @@ where hovered_entry = legend.get_hovered_entry_name(); } - ui.memory().id_data.insert( - plot_id, - PlotMemory { + ui.ctx() + .data() + .get_persisted_mut_or_insert_with(plot_id, || PlotMemory { bounds: t_bounds, auto_bounds, hovered_entry, hidden_items, min_auto_bounds, - }, - ); + }); response.on_hover_cursor(CursorIcon::Crosshair) } } diff --git a/amdguid/src/widgets/drag_plot_prepared.rs b/amdguid/src/widgets/drag_plot_prepared.rs index e69aa2d..61b19fe 100644 --- a/amdguid/src/widgets/drag_plot_prepared.rs +++ b/amdguid/src/widgets/drag_plot_prepared.rs @@ -1,8 +1,7 @@ -use egui::{emath, pos2, remap_clamp, vec2, Align2, Layout, NumExt, Pos2, Response, Ui}; -use epaint::{Color32, Rgba, Shape, Stroke, TextStyle}; +use egui::{emath, pos2, remap_clamp, vec2, Align2, Layout, NumExt, Pos2, Response, TextStyle, Ui}; +use epaint::{Color32, Rgba, Shape, Stroke}; -use crate::items::Value; -use crate::items::{Line, PlotItem}; +use crate::items::{Line, PlotItem, Value}; use crate::transform::ScreenTransform; pub struct DragPlotPrepared { @@ -41,7 +40,9 @@ impl DragPlotPrepared { self.hover(ui, pointer, &mut shapes); } - ui.painter().sub_region(*transform.frame()).extend(shapes); + ui.painter() + .with_clip_rect(*transform.frame()) + .extend(shapes); } fn paint_axis(&self, ui: &Ui, axis: usize, shapes: &mut Vec) { @@ -77,9 +78,12 @@ impl DragPlotPrepared { let n = (value_main / step_size).round() as i64; let spacing_in_points = if n % (base * base) == 0 { - step_size_in_points * (base_f * base_f) as f32 // think line (multiple of 100) + step_size_in_points * (base_f * base_f) as f32 // think line + // (multiple of + // 100) } else if n % base == 0 { - step_size_in_points * base_f as f32 // medium line (multiple of 10) + step_size_in_points * base_f as f32 // medium line (multiple of + // 10) } else { step_size_in_points // thin line }; @@ -106,7 +110,11 @@ impl DragPlotPrepared { let color = color_from_alpha(ui, text_alpha); let text = emath::round_to_decimals(value_main, 5).to_string(); // hack - let galley = ui.painter().layout_no_wrap(text, text_style, color); + let galley = ui.painter().layout_no_wrap( + text, + ui.style().text_styles.get(&text_style).cloned().unwrap(), + color, + ); let mut text_pos = pos_in_gui + vec2(1.0, -galley.size().y); @@ -135,15 +143,13 @@ impl DragPlotPrepared { let interact_radius: f32 = 16.0; let mut closest_value = None; let mut closest_dist_sq = interact_radius.powi(2); - for item in lines { - if let Some(values) = item.values() { - for (idx, value) in values.values.iter().enumerate() { - let pos = transform.position_from_value(value); - let dist_sq = pointer.distance_sq(pos); - if dist_sq < closest_dist_sq { - closest_dist_sq = dist_sq; - closest_value = Some(idx); - } + for values in lines.iter().filter_map(|v| v.values()) { + for (idx, value) in values.values.iter().enumerate() { + let pos = transform.position_from_value(value); + let dist_sq = pointer.distance_sq(pos); + if dist_sq < closest_dist_sq { + closest_dist_sq = dist_sq; + closest_value = Some(idx); } } } @@ -255,11 +261,15 @@ impl DragPlotPrepared { }; shapes.push(Shape::text( - ui.fonts(), + &*ui.fonts(), pointer + vec2(3.0, -2.0), Align2::LEFT_BOTTOM, text, - TextStyle::Body, + ui.style() + .text_styles + .get(&TextStyle::Body) + .cloned() + .unwrap(), ui.visuals().text_color(), )); } diff --git a/amdguid/src/widgets/legend.rs b/amdguid/src/widgets/legend.rs index c661721..18a29cd 100644 --- a/amdguid/src/widgets/legend.rs +++ b/amdguid/src/widgets/legend.rs @@ -1,7 +1,9 @@ use std::string::String; -use egui::{pos2, vec2, Align, PointerButton, Rect, Response, Sense, WidgetInfo, WidgetType}; -use epaint::{Color32, TextStyle}; +use egui::{ + pos2, vec2, Align, PointerButton, Rect, Response, Sense, TextStyle, WidgetInfo, WidgetType, +}; +use epaint::Color32; /// Where to place the plot legend. #[derive(Debug, Clone, Copy, PartialEq, Eq)] @@ -26,7 +28,7 @@ impl Corner { } /// The configuration for a plot legend. -#[derive(Clone, Copy, PartialEq)] +#[derive(Clone, PartialEq)] pub struct Legend { pub text_style: TextStyle, pub background_alpha: f32, @@ -89,9 +91,15 @@ impl LegendEntry { hovered, } = self; - let galley = - ui.fonts() - .layout_delayed_color(text, ui.style().body_text_style, f32::INFINITY); + let galley = ui.fonts().layout_delayed_color( + text, + ui.style() + .text_styles + .get(&TextStyle::Body) + .unwrap() + .clone(), + f32::INFINITY, + ); let icon_size = galley.size().y; let icon_spacing = icon_size / 5.0; diff --git a/amdguid/src/widgets/legend_widget.rs b/amdguid/src/widgets/legend_widget.rs index a85472e..6f3258f 100644 --- a/amdguid/src/widgets/legend_widget.rs +++ b/amdguid/src/widgets/legend_widget.rs @@ -1,6 +1,7 @@ use std::collections::BTreeMap; -use egui::{vec2, Align, Direction, Frame, Layout, Rect, Response, Ui, Widget}; +use egui::style::Margin; +use egui::{Align, Direction, Frame, Layout, Rect, Response, Ui, Widget}; use epaint::ahash::AHashSet; use epaint::Color32; @@ -15,8 +16,8 @@ pub struct LegendWidget { } impl LegendWidget { - /// Create a new legend from items, the names of items that are hidden and the style of the - /// text. Returns `None` if the legend has no entries. + /// Create a new legend from items, the names of items that are hidden and + /// the style of the text. Returns `None` if the legend has no entries. pub fn try_new( rect: Rect, config: Legend, @@ -89,10 +90,11 @@ impl Widget for &mut LegendWidget { let mut legend_ui = ui.child_ui(legend_rect, layout); legend_ui .scope(|ui| { - ui.style_mut().body_text_style = config.text_style; + // ui.style_mut().body_text_style = config.text_style; let background_frame = Frame { - margin: vec2(8.0, 4.0), - corner_radius: ui.style().visuals.window_corner_radius, + inner_margin: Margin::symmetric(8.0, 4.0), + outer_margin: Default::default(), + rounding: ui.style().visuals.window_rounding, shadow: epaint::Shadow::default(), fill: ui.style().visuals.extreme_bg_color, stroke: ui.style().visuals.window_stroke(), diff --git a/amdguid/src/widgets/mod.rs b/amdguid/src/widgets/mod.rs index 9405256..78a6343 100644 --- a/amdguid/src/widgets/mod.rs +++ b/amdguid/src/widgets/mod.rs @@ -5,6 +5,8 @@ pub mod drag_plot; pub mod drag_plot_prepared; pub mod legend; pub mod legend_widget; +pub mod output_widget; +pub mod outputs_settings; pub mod reload_section; pub use change_fan_settings::*; diff --git a/amdguid/src/widgets/output_widget.rs b/amdguid/src/widgets/output_widget.rs new file mode 100644 index 0000000..e74ed72 --- /dev/null +++ b/amdguid/src/widgets/output_widget.rs @@ -0,0 +1,69 @@ +use std::collections::HashMap; + +use amdgpu::pidfile::ports::Output; +use egui::{Response, Sense, Ui, Vec2}; +use epaint::Stroke; + +pub struct OutputWidget<'output, 'textures> { + output: &'output Output, + textures: &'textures HashMap, +} + +impl<'output, 'textures> OutputWidget<'output, 'textures> { + pub fn new( + output: &'output Output, + textures: &'textures HashMap, + ) -> Self { + Self { output, textures } + } +} + +impl<'output, 'textures> egui::Widget for OutputWidget<'output, 'textures> { + fn ui(self, ui: &mut Ui) -> Response { + let (rect, res) = ui.allocate_exact_size(Vec2::new(80.0, 70.0), Sense::click()); + // let _transform = ScreenTransform::new(rect, Bounds::new_symmetrical(1.0), + // false, false); let _frame = *transform.frame(); + // eprintln!("min {:?} max {:?}", frame.min, frame.max); + let painter = ui.painter(); //.sub_region(*transform.frame()); + + painter.rect_filled(rect, 0.0, epaint::color::Color32::DARK_RED); + painter.rect(rect, 2.0, epaint::color::Color32::DARK_RED, { + let mut s = Stroke::default(); + s.color = epaint::color::Color32::GREEN; + s.width = 1.0; + s + }); + + let rect_middle_point = (rect.max - rect.min) / 2.0; + + painter.circle_filled( + rect.min + Vec2::new(rect_middle_point.x / 2.0, rect_middle_point.y), + 3.0, + epaint::color::Color32::GREEN, + ); + painter.circle_filled( + rect.min + rect_middle_point, + 3.0, + epaint::color::Color32::GREEN, + ); + + painter.circle_filled( + rect.min + + Vec2::new( + rect_middle_point.x + (rect_middle_point.x / 2.0), + rect_middle_point.y, + ), + 3.0, + epaint::color::Color32::GREEN, + ); + res + } +} + +fn icon(name: &str, textures: &HashMap) { + if let Some(_texture) = textures.get(name) { + // + } else { + // + } +} diff --git a/amdguid/src/widgets/outputs_settings.rs b/amdguid/src/widgets/outputs_settings.rs new file mode 100644 index 0000000..46d8d8c --- /dev/null +++ b/amdguid/src/widgets/outputs_settings.rs @@ -0,0 +1,86 @@ +use std::collections::{BTreeMap, HashMap}; + +use amdgpu::pidfile::ports::{Output, Status}; +use egui::Ui; +use epaint::ColorImage; +use image::ImageFormat; + +use crate::app::StatefulConfig; +use crate::widgets::output_widget::OutputWidget; + +#[derive(Default)] +pub struct OutputsSettings { + textures: HashMap, +} + +impl OutputsSettings { + pub fn draw( + &mut self, + ui: &mut Ui, + _state: &mut StatefulConfig, + outputs: &BTreeMap>, + ) { + outputs.values().flatten().for_each(|output| { + // 160x160 + let image = { + let bytes = include_bytes!("../../assets/icons/ports.jpg"); + image::load_from_memory(bytes).unwrap() + }; + + for (_idx, _pixel, _p) in image.to_rgba8().enumerate_pixels() { + // let bytes = pixel.; + // eprintln!("{:?}", bytes); + } + + if !self.textures.contains_key(&output.port_type) { + let img = image::load_from_memory_with_format( + include_bytes!("../../assets/icons/ports.jpg"), + ImageFormat::Jpeg, + ) + .unwrap(); + let image_buffer = img.to_rgba8(); + let size = [image.width() as _, image.height() as _]; + let pixels = image_buffer.as_flat_samples(); + let _ = ui.ctx().load_texture( + output.port_type.clone(), + ColorImage::from_rgba_unmultiplied(size, pixels.as_slice()), + ); + } + }); + let _available = ui.available_rect_before_wrap(); + + ui.vertical(|ui| { + ui.horizontal_top(|ui| { + outputs.iter().for_each(|(name, outputs)| { + ui.vertical(|ui| { + ui.label(format!("name {name}")); + ui.horizontal_top(|ui| { + outputs.iter().for_each(|output| { + ui.vertical(|ui| { + ui.add(OutputWidget::new(output, &self.textures)); + + ui.label(format!("port_number {}", output.port_number)); + ui.label(format!("port_type {}", output.port_type)); + ui.label(format!("card {}", output.card)); + ui.label(format!( + "port_name {}", + output.port_name.as_deref().unwrap_or_default() + )); + ui.label(match output.status { + Status::Connected => "Connected", + Status::Disconnected => "Disconnected", + }); + }); + }); + }); + }); + }); + }); + // eprintln!("=============================================================="); + }); + } +} + +fn vga_port_icon() { + // Texture +} diff --git a/amdguid/src/widgets/reload_section.rs b/amdguid/src/widgets/reload_section.rs index 3d353da..24124c8 100644 --- a/amdguid/src/widgets/reload_section.rs +++ b/amdguid/src/widgets/reload_section.rs @@ -1,7 +1,7 @@ -use crate::app::{ChangeState, FanServices}; -use amdgpu::helper_cmd::Command; +use amdgpu::pidfile::helper_cmd::Command; use egui::{PointerButton, Response, Sense, Ui}; -use epaint::Color32; + +use crate::app::{ChangeState, FanServices}; pub struct ReloadSection<'l> { pub services: &'l mut FanServices, @@ -18,7 +18,7 @@ impl<'l> egui::Widget for ReloadSection<'l> { if ui.button("Reload").clicked_by(PointerButton::Primary) { service.reload = ChangeState::Reloading; - match amdgpu::helper_cmd::send_command(Command::ReloadConfig { + match amdgpu::pidfile::helper_cmd::send_command(Command::ReloadConfig { pid: service.pid, }) { Ok(response) => { @@ -37,12 +37,13 @@ impl<'l> egui::Widget for ReloadSection<'l> { ui.label("Reloading..."); } ChangeState::Success => { - ui.add(egui::Label::new("Reloaded").text_color(Color32::DARK_GREEN)); + ui.add( + egui::Label::new("Reloaded"), /* .text_color(Color32::DARK_GREEN) */ + ); } ChangeState::Failure(msg) => { ui.add( - egui::Label::new(format!("Failure. {}", msg)) - .text_color(Color32::RED), + egui::Label::new(format!("Failure. {}", msg)), // .text_color(Color32::RED), ); } } diff --git a/amdmond-lib/src/lib.rs b/amdmond-lib/src/lib.rs index 35d626e..b814e8e 100644 --- a/amdmond-lib/src/lib.rs +++ b/amdmond-lib/src/lib.rs @@ -1,6 +1,5 @@ pub mod errors; -use crate::errors::AmdMonError; use amdgpu::hw_mon::HwMon; use amdgpu::utils::load_temp_inputs; use amdgpu::{ @@ -8,6 +7,8 @@ use amdgpu::{ }; use amdgpu_config::fan; +use crate::errors::AmdMonError; + pub type Result = std::result::Result; pub struct AmdMon { diff --git a/amdmond/src/main.rs b/amdmond/src/main.rs index bbc80e6..9cfe5c2 100644 --- a/amdmond/src/main.rs +++ b/amdmond/src/main.rs @@ -2,11 +2,11 @@ mod command; mod log_file; mod watch; +use amdgpu::utils::ensure_config_dir; +use amdgpu_config::monitor::{load_config, Config, DEFAULT_MONITOR_CONFIG_PATH}; use gumdrop::Options; use crate::command::Command; -use amdgpu::utils::ensure_config_dir; -use amdgpu_config::monitor::{load_config, Config, DEFAULT_MONITOR_CONFIG_PATH}; #[derive(gumdrop::Options)] pub struct Opts { diff --git a/amdportsd/src/main.rs b/amdportsd/src/main.rs index b8b0a09..a8769ba 100644 --- a/amdportsd/src/main.rs +++ b/amdportsd/src/main.rs @@ -1,13 +1,12 @@ -use amdgpu::ports::{sock_file, Command, Response}; -use amdgpu::{ports::*, IoFailure}; use std::fs::{DirEntry, Permissions}; -use std::io::{Read, Write}; -use std::net::Shutdown; use std::os::unix::fs::PermissionsExt; use std::os::unix::net::{UnixListener, UnixStream}; use std::sync::{Arc, Mutex}; use std::time::Duration; +use amdgpu::pidfile::ports::{sock_file, Command, Response, *}; +use amdgpu::IoFailure; + fn parse_output(entry: DirEntry) -> Option { let ty = entry.file_type().ok()?; if ty.is_dir() { @@ -60,45 +59,7 @@ async fn read_outputs(state: Arc>>) { } } -pub struct Service(UnixStream); - -impl Service { - /// Serialize and send command - pub fn write_response(&mut self, res: Response) { - match ron::to_string(&res) { - Ok(buffer) => match self.0.write_all(buffer.as_bytes()) { - Ok(_) => { - log::info!("Response successfully written") - } - Err(e) => log::warn!("Failed to write response. {:?}", e), - }, - Err(e) => { - log::warn!("Failed to serialize response {:?}. {:?}", res, e) - } - } - } - - /// Read from `.sock` file new line separated commands - pub fn read_command(&mut self) -> Option { - let mut command = String::with_capacity(100); - log::info!("Reading stream..."); - read_line(&mut self.0, &mut command); - if command.is_empty() { - return None; - } - Some(command) - } - - /// Close connection with no operation response - pub fn kill(mut self) { - self.write_response(Response::NoOp); - self.close(); - } - - pub fn close(self) { - let _ = self.0.shutdown(Shutdown::Both); - } -} +pub type Service = amdgpu::pidfile::Service; async fn service(state: Arc>>) { let sock_path = sock_file(); @@ -121,27 +82,8 @@ async fn service(state: Arc>>) { } } -fn read_line(stream: &mut UnixStream, command: &mut String) { - let mut buffer = [0]; - while stream.read_exact(&mut buffer).is_ok() { - if buffer[0] == b'\n' { - break; - } - match std::str::from_utf8(&buffer) { - Ok(s) => { - command.push_str(s); - } - Err(e) => { - log::error!("Failed to read from client. {:?}", e); - let _ = stream.shutdown(Shutdown::Both); - continue; - } - } - } -} - fn handle_connection(stream: UnixStream, state: Arc>>) { - let mut service = Service(stream); + let mut service = Service::new(stream); let command = match service.read_command() { Some(s) => s, diff --git a/amdvold/src/main.rs b/amdvold/src/main.rs index db1a7e4..d4de5b2 100644 --- a/amdvold/src/main.rs +++ b/amdvold/src/main.rs @@ -1,7 +1,6 @@ -use gumdrop::Options; - use amdgpu::utils::ensure_config_dir; use amdgpu_config::voltage::{load_config, Config}; +use gumdrop::Options; use crate::command::VoltageCommand; use crate::error::VoltageError; diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 0000000..9413ba7 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,7 @@ +imports_granularity = "Module" +group_imports = "StdExternalCrate" +reorder_modules = true +reorder_imports = true +use_field_init_shorthand = true +wrap_comments = true +edition = "2021"