diff --git a/Cargo.lock b/Cargo.lock index a5746d4..219c75a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,18 +4,18 @@ version = 3 [[package]] name = "addr2line" -version = "0.22.0" +version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +checksum = "f5fb1d8e4442bd405fdfd1dacb42792696b0cf9cb15882e5d097b742a676d375" dependencies = [ "gimli", ] [[package]] -name = "adler" -version = "1.0.2" +name = "adler2" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" +checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "aho-corasick" @@ -43,9 +43,9 @@ dependencies = [ [[package]] name = "anstream" -version = "0.6.14" +version = "0.6.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" +checksum = "64e15c1ab1f89faffbf04a634d5e1962e9074f2741eef6d97f3c4e322426d526" dependencies = [ "anstyle", "anstyle-parse", @@ -58,49 +58,49 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.7" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "038dfcf04a5feb68e9c60b21c9625a54c2c0616e79b72b0fd87075a056ae1d1b" +checksum = "1bec1de6f59aedf83baf9ff929c98f2ad654b97c9510f4e70cf6f661d49fd5b1" [[package]] name = "anstyle-parse" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" +checksum = "eb47de1e80c2b463c735db5b217a0ddc39d612e7ac9e2e96a5aed1f57616c1cb" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.0" +version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad186efb764318d35165f1758e7dcef3b10628e26d41a44bc5550652e6804391" +checksum = "6d36fc52c7f6c869915e99412912f22093507da8d9e942ceaf66fe4b7c14422a" dependencies = [ - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "anstyle-wincon" -version = "3.0.3" +version = "3.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61a38449feb7068f52bb06c12759005cf459ee52bb4adc1d5a7c4322d716fb19" +checksum = "5bf74e1b6e971609db8ca7a9ce79fd5768ab6ae46441c572e46cf596f59e57f8" dependencies = [ "anstyle", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "anyhow" -version = "1.0.86" +version = "1.0.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3d1d046238990b9cf5bcde22a3fb3584ee5cf65fb2765f454ed428c7a0063da" +checksum = "86fdf8605db99b54d3cd748a44c6d04df638eb5dafb219b135d0149bd0db01f6" [[package]] name = "ash" -version = "0.37.3+1.3.251" +version = "0.38.0+1.3.281" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" [[package]] name = "autocfg" @@ -110,17 +110,17 @@ checksum = "0c4b4d0bd25bd0b74681c0ad21497610ce1b7c91b1022cd21c80c6fbdd9476b0" [[package]] name = "backtrace" -version = "0.3.73" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc23269a4f8976d0a4d2e7109211a419fe30e8d88d677cd60b6bc79c5732e0a" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets", ] [[package]] @@ -172,9 +172,12 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "cc" -version = "1.1.5" +version = "1.1.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "324c74f2155653c90b04f25b2a47a8a631360cb908f92a772695f430c7e31052" +checksum = "2d74707dde2ba56f86ae90effb3b43ddd369504387e718014de010cec7959800" +dependencies = [ + "shlex", +] [[package]] name = "cexpr" @@ -202,7 +205,7 @@ dependencies = [ "js-sys", "num-traits", "wasm-bindgen", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -218,9 +221,9 @@ dependencies = [ [[package]] name = "colorchoice" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b6a852b24ab71dffc585bcb46eaf7959d175cb865a7152e35b348d1b2960422" +checksum = "d3fd119d74b830634cea2a0f58bbd0d54540518a14397557951e79340abc28c0" [[package]] name = "core-foundation" @@ -234,9 +237,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.6" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] name = "core-graphics" @@ -330,9 +333,9 @@ dependencies = [ [[package]] name = "ddc-winapi" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "015df0d6d814ea948e012977760324da6d103ec8d67c971c75a6daa3b4fc943f" +checksum = "5b65693556bdf54c77e0c82db4951686e4f030e7eb1c643d1bc781de2a4bce35" dependencies = [ "ddc", "widestring", @@ -383,9 +386,9 @@ checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" [[package]] name = "env_filter" -version = "0.1.0" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a009aa4810eb158359dda09d0c87378e4bbb89b5a801f016885a4707ba24f7ea" +checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" dependencies = [ "log", "regex", @@ -393,9 +396,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.3" +version = "0.11.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38b35839ba51819680ba087cd351788c9a3c476841207e0b8cee0b04722343b9" +checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" dependencies = [ "anstream", "anstyle", @@ -417,7 +420,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -461,9 +464,9 @@ checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d" [[package]] name = "gimli" -version = "0.29.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +checksum = "32085ea23f3234fc7846555e85283ba4de91e21016dc0455a16286d87a292d64" [[package]] name = "glob" @@ -477,13 +480,19 @@ version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +[[package]] +name = "hermit-abi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" + [[package]] name = "home" version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3d1354bf6b7235cb4a0576c2619fd4ed18183f689b12b006a0ee7329eeff9a5" dependencies = [ - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -527,9 +536,9 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.60" +version = "0.1.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7ffbb5a1b541ea2561f8c41c087286cc091e21e556a4f09a8f6cbf17b69b141" +checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -550,9 +559,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.2.6" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26" +checksum = "68b900aa2f7301e21c36462b170ee99994de34dff39a4a6a528e80e7376d07e5" dependencies = [ "equivalent", "hashbrown", @@ -560,11 +569,11 @@ dependencies = [ [[package]] name = "inotify" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd168d97690d0b8c412d6b6c10360277f4d7ee495c5d0d5d5fe0854923255cc" +checksum = "f37dccff2791ab604f9babef0ba14fbe0be30bd368dc541e2b08d07c8aa908f3" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "futures-core", "inotify-sys", "libc", @@ -592,9 +601,9 @@ dependencies = [ [[package]] name = "is_terminal_polyfill" -version = "1.70.0" +version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8478577c03552c21db0e2724ffb8986a5ce7af88107e6be5d2ee6e158c12800" +checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" [[package]] name = "itertools" @@ -613,18 +622,18 @@ checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.69" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "29c15563dc2726973df627357ce0c9ddddbea194836909d655df6a75d2cf296d" +checksum = "1868808506b929d7b0cfa8f75951347aa71bb21144b7791bae35d9bccfcfe37a" dependencies = [ "wasm-bindgen", ] [[package]] name = "lazy_static" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" [[package]] name = "lazycell" @@ -634,9 +643,9 @@ checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.155" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97b3888a4aecf77e811145cadf6eef5901f4782c53886191b2f693f24761847c" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libdbus-sys" @@ -649,12 +658,12 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.4" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e310b3a6b5907f99202fcdb4960ff45b93735d7c7d96b760fcff8db2dc0e103d" +checksum = "4979f22fdb869068da03c9f7528f8297c6fd2606bc3a4affe42e6a823fdb8da4" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -767,34 +776,34 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8a240ddb74feaf34a79a7add65a741f3167852fba007066dcac1ca548d89c08" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.11" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "mockall" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43766c2b5203b10de348ffe19f7e54564b64f3d6018ff7648d1e2d6d3a0f0a48" +checksum = "d4c28b3fb6d753d28c20e826cd46ee611fda1cf3cde03a443a974043247c065a" dependencies = [ "cfg-if", "downcast", "fragile", - "lazy_static", "mockall_derive", "predicates", "predicates-tree", @@ -802,9 +811,9 @@ dependencies = [ [[package]] name = "mockall_derive" -version = "0.12.1" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af7cbce79ec385a1d4f54baa90a76401eb15d9cab93685f62e7e9f942aa00ae2" +checksum = "341014e7f530314e9a1fdbc7400b244efea7122662c96bfa248c31da5bfb2020" dependencies = [ "cfg-if", "proc-macro2", @@ -876,9 +885,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.1" +version = "0.36.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "081b846d1d56ddfc18fdf1a922e4f6e07a11768ea1b92dec44e42b72712ccfce" +checksum = "084f1a5821ac4c651660a94a7153d27ac9d8a53736203f58b31945ded098070a" dependencies = [ "memchr 2.7.4", ] @@ -909,9 +918,9 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "predicates" -version = "3.1.0" +version = "3.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68b87bfd4605926cdfefc1c3b5f8fe560e3feca9d5552cf68c466d3d8236c7e8" +checksum = "7e9086cc7640c29a356d1a29fd134380bee9d8f79a17410aa76e7ad295f42c97" dependencies = [ "anstyle", "predicates-core", @@ -919,15 +928,15 @@ dependencies = [ [[package]] name = "predicates-core" -version = "1.0.6" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b794032607612e7abeb4db69adb4e33590fa6cf1149e95fd7cb00e634b92f174" +checksum = "ae8177bee8e75d6846599c6b9ff679ed51e882816914eec639944d7c9aa11931" [[package]] name = "predicates-tree" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "368ba315fb8c5052ab692e68a0eefec6ec57b23a36959c14496f0b0df2c0cecf" +checksum = "41b740d195ed3166cd147c8047ec98db0e22ec019eb8eeb76d343b795304fb13" dependencies = [ "predicates-core", "termtree", @@ -935,9 +944,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.20" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f12335488a2f3b0a83b14edad48dca9879ce89b2edd10e80237e4e852dd645e" +checksum = "479cf940fbbb3426c32c5d5176f62ad57549a0bb84773423ba8be9d089f5faba" dependencies = [ "proc-macro2", "syn", @@ -954,18 +963,18 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" dependencies = [ "proc-macro2", ] [[package]] name = "regex" -version = "1.10.5" +version = "1.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b91213439dad192326a0d7c6ee3955910425f441d7038e0d6933b0aec5c4517f" +checksum = "4219d74c6b67a3654a9fbebc4b419e22126d13d2f3c4a07ee0cb61ff79a79619" dependencies = [ "aho-corasick", "memchr 2.7.4", @@ -1013,15 +1022,15 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.34" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70dc5ec042f7a43c4a73241207cecc9873a06d45debb38b329f8541d85c2730f" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -1038,18 +1047,18 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "serde" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.204" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", @@ -1058,9 +1067,9 @@ dependencies = [ [[package]] name = "serde_spanned" -version = "0.6.6" +version = "0.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79e674e01f999af37c49f70a6ede167a8a60b2503e56c5599532a65baa5969a0" +checksum = "eb5b1b31579f3811bf615c144393417496f152e12ac8b7663bf664f4a815306d" dependencies = [ "serde", ] @@ -1109,14 +1118,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] name = "syn" -version = "2.0.71" +version = "2.0.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b146dcf730474b4bcd16c311627b31ede9ab149045db4d6088b3becaea046462" +checksum = "9f35bcdf61fd8e7be6caf75f429fdca8beb3ed76584befb503b1569faee373ed" dependencies = [ "proc-macro2", "quote", @@ -1151,23 +1160,23 @@ dependencies = [ [[package]] name = "tokio" -version = "1.38.1" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb2caba9f80616f438e09748d5acda951967e1ea58508ef53d9c6402485a46df" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "libc", "mio", "pin-project-lite", "socket2", - "windows-sys 0.48.0", + "windows-sys", ] [[package]] name = "toml" -version = "0.8.15" +version = "0.8.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac2caab0bf757388c6c0ae23b3293fdb463fee59434529014f85e3263b995c28" +checksum = "a1ed1f98e3fdc28d6d910e6737ae6ab1a93bf1985935a1193e68f93eeb68d24e" dependencies = [ "serde", "serde_spanned", @@ -1177,18 +1186,18 @@ dependencies = [ [[package]] name = "toml_datetime" -version = "0.6.6" +version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4badfd56924ae69bcc9039335b2e017639ce3f9b001c393c1b2d1ef846ce2cbf" +checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" dependencies = [ "serde", ] [[package]] name = "toml_edit" -version = "0.22.16" +version = "0.22.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "278f3d518e152219c994ce877758516bca5e118eaed6996192a774fb9fbf0788" +checksum = "3b072cee73c449a636ffd6f32bd8de3a9f7119139aff882f44943ce2986dc5cf" dependencies = [ "indexmap", "serde", @@ -1209,9 +1218,9 @@ dependencies = [ [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "e91b56cd4cadaeb79bbf1a5645f6b4f8dc5bde8834ad5894a8db35fda9efa1fe" [[package]] name = "uninitialized" @@ -1265,19 +1274,20 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4be2531df63900aeb2bca0daaaddec08491ee64ceecbee5076636a3b026795a8" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "614d787b966d3989fa7bb98a654e369c762374fd3213d212cfc0251257e747da" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", @@ -1290,9 +1300,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1f8823de937b71b9460c0c34e25f3da88250760bec0ebac694b49997550d726" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1300,9 +1310,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e94f17b526d0a461a191c78ea52bbce64071ed5c04c9ffe424dcb38f74171bb7" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", @@ -1313,9 +1323,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.92" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af190c94f2773fdb3729c55b007a722abb5384da03bc0986df4c289bf5567e96" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "wayland-client" @@ -1425,16 +1435,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", + "windows-targets", ] [[package]] @@ -1443,22 +1444,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets", ] [[package]] @@ -1467,46 +1453,28 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -1519,48 +1487,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -1569,17 +1513,18 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.13" +version = "0.6.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b5e5f6c299a3c7890b876a2a587f3115162487e704907d9b6cd29473052ba1" +checksum = "68a9bda4691f099d435ad181000724da8e5899daa10713c2d432552b9ccd3a6f" dependencies = [ "memchr 2.7.4", ] [[package]] name = "wluma" -version = "4.4.0" +version = "4.4.1" dependencies = [ + "anyhow", "ash", "chrono", "dbus", @@ -1607,9 +1552,9 @@ checksum = "213b7324336b53d2414b2db8537e56544d981803139155afa84f76eeebb7a546" [[package]] name = "xml-rs" -version = "0.8.20" +version = "0.8.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "791978798f0597cfc70478424c2b4fdc2b7a8024aaff78497ef00f24ef674193" +checksum = "af4e2e2f7cba5a093896c1e150fbfe177d1883e7448200efb81d40b9d339ef26" [[package]] name = "yaml-rust" diff --git a/Cargo.toml b/Cargo.toml index b89e15d..2af28f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,26 +1,27 @@ [package] name = "wluma" -version = "4.4.0" +version = "4.4.1" authors = ["Maxim Baz", "Cyril Levis"] edition = "2021" [dependencies] +ash = { version = "~0.38", features = ["linked"], default-features = false } wayland-client = { version = "~0.29", features = ["dlopen"] } wayland-protocols = { version = "~0.29", features = ["client", "unstable_protocols"] } serde = { version = "~1.0", features = ["derive"] } serde_yaml = "~0.9" toml = "~0.8" chrono = "~0.4" -ash = { version = "~0.37", features = ["linked"], default-features = false } itertools = "~0.13" v4l = { version = "~0.14", features = ["libv4l"], default-features = false } ddc-hi = "~0.4" log = "~0.4" env_logger = "~0.11" -inotify = "~0.10" -lazy_static = "~1.4" +inotify = "~0.11" +lazy_static = "~1.5" xdg = "~2.5" dbus = "~0.9" +anyhow = "~1.0" [dev-dependencies] -mockall = "0.12" +mockall = "0.13" diff --git a/src/frame/vulkan.rs b/src/frame/vulkan.rs index 76c431f..96dcab9 100644 --- a/src/frame/vulkan.rs +++ b/src/frame/vulkan.rs @@ -32,7 +32,7 @@ pub struct Vulkan { impl Vulkan { pub fn new() -> Result> { let app_name = CString::new("wluma")?; - let app_info = vk::ApplicationInfo::builder() + let app_info = vk::ApplicationInfo::default() .application_name(&app_name) .application_version(WLUMA_VERSION) .engine_name(&app_name) @@ -40,45 +40,44 @@ impl Vulkan { .api_version(VULKAN_VERSION); let instance_extensions = &[ - vk::KhrExternalMemoryCapabilitiesFn::name().as_ptr(), - vk::KhrGetPhysicalDeviceProperties2Fn::name().as_ptr(), + vk::KHR_EXTERNAL_MEMORY_CAPABILITIES_NAME.as_ptr(), + vk::KHR_GET_PHYSICAL_DEVICE_PROPERTIES2_NAME.as_ptr(), ]; let entry = Entry::linked(); - let create_info = vk::InstanceCreateInfo::builder() + let create_info = vk::InstanceCreateInfo::default() .application_info(&app_info) .enabled_extension_names(instance_extensions); let instance = unsafe { entry .create_instance(&create_info, None) - .map_err(|e| Box::new(e) as Box)? + .map_err(anyhow::Error::msg)? }; let physical_devices = unsafe { instance .enumerate_physical_devices() - .map_err(|e| Box::new(e) as Box)? + .map_err(anyhow::Error::msg)? }; let physical_device = *physical_devices .first() .ok_or("Unable to find a physical device")?; let queue_family_index = 0; - let queue_info = &[vk::DeviceQueueCreateInfo::builder() + let queue_info = &[vk::DeviceQueueCreateInfo::default() .queue_family_index(queue_family_index) - .queue_priorities(&[1.0]) - .build()]; + .queue_priorities(&[1.0])]; let device_extensions = &[ - vk::KhrExternalMemoryFn::name().as_ptr(), - vk::KhrExternalMemoryFdFn::name().as_ptr(), - vk::ExtExternalMemoryDmaBufFn::name().as_ptr(), + vk::KHR_EXTERNAL_MEMORY_CAPABILITIES_NAME.as_ptr(), + vk::KHR_EXTERNAL_MEMORY_FD_NAME.as_ptr(), + vk::EXT_EXTERNAL_MEMORY_DMA_BUF_NAME.as_ptr(), ]; - let features = vk::PhysicalDeviceFeatures::builder(); + let features = vk::PhysicalDeviceFeatures::default(); - let device_create_info = vk::DeviceCreateInfo::builder() + let device_create_info = vk::DeviceCreateInfo::default() .queue_create_infos(queue_info) .enabled_extension_names(device_extensions) .enabled_features(&features); @@ -86,18 +85,22 @@ impl Vulkan { let device = unsafe { instance .create_device(physical_device, &device_create_info, None) - .map_err(|e| Box::new(e) as Box)? + .map_err(anyhow::Error::msg)? }; let queue = unsafe { device.get_device_queue(queue_family_index, 0) }; - let pool_create_info = vk::CommandPoolCreateInfo::builder() + let pool_create_info = vk::CommandPoolCreateInfo::default() .flags(vk::CommandPoolCreateFlags::RESET_COMMAND_BUFFER) .queue_family_index(queue_family_index); - let command_pool = unsafe { device.create_command_pool(&pool_create_info, None)? }; + let command_pool = unsafe { + device + .create_command_pool(&pool_create_info, None) + .map_err(anyhow::Error::msg)? + }; - let command_buffer_allocate_info = vk::CommandBufferAllocateInfo::builder() + let command_buffer_allocate_info = vk::CommandBufferAllocateInfo::default() .command_buffer_count(1) .command_pool(command_pool) .level(vk::CommandBufferLevel::PRIMARY); @@ -105,10 +108,10 @@ impl Vulkan { let command_buffers = unsafe { device .allocate_command_buffers(&command_buffer_allocate_info) - .map_err(|e| Box::new(e) as Box)? + .map_err(anyhow::Error::msg)? }; - let buffer_info = vk::BufferCreateInfo::builder() + let buffer_info = vk::BufferCreateInfo::default() .size(BUFFER_PIXELS) .usage(vk::BufferUsageFlags::TRANSFER_DST) .sharing_mode(vk::SharingMode::EXCLUSIVE); @@ -116,7 +119,7 @@ impl Vulkan { let buffer = unsafe { device .create_buffer(&buffer_info, None) - .map_err(|e| Box::new(e) as Box)? + .map_err(anyhow::Error::msg)? }; let buffer_memory_req = unsafe { device.get_buffer_memory_requirements(buffer) }; @@ -140,20 +143,20 @@ impl Vulkan { let buffer_memory = unsafe { device .allocate_memory(&allocate_info, None) - .map_err(|e| Box::new(e) as Box)? + .map_err(anyhow::Error::msg)? }; unsafe { device .bind_buffer_memory(buffer, buffer_memory, 0) - .map_err(|e| Box::new(e) as Box)? + .map_err(anyhow::Error::msg)? }; - let fence_create_info = vk::FenceCreateInfo::builder(); + let fence_create_info = vk::FenceCreateInfo::default(); let fence = unsafe { device .create_fence(&fence_create_info, None) - .map_err(|e| Box::new(e) as Box)? + .map_err(anyhow::Error::msg)? }; Ok(Self { @@ -205,12 +208,15 @@ impl Vulkan { let pixels = mip_width as usize * mip_height as usize; let rgbas = unsafe { - let buffer_pointer = self.device.map_memory( - self.buffer_memory, - 0, - vk::WHOLE_SIZE, - vk::MemoryMapFlags::empty(), - )?; + let buffer_pointer = self + .device + .map_memory( + self.buffer_memory, + 0, + vk::WHOLE_SIZE, + vk::MemoryMapFlags::empty(), + ) + .map_err(anyhow::Error::msg)?; std::slice::from_raw_parts(buffer_pointer as *mut u8, pixels * 4) }; @@ -220,7 +226,7 @@ impl Vulkan { self.device.unmap_memory(self.buffer_memory); self.device .reset_fences(&[self.fence]) - .map_err(|e| Box::new(e) as Box)?; + .map_err(anyhow::Error::msg)?; self.device.destroy_image(frame_image, None); self.device.free_memory(frame_image_memory, None); } @@ -231,7 +237,7 @@ impl Vulkan { fn init_image(&self, frame: &Object) -> Result<(), Box> { let (width, height, mip_levels) = image_dimensions(frame); - let image_create_info = vk::ImageCreateInfo::builder() + let image_create_info = vk::ImageCreateInfo::default() .image_type(vk::ImageType::TYPE_2D) .format(vk::Format::B8G8R8A8_UNORM) .extent(vk::Extent3D { @@ -247,18 +253,28 @@ impl Vulkan { .usage(vk::ImageUsageFlags::TRANSFER_DST | vk::ImageUsageFlags::TRANSFER_SRC) .sharing_mode(vk::SharingMode::EXCLUSIVE); - let image = unsafe { self.device.create_image(&image_create_info, None)? }; + let image = unsafe { + self.device + .create_image(&image_create_info, None) + .map_err(anyhow::Error::msg)? + }; let image_memory_req = unsafe { self.device.get_image_memory_requirements(image) }; - let image_allocate_info = vk::MemoryAllocateInfo::builder() + let image_allocate_info = vk::MemoryAllocateInfo::default() .allocation_size(image_memory_req.size) .memory_type_index(0); - let image_memory = unsafe { self.device.allocate_memory(&image_allocate_info, None)? }; + let image_memory = unsafe { + self.device + .allocate_memory(&image_allocate_info, None) + .map_err(anyhow::Error::msg)? + }; unsafe { - self.device.bind_image_memory(image, image_memory, 0)?; - } + self.device + .bind_image_memory(image, image_memory, 0) + .map_err(anyhow::Error::msg)? + }; self.image.borrow_mut().replace(image); self.image_memory.borrow_mut().replace(image_memory); @@ -272,10 +288,12 @@ impl Vulkan { &self, frame: &Object, ) -> Result<(vk::Image, vk::DeviceMemory), Box> { - let mut frame_image_memory_info = vk::ExternalMemoryImageCreateInfo::builder() + // External memory info + let mut frame_image_memory_info = vk::ExternalMemoryImageCreateInfo::default() .handle_types(vk::ExternalMemoryHandleTypeFlags::DMA_BUF_EXT); - let frame_image_create_info = vk::ImageCreateInfo::builder() + // Image create info + let frame_image_create_info = vk::ImageCreateInfo::default() .push_next(&mut frame_image_memory_info) .image_type(vk::ImageType::TYPE_2D) .format(vk::Format::R8G8B8A8_UNORM) @@ -292,16 +310,22 @@ impl Vulkan { .usage(vk::ImageUsageFlags::TRANSFER_SRC) .sharing_mode(vk::SharingMode::EXCLUSIVE); - let frame_image = unsafe { self.device.create_image(&frame_image_create_info, None)? }; + let frame_image = unsafe { + self.device + .create_image(&frame_image_create_info, None) + .map_err(anyhow::Error::msg)? + }; + // Memory requirements info let frame_image_memory_req_info = - vk::ImageMemoryRequirementsInfo2::builder().image(frame_image); + vk::ImageMemoryRequirementsInfo2::default().image(frame_image); - // Prepare the structures to get memory requirements into, then get the requirements + // Prepare the structures to get memory requirements into, then get the memory requirements let mut frame_image_mem_dedicated_req = vk::MemoryDedicatedRequirements::default(); - let mut frame_image_mem_req = vk::MemoryRequirements2::builder() - .push_next(&mut frame_image_mem_dedicated_req) - .build(); + + let mut frame_image_mem_req = + vk::MemoryRequirements2::default().push_next(&mut frame_image_mem_dedicated_req); + unsafe { self.device.get_image_memory_requirements2( &frame_image_memory_req_info, @@ -312,21 +336,26 @@ impl Vulkan { // Bit i in memory_type_bits is set if the ith memory type in the // VkPhysicalDeviceMemoryProperties structure is supported for the image memory. // We just use the first type supported (from least significant bit's side) + + // Find suitable memory type index let memory_type_index = frame_image_mem_req .memory_requirements .memory_type_bits .trailing_zeros(); + // Import memory app_info // Construct the memory alloctation info according to the requirements // If the image needs dedicated memory, add MemoryDedicatedAllocateInfo to the info chain - let mut frame_import_memory_info = vk::ImportMemoryFdInfoKHR::builder() + let mut frame_import_memory_info = vk::ImportMemoryFdInfoKHR::default() .handle_type(vk::ExternalMemoryHandleTypeFlags::DMA_BUF_EXT) .fd(frame.fds[0]); + // dedicated allocation info let mut frame_image_memory_dedicated_info = - vk::MemoryDedicatedAllocateInfo::builder().image(frame_image); + vk::MemoryDedicatedAllocateInfo::default().image(frame_image); - let mut frame_image_allocate_info = vk::MemoryAllocateInfo::builder() + // Memory allocate info + let mut frame_image_allocate_info = vk::MemoryAllocateInfo::default() .push_next(&mut frame_import_memory_info) .allocation_size(frame_image_mem_req.memory_requirements.size) .memory_type_index(memory_type_index); @@ -336,16 +365,18 @@ impl Vulkan { frame_image_allocate_info.push_next(&mut frame_image_memory_dedicated_info); } - // Allocate the memory and bind it to the image + // Allocate memory and bind it to the image let frame_image_memory = unsafe { self.device - .allocate_memory(&frame_image_allocate_info, None)? + .allocate_memory(&frame_image_allocate_info, None) + .map_err(anyhow::Error::msg)? }; unsafe { self.device - .bind_image_memory(frame_image, frame_image_memory, 0)?; - } + .bind_image_memory(frame_image, frame_image_memory, 0) + .map_err(anyhow::Error::msg)?; + }; Ok((frame_image, frame_image_memory)) } @@ -362,17 +393,16 @@ impl Vulkan { dst_access_mask: vk::AccessFlags, src_stage_mask: vk::PipelineStageFlags, ) { - let image_barrier = vk::ImageMemoryBarrier::builder() + let image_barrier = vk::ImageMemoryBarrier::default() .old_layout(old_layout) .new_layout(new_layout) .image(*image) .subresource_range( - vk::ImageSubresourceRange::builder() + vk::ImageSubresourceRange::default() .aspect_mask(vk::ImageAspectFlags::COLOR) .base_mip_level(base_mip_level) .level_count(mip_levels) - .layer_count(1) - .build(), + .layer_count(1), ) .src_access_mask(src_access_mask) .dst_access_mask(dst_access_mask); @@ -385,7 +415,7 @@ impl Vulkan { vk::DependencyFlags::empty(), &[], &[], - &[image_barrier.build()], + &[image_barrier], ); } } @@ -402,7 +432,7 @@ impl Vulkan { dst_height: u32, dst_mip_level: u32, ) { - let blit_info = vk::ImageBlit::builder() + let blit_info = vk::ImageBlit::default() .src_offsets([ vk::Offset3D { x: 0, y: 0, z: 0 }, vk::Offset3D { @@ -412,11 +442,10 @@ impl Vulkan { }, ]) .src_subresource( - vk::ImageSubresourceLayers::builder() + vk::ImageSubresourceLayers::default() .aspect_mask(vk::ImageAspectFlags::COLOR) .mip_level(src_mip_level) - .layer_count(1) - .build(), + .layer_count(1), ) .dst_offsets([ vk::Offset3D { x: 0, y: 0, z: 0 }, @@ -427,11 +456,10 @@ impl Vulkan { }, ]) .dst_subresource( - vk::ImageSubresourceLayers::builder() + vk::ImageSubresourceLayers::default() .aspect_mask(vk::ImageAspectFlags::COLOR) .mip_level(dst_mip_level) - .layer_count(1) - .build(), + .layer_count(1), ); unsafe { @@ -441,7 +469,7 @@ impl Vulkan { vk::ImageLayout::TRANSFER_SRC_OPTIMAL, *dst_image, vk::ImageLayout::TRANSFER_DST_OPTIMAL, - &[blit_info.build()], + &[blit_info], vk::Filter::LINEAR, ); } @@ -534,13 +562,12 @@ impl Vulkan { vk::PipelineStageFlags::TRANSFER, ); - let buffer_image_copy = vk::BufferImageCopy::builder() + let buffer_image_copy = vk::BufferImageCopy::default() .image_subresource( - vk::ImageSubresourceLayers::builder() + vk::ImageSubresourceLayers::default() .aspect_mask(vk::ImageAspectFlags::COLOR) .mip_level(mip_level) - .layer_count(1) - .build(), + .layer_count(1), ) .image_offset(vk::Offset3D { x: 0, y: 0, z: 0 }) .image_extent(vk::Extent3D { @@ -555,39 +582,44 @@ impl Vulkan { *image, vk::ImageLayout::TRANSFER_SRC_OPTIMAL, self.buffer, - &[buffer_image_copy.build()], + &[buffer_image_copy], ); } } fn begin_commands(&self) -> Result<(), Box> { - let command_buffer_info = vk::CommandBufferBeginInfo::builder() + let command_buffer_info = vk::CommandBufferBeginInfo::default() .flags(vk::CommandBufferUsageFlags::ONE_TIME_SUBMIT); unsafe { self.device - .begin_command_buffer(self.command_buffers[0], &command_buffer_info)? - }; + .begin_command_buffer(self.command_buffers[0], &command_buffer_info) + .map_err(anyhow::Error::msg)?; + } Ok(()) } fn submit_commands(&self) -> Result<(), Box> { unsafe { + // End the command buffer self.device .end_command_buffer(self.command_buffers[0]) - .map_err(|e| Box::new(e) as Box)? + .map_err(anyhow::Error::msg)?; }; - let submit_info = vk::SubmitInfo::builder().command_buffers(&self.command_buffers); + let submit_info = vk::SubmitInfo::default().command_buffers(&self.command_buffers); unsafe { + // Submit the command buffers to the queue self.device - .queue_submit(self.queue, &[submit_info.build()], self.fence) - .map_err(|e| Box::new(e) as Box)?; + .queue_submit(self.queue, &[submit_info], self.fence) + .map_err(anyhow::Error::msg)?; + + // Wait for the fences self.device .wait_for_fences(&[self.fence], true, FENCES_TIMEOUT_NS) - .map_err(|e| Box::new(e) as Box)?; + .map_err(anyhow::Error::msg)?; } Ok(())