diff --git a/Cargo.lock b/Cargo.lock index 4cb46d6..8201647 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,71 +1,63 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. [[package]] -name = "adler32" -version = "1.0.4" +name = "ab_glyph_rasterizer" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d2e7343e7fc9de883d1b0341e0b13970f764c14101234857d2ddafa1cb1cac2" +checksum = "d9fe5e32de01730eb1f6b7f5b51c17e03e2325bf40a74f754f04f130043affff" + +[[package]] +name = "adler32" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aae1277d39aeec15cb388266ecc24b11c80469deae6067e17a1a7aa9e5c1f234" [[package]] name = "andrew" -version = "0.2.1" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" +checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" dependencies = [ "bitflags", - "line_drawing", - "rusttype 0.7.9", + "rusttype", "walkdir", "xdg", "xml-rs", ] -[[package]] -name = "android_log-sys" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8052e2d8aabbb8d556d6abbcce2a22b9590996c5f849b9c7ce4544a2e3b984e" - [[package]] name = "ansi_term" version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" dependencies = [ - "winapi 0.3.8", -] - -[[package]] -name = "approx" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" -dependencies = [ - "num-traits", + "winapi 0.3.9", ] [[package]] name = "arrayvec" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff77d8686867eceff3105329d4698d96c2391c176d5d03adc90c7389162b5b8" +checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" [[package]] name = "ash" -version = "0.30.0" +version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69daec0742947f33a85931fa3cb0ce5f07929159dcbd1f0cbb5b2912e2978509" +checksum = "c69a8137596e84c22d57f3da1b5de1d4230b1742a710091c85f4d7ce50f00f38" dependencies = [ - "libloading 0.5.2", + "libloading", ] [[package]] name = "ash-window" -version = "0.3.0" -source = "git+https://github.com/norse-rs/ash-window.git?branch=dyn_trait#ff8cd779b339067f00e808add1203f6c0d074ba5" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "905c4ca25f752e7ab3c3e8f2882625f876e4c3ea5feffbc83f81d697e043afd6" dependencies = [ "ash", "raw-window-handle", + "raw-window-metal", ] [[package]] @@ -76,15 +68,9 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.8", + "winapi 0.3.9", ] -[[package]] -name = "autocfg" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" - [[package]] name = "bitflags" version = "1.2.1" @@ -105,20 +91,19 @@ checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "calloop" -version = "0.4.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aa2097be53a00de9e8fc349fea6d76221f398f5c4fa550d420669906962d160" +checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" dependencies = [ - "mio", - "mio-extras", + "log", "nix", ] [[package]] name = "cc" -version = "1.0.54" +version = "1.0.62" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bbb73db36c1246e9034e307d0fba23f9a2e251faa47ade70c1bd252220c8311" +checksum = "f1770ced377336a88a67c473594ccc14eca6f4559217c34f64aac8f83d641b40" [[package]] name = "cfg-if" @@ -127,15 +112,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" [[package]] -name = "clap" -version = "2.33.1" +name = "cfg-if" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bdfa80d47f954d53a35a64987ca1422f495b8d6483c0fe9f7117b36c2a792129" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "clap" +version = "2.33.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" dependencies = [ "ansi_term", "atty", "bitflags", - "strsim", + "strsim 0.8.0", "textwrap", "unicode-width", "vec_map", @@ -143,23 +134,54 @@ dependencies = [ [[package]] name = "cloudabi" -version = "0.0.3" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +checksum = "4344512281c643ae7638bbabc3af17a11307803ec8f0fcad9fae512a8bf36467" dependencies = [ "bitflags", ] [[package]] name = "cocoa" -version = "0.20.1" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f7b6f3f7f4f0b3ec5c5039aaa9e8c3cef97a7a480a400fd62944841314f293d" +checksum = "0c49e86fc36d5704151f5996b7b3795385f50ce09e3be0f47a0cfde869681cf8" dependencies = [ "bitflags", "block", - "core-foundation", - "core-graphics", + "core-foundation 0.7.0", + "core-graphics 0.19.2", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c54201c07dcf3a5ca33fececb8042aed767ee4bfd5a0235a8ceabcda956044b2" +dependencies = [ + "bitflags", + "block", + "cocoa-foundation", + "core-foundation 0.9.1", + "core-graphics 0.22.1", + "foreign-types", + "libc", + "objc", +] + +[[package]] +name = "cocoa-foundation" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" +dependencies = [ + "bitflags", + "block", + "core-foundation 0.9.1", + "core-graphics-types", "foreign-types", "libc", "objc", @@ -171,7 +193,17 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" dependencies = [ - "core-foundation-sys", + "core-foundation-sys 0.7.0", + "libc", +] + +[[package]] +name = "core-foundation" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +dependencies = [ + "core-foundation-sys 0.8.2", "libc", ] @@ -182,13 +214,44 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] -name = "core-graphics" -version = "0.19.0" +name = "core-foundation-sys" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59e78b2e0aaf43f08e7ae0d6bc96895ef72ff0921c7d4ff4762201b2dba376dd" +checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" + +[[package]] +name = "core-graphics" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b3889374e6ea6ab25dba90bb5d96202f61108058361f6dc72e8b03e6f8bbe923" dependencies = [ "bitflags", - "core-foundation", + "core-foundation 0.7.0", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc239bba52bab96649441699533a68de294a101533b0270b2d65aa402b29a7f9" +dependencies = [ + "bitflags", + "core-foundation 0.9.1", + "core-graphics-types", + "foreign-types", + "libc", +] + +[[package]] +name = "core-graphics-types" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +dependencies = [ + "bitflags", + "core-foundation 0.9.1", "foreign-types", "libc", ] @@ -199,27 +262,62 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" dependencies = [ - "cfg-if", - "core-foundation-sys", - "core-graphics", + "cfg-if 0.1.10", + "core-foundation-sys 0.7.0", + "core-graphics 0.19.2", "libc", "objc", ] [[package]] name = "crc32fast" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +checksum = "81156fece84ab6a9f2afdb109ce3ae577e42b1228441eded99bd77f627953b1a" dependencies = [ - "cfg-if", + "cfg-if 1.0.0", +] + +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.9.3", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core", + "quote", + "syn", ] [[package]] name = "deflate" -version = "0.8.4" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7e5d2a2273fed52a7f947ee55b092c4057025d7a3e04e5ecdbd25d6c3fb1bd7" +checksum = "73770f8e1fe7d64df17ca66ad28994a0a623ea497fa69486e14984e715c5d174" dependencies = [ "adler32", "byteorder", @@ -231,8 +329,8 @@ version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", + "proc-macro2", + "quote", "syn", ] @@ -248,14 +346,20 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b11f15d1e3268f140f68d390637d5e76d849782d971ae7063e0da69fe9709a76" dependencies = [ - "libloading 0.6.2", + "libloading", ] [[package]] name = "downcast-rs" -version = "1.1.1" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52ba6eb47c2131e784a38b726eb54c1e1484904f013e576a25354d0124161af6" +checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foreign-types" @@ -290,11 +394,11 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "getrandom" -version = "0.1.14" +version = "0.1.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" +checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", "wasi", ] @@ -307,27 +411,27 @@ checksum = "d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177" [[package]] name = "hermit-abi" -version = "0.1.13" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91780f809e750b0a89f5544be56617ff6b1227ee485bcb06ebe10cdf89bd3b71" +checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" dependencies = [ "libc", ] [[package]] -name = "inflate" -version = "0.4.5" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cdb29978cc5797bd8dcc8e5bf7de604891df2a8dc576973d71a281e916db2ff" -dependencies = [ - "adler32", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "instant" -version = "0.1.4" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7777a24a1ce5de49fcdde84ec46efa487c3af49d5b6e6e0a50367cc5c1096182" +checksum = "cb1fc4429a33e1f80d41dc9fea4d108a88bec1de8053878898ae448a0b52f613" +dependencies = [ + "cfg-if 1.0.0", +] [[package]] name = "iovec" @@ -356,9 +460,9 @@ dependencies = [ [[package]] name = "kurbo" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2520c9c9010461ec2b4573599bca458272319a314fd0b9476cacfcb9b6e5adc8" +checksum = "16cb54cd28cb3d2e964d9444ca185676a94fd9b7cce5f02b22c717947ed8e9a2" dependencies = [ "arrayvec", ] @@ -371,60 +475,42 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lazycell" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.71" +version = "0.2.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9457b06509d27052635f90d6466700c65095fdf75409b3fbdd903e988b886f49" +checksum = "4d58d1b70b004888f764dfbf6a26a3b0342a1632d33968e4a179d8011c760614" [[package]] name = "libloading" -version = "0.5.2" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +checksum = "1090080fe06ec2648d0da3881d9453d97e71a45f00eb179af7fdd7e3f686fdb0" dependencies = [ - "cc", - "winapi 0.3.8", -] - -[[package]] -name = "libloading" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cadb8e769f070c45df05c78c7520eb4cd17061d4ab262e43cfc68b4d00ac71c" -dependencies = [ - "winapi 0.3.8", -] - -[[package]] -name = "line_drawing" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" -dependencies = [ - "num-traits", + "cfg-if 1.0.0", + "winapi 0.3.9", ] [[package]] name = "lock_api" -version = "0.3.4" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" +checksum = "28247cc5a5be2f05fbcd76dd0cf2c7d3b5400cb978a28042abcd4fa0b3f8261c" dependencies = [ "scopeguard", ] [[package]] name = "log" -version = "0.4.8" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" +checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] @@ -436,12 +522,24 @@ dependencies = [ "libc", ] +[[package]] +name = "matches" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" + [[package]] name = "maybe-uninit" version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" +[[package]] +name = "memchr" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" + [[package]] name = "memmap" version = "0.7.0" @@ -449,7 +547,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" dependencies = [ "libc", - "winapi 0.3.8", + "winapi 0.3.9", +] + +[[package]] +name = "miniz_oxide" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "791daaae1ed6889560f8c4359194f56648355540573244a5448a83ba1ecc7435" +dependencies = [ + "adler32", ] [[package]] @@ -458,7 +565,7 @@ version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "fuchsia-zircon", "fuchsia-zircon-sys", "iovec", @@ -497,66 +604,80 @@ dependencies = [ [[package]] name = "ndk" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a356cafe20aee088789830bfea3a61336e84ded9e545e00d3869ce95dcb80c" +checksum = "5eb167c1febed0a496639034d0c76b3b74263636045db5489eee52143c246e73" dependencies = [ "jni-sys", "ndk-sys", "num_enum", + "thiserror", ] [[package]] name = "ndk-glue" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1730ee2e3de41c3321160a6da815f008c4006d71b095880ea50e17cf52332b8" +checksum = "bdf399b8b7a39c6fb153c4ec32c72fd5fe789df24a647f229c239aa7adb15241" dependencies = [ - "android_log-sys", "lazy_static", "libc", "log", "ndk", + "ndk-macro", "ndk-sys", ] [[package]] -name = "ndk-sys" -version = "0.1.0" +name = "ndk-macro" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2820aca934aba5ed91c79acc72b6a44048ceacc5d36c035ed4e051f12d887d" +checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +dependencies = [ + "darling", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ndk-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" [[package]] name = "net2" -version = "0.2.34" +version = "0.2.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ba7c918ac76704fb42afcbbb43891e72731f3dcca3bef2a19786297baf14af7" +checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "nix" -version = "0.14.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" +checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" dependencies = [ "bitflags", "cc", - "cfg-if", + "cfg-if 0.1.10", "libc", - "void", ] [[package]] -name = "num-traits" -version = "0.2.11" +name = "nom" +version = "5.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" +checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" dependencies = [ - "autocfg", + "memchr", + "version_check", ] [[package]] @@ -576,8 +697,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffa5a33ddddfee04c0283a7653987d634e880347e96b5b2ed64de07efb59db9d" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.18", - "quote 1.0.7", + "proc-macro2", + "quote", "syn", ] @@ -592,41 +713,43 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.4.0" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b631f7e854af39a1739f401cf34a8a013dfe09eac4fa4dba91e9768bd28168d" +checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" [[package]] -name = "ordered-float" -version = "1.0.2" +name = "owned_ttf_parser" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18869315e81473c951eb56ad5558bbc56978562d3ecfb87abb7a1e944cea4518" +checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" dependencies = [ - "num-traits", + "ttf-parser", ] [[package]] name = "parking_lot" -version = "0.10.2" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" +checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733" dependencies = [ + "instant", "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" +checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "cloudabi", + "instant", "libc", "redox_syscall", "smallvec", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -637,11 +760,12 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "piet" -version = "0.0.13" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "552531e1eeb85c966172849155b25b555f76c10cc479396579fac058a63269a4" +checksum = "f00543608fb5ee6063f5ff1259246ae23073c1a5e413e643d0469da3d4b7b4de" dependencies = [ "kurbo", + "unic-bidi", ] [[package]] @@ -662,8 +786,8 @@ dependencies = [ name = "piet-gpu-derive" version = "0.0.0" dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", + "proc-macro2", + "quote", "syn", ] @@ -687,62 +811,44 @@ dependencies = [ [[package]] name = "pkg-config" -version = "0.3.17" +version = "0.3.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" +checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" [[package]] name = "png" -version = "0.16.4" +version = "0.16.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "12faa637ed9ae3d3c881332e54b5ae2dba81cda9fc4bbce0faa1ba53abcead50" +checksum = "dfe7f9f1c730833200b134370e1d5098964231af8450bce9b78ee3ab5278b970" dependencies = [ "bitflags", "crc32fast", "deflate", - "inflate", + "miniz_oxide", ] [[package]] name = "ppv-lite86" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "237a5ed80e274dbc66f86bd59c1e25edc039660be53194b5fe0a482e0f2612ea" +checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" [[package]] name = "proc-macro-crate" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e10d4b51f154c8a7fb96fd6dad097cb74b863943ec010ac94b9fd1be8861fe1e" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" dependencies = [ "toml", ] [[package]] name = "proc-macro2" -version = "0.4.30" +version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" +checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" dependencies = [ - "unicode-xid 0.1.0", -] - -[[package]] -name = "proc-macro2" -version = "1.0.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "beae6331a816b1f65d04c45b078fd8e6c93e8071771f41b8163255bbd8d7c8fa" -dependencies = [ - "unicode-xid 0.2.0", -] - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", + "unicode-xid", ] [[package]] @@ -751,7 +857,7 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ - "proc-macro2 1.0.18", + "proc-macro2", ] [[package]] @@ -805,38 +911,40 @@ dependencies = [ ] [[package]] -name = "redox_syscall" -version = "0.1.56" +name = "raw-window-metal" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2439c63f3f6139d1b57529d16bc3b8bb855230c8efcc5d3a896c8bea7c3b1e84" +checksum = "6b0f43bdc87adef4ce827b07775c9e59716b52f369696e7fb4ec7c4acb4e20b1" +dependencies = [ + "cocoa 0.20.2", + "core-graphics 0.19.2", + "objc", + "raw-window-handle", +] + +[[package]] +name = "redox_syscall" +version = "0.1.57" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] name = "roxmltree" -version = "0.11.0" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5001f134077069d87f77c8b9452b690df2445f7a43f1c7ca4a1af8dd505789d" +checksum = "17dfc6c39f846bfc7d2ec442ad12055d79608d501380789b965d22f9354451f2" dependencies = [ "xmlparser", ] [[package]] name = "rusttype" -version = "0.7.9" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" +checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" dependencies = [ - "rusttype 0.8.3", -] - -[[package]] -name = "rusttype" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f61411055101f7b60ecf1041d87fb74205fb20b0c7a723f07ef39174cf6b4c0" -dependencies = [ - "approx", - "ordered-float", - "stb_truetype", + "ab_glyph_rasterizer", + "owned_ttf_parser", ] [[package]] @@ -848,6 +956,12 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "scoped-tls" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" + [[package]] name = "scopeguard" version = "1.1.0" @@ -856,9 +970,9 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.111" +version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9124df5b40cbd380080b2cc6ab894c040a3070d995f5c9dc77e18c34a8ae37d" +checksum = "b88fa983de7720629c9387e9f517353ed404164b1e482c970a90c1a4aaf7dc1a" [[package]] name = "slab" @@ -868,35 +982,30 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "smallvec" -version = "1.4.0" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" +checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" [[package]] name = "smithay-client-toolkit" -version = "0.6.6" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421c8dc7acf5cb205b88160f8b4cc2c5cfabe210e43b2f80f009f4c1ef910f1d" +checksum = "2ec5c077def8af49f9b5aeeb5fcf8079c638c6615c3a8f9305e2dea601de57f7" dependencies = [ "andrew", "bitflags", + "byteorder", + "calloop", "dlib", "lazy_static", + "log", "memmap", "nix", "wayland-client", + "wayland-cursor", "wayland-protocols", ] -[[package]] -name = "stb_truetype" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" -dependencies = [ - "byteorder", -] - [[package]] name = "strsim" version = "0.8.0" @@ -904,14 +1013,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] -name = "syn" -version = "1.0.31" +name = "strsim" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5304cfdf27365b7585c25d4af91b35016ed21ef88f17ced89c7093b43dba8b6" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + +[[package]] +name = "syn" +version = "1.0.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc371affeffc477f42a221a1e4297aedcea33d47d19b61455588bd9d8f6b19ac" dependencies = [ - "proc-macro2 1.0.18", - "quote 1.0.7", - "unicode-xid 0.2.0", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] @@ -924,31 +1039,102 @@ dependencies = [ ] [[package]] -name = "toml" -version = "0.5.6" +name = "thiserror" +version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" +checksum = "0e9ae34b84616eedaaf1e9dd6026dbe00dcafa92aa0c8077cb69df1fcfe5e53e" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "toml" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75cf45bb0bef80604d001caaec0d09da99611b3c0fd39d3080468875cdb65645" dependencies = [ "serde", ] +[[package]] +name = "ttf-parser" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" + +[[package]] +name = "unic-bidi" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1356b759fb6a82050666f11dce4b6fe3571781f1449f3ef78074e408d468ec09" +dependencies = [ + "matches", + "unic-ucd-bidi", +] + +[[package]] +name = "unic-char-property" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221" +dependencies = [ + "unic-char-range", +] + +[[package]] +name = "unic-char-range" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0398022d5f700414f6b899e10b8348231abf9173fa93144cbc1a43b9793c1fbc" + +[[package]] +name = "unic-common" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80d7ff825a6a654ee85a63e80f92f054f904f21e7d12da4e22f9834a4aaa35bc" + +[[package]] +name = "unic-ucd-bidi" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1d568b51222484e1f8209ce48caa6b430bf352962b877d592c29ab31fb53d8c" +dependencies = [ + "unic-char-property", + "unic-char-range", + "unic-ucd-version", +] + +[[package]] +name = "unic-ucd-version" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96bd2f2237fe450fcd0a1d2f5f4e91711124f7857ba2e964247776ebeeb7b0c4" +dependencies = [ + "unic-common", +] + [[package]] name = "unicode-width" -version = "0.1.7" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" +checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" [[package]] name = "unicode-xid" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" - -[[package]] -name = "unicode-xid" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" +checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] name = "vec_map" @@ -957,10 +1143,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" [[package]] -name = "void" -version = "1.0.2" +name = "version_check" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" [[package]] name = "walkdir" @@ -969,7 +1155,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" dependencies = [ "same-file", - "winapi 0.3.8", + "winapi 0.3.9", "winapi-util", ] @@ -981,16 +1167,15 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wayland-client" -version = "0.23.6" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" +checksum = "222b227f47871e47d657c1c5e5360b4af9a877aa9c892716787be1c192c78c42" dependencies = [ "bitflags", - "calloop", "downcast-rs", "libc", - "mio", "nix", + "scoped-tls", "wayland-commons", "wayland-scanner", "wayland-sys", @@ -998,19 +1183,32 @@ dependencies = [ [[package]] name = "wayland-commons" -version = "0.23.6" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb66b0d1a27c39bbce712b6372131c6e25149f03ffb0cd017cf8f7de8d66dbdb" +checksum = "230b3ffeda101f877ff8ecb8573f5d26e7beb345b197807c4df34ec06879a3e6" dependencies = [ "nix", + "once_cell", + "smallvec", "wayland-sys", ] [[package]] -name = "wayland-protocols" -version = "0.23.6" +name = "wayland-cursor" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cc286643656742777d55dc8e70d144fa4699e426ca8e9d4ef454f4bf15ffcf9" +checksum = "0aad1b4301cdccfb5f64056a4736e8155a5f4734bac41fdbca80b1fdbe1ab3e1" +dependencies = [ + "nix", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-protocols" +version = "0.28.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc16a9db803cae58b45f9a84a6cf364434cc49a95c8b1ef98ffeb467d228bdc9" dependencies = [ "bitflags", "wayland-client", @@ -1020,23 +1218,24 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.23.6" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" +checksum = "5ee5bd43a1d746efc486515fec561e47205f328b74802b959f10f5500f7e56cc" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", + "proc-macro2", + "quote", "xml-rs", ] [[package]] name = "wayland-sys" -version = "0.23.6" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" +checksum = "0814adbecc7ea97869971e1d1c1b657e31863dda6fd768f119ad3dc408a01e58" dependencies = [ "dlib", "lazy_static", + "pkg-config", ] [[package]] @@ -1047,9 +1246,9 @@ checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" [[package]] name = "winapi" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ "winapi-i686-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu", @@ -1073,7 +1272,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1084,14 +1283,14 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winit" -version = "0.22.2" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4ccbf7ddb6627828eace16cacde80fc6bf4dbb3469f88487262a02cf8e7862" +checksum = "b5bc559da567d8aa671bbcd08304d49e982c7bf2cb91e10288b9188931c1b772" dependencies = [ "bitflags", - "cocoa", - "core-foundation", - "core-graphics", + "cocoa 0.23.0", + "core-foundation 0.9.1", + "core-graphics 0.22.1", "core-video-sys", "dispatch", "instant", @@ -1109,7 +1308,7 @@ dependencies = [ "raw-window-handle", "smithay-client-toolkit", "wayland-client", - "winapi 0.3.8", + "winapi 0.3.9", "x11-dl", ] @@ -1135,6 +1334,15 @@ dependencies = [ "pkg-config", ] +[[package]] +name = "xcursor" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3a481cfdefd35e1c50073ae33a8000d695c98039544659f5dc5dd71311b0d01" +dependencies = [ + "nom", +] + [[package]] name = "xdg" version = "2.2.0" @@ -1149,6 +1357,6 @@ checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" [[package]] name = "xmlparser" -version = "0.13.1" +version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccb4240203dadf40be2de9369e5c6dec1bf427528115b030baca3334c18362d7" +checksum = "114ba2b24d2167ef6d67d7d04c8cc86522b87f490025f39f0303b7db5bf5e3d8" diff --git a/piet-gpu-hal/Cargo.toml b/piet-gpu-hal/Cargo.toml index d2edbd7..9ebd772 100644 --- a/piet-gpu-hal/Cargo.toml +++ b/piet-gpu-hal/Cargo.toml @@ -7,7 +7,7 @@ license = "MIT/Apache-2.0" edition = "2018" [dependencies] -ash = "0.30" +ash = "0.31" once_cell = "1.3.1" -ash-window = { git = "https://github.com/norse-rs/ash-window.git", branch = "dyn_trait" } +ash-window = "0.5" raw-window-handle = "0.3" diff --git a/piet-gpu-hal/examples/collatz.rs b/piet-gpu-hal/examples/collatz.rs index fed6a1d..1c9fd68 100644 --- a/piet-gpu-hal/examples/collatz.rs +++ b/piet-gpu-hal/examples/collatz.rs @@ -5,6 +5,7 @@ fn main() { let (instance, _) = VkInstance::new(None).unwrap(); unsafe { let device = instance.device(None).unwrap(); + let fence = device.create_fence(false).unwrap(); let mem_flags = MemFlags::host_coherent(); let src = (0..256).map(|x| x + 1).collect::>(); let buffer = device @@ -12,8 +13,10 @@ fn main() { .unwrap(); device.write_buffer(&buffer, &src).unwrap(); let code = include_bytes!("./shader/collatz.spv"); - let pipeline = device.create_simple_compute_pipeline(code, 1).unwrap(); - let descriptor_set = device.create_descriptor_set(&pipeline, &[&buffer]).unwrap(); + let pipeline = device.create_simple_compute_pipeline(code, 1, 0).unwrap(); + let descriptor_set = device + .create_descriptor_set(&pipeline, &[&buffer], &[]) + .unwrap(); let query_pool = device.create_query_pool(2).unwrap(); let mut cmd_buf = device.create_cmd_buf().unwrap(); cmd_buf.begin(); @@ -22,8 +25,11 @@ fn main() { cmd_buf.dispatch(&pipeline, &descriptor_set, (256, 1, 1)); cmd_buf.write_timestamp(&query_pool, 1); cmd_buf.finish(); - device.run_cmd_buf(&cmd_buf).unwrap(); - let timestamps = device.reap_query_pool(query_pool); + device + .run_cmd_buf(&cmd_buf, &[], &[], Some(&fence)) + .unwrap(); + device.wait_and_reset(&[fence]).unwrap(); + let timestamps = device.reap_query_pool(&query_pool); let mut dst: Vec = Default::default(); device.read_buffer(&buffer, &mut dst).unwrap(); for (i, val) in dst.iter().enumerate().take(16) { diff --git a/piet-gpu/Cargo.toml b/piet-gpu/Cargo.toml index a338d76..8057318 100644 --- a/piet-gpu/Cargo.toml +++ b/piet-gpu/Cargo.toml @@ -21,9 +21,9 @@ path = "../piet-gpu-hal" path = "../piet-gpu-types" [dependencies] -piet = "0.0.13" +piet = "0.2.0" png = "0.16.2" rand = "0.7.3" -roxmltree = "0.11" -winit = "0.22" +roxmltree = "0.13" +winit = "0.23" clap = "2.33" diff --git a/piet-gpu/bin/cli.rs b/piet-gpu/bin/cli.rs index df2f894..0b0a34f 100644 --- a/piet-gpu/bin/cli.rs +++ b/piet-gpu/bin/cli.rs @@ -2,7 +2,7 @@ use std::fs::File; use std::io::BufWriter; use std::path::Path; -use clap::{Arg, App}; +use clap::{App, Arg}; use piet_gpu_hal::vulkan::VkInstance; use piet_gpu_hal::{CmdBuf, Device, Error, MemFlags}; @@ -22,18 +22,30 @@ fn dump_scene(buf: &[u8]) { fn dump_state(buf: &[u8]) { for i in 0..(buf.len() / 48) { let j = i * 48; - let floats = (0..11).map(|k| { - let mut buf_f32 = [0u8; 4]; - buf_f32.copy_from_slice(&buf[j + k * 4..j + k * 4 + 4]); - f32::from_le_bytes(buf_f32) - }).collect::>(); - println!("{}: [{} {} {} {} {} {}] ({}, {})-({} {}) {} {}", + let floats = (0..11) + .map(|k| { + let mut buf_f32 = [0u8; 4]; + buf_f32.copy_from_slice(&buf[j + k * 4..j + k * 4 + 4]); + f32::from_le_bytes(buf_f32) + }) + .collect::>(); + println!( + "{}: [{} {} {} {} {} {}] ({}, {})-({} {}) {} {}", i, - floats[0], floats[1], floats[2], floats[3], floats[4], floats[5], - floats[6], floats[7], floats[8], floats[9], - floats[10], buf[j + 44]); + floats[0], + floats[1], + floats[2], + floats[3], + floats[4], + floats[5], + floats[6], + floats[7], + floats[8], + floats[9], + floats[10], + buf[j + 44] + ); } - } /// Interpret the output of the binning stage, for diagnostic purposes. @@ -41,22 +53,31 @@ fn dump_state(buf: &[u8]) { fn trace_merge(buf: &[u32]) { for bin in 0..256 { println!("bin {}:", bin); - let mut starts = (0..16).map(|i| Some((bin * 16 + i) * 64)).collect::>>(); + let mut starts = (0..16) + .map(|i| Some((bin * 16 + i) * 64)) + .collect::>>(); loop { - let min_start = starts.iter().map(|st| - st.map(|st| - if buf[st / 4] == 0 { - !0 - } else { - buf[st / 4 + 2] - }).unwrap_or(!0)).min().unwrap(); + let min_start = starts + .iter() + .map(|st| { + st.map(|st| { + if buf[st / 4] == 0 { + !0 + } else { + buf[st / 4 + 2] + } + }) + .unwrap_or(!0) + }) + .min() + .unwrap(); if min_start == !0 { break; } let mut selected = !0; for i in 0..16 { if let Some(st) = starts[i] { - if buf[st/4] != 0 && buf[st/4 + 2] == min_start { + if buf[st / 4] != 0 && buf[st / 4 + 2] == min_start { selected = i; break; } @@ -64,16 +85,15 @@ fn trace_merge(buf: &[u32]) { } let st = starts[selected].unwrap(); println!("selected {}, start {:x}", selected, st); - for j in 0..buf[st/4] { - println!("{:x}", buf[st/4 + 2 + j as usize]) + for j in 0..buf[st / 4] { + println!("{:x}", buf[st / 4 + 2 + j as usize]) } - if buf[st/4 + 1] == 0 { + if buf[st / 4 + 1] == 0 { starts[selected] = None; } else { - starts[selected] = Some(buf[st/4 + 1] as usize); + starts[selected] = Some(buf[st / 4 + 1] as usize); } } - } } @@ -103,7 +123,10 @@ fn trace_ptcl(buf: &[u32]) { let x1 = f32::from_bits(buf[segs / 4 + i * 5 + 2]); let y1 = f32::from_bits(buf[segs / 4 + i * 5 + 3]); let y_edge = f32::from_bits(buf[segs / 4 + i * 5 + 4]); - println!(" ({:.3}, {:.3}) - ({:.3}, {:.3}) | {:.3}", x0, y0, x1, y1, y_edge); + println!( + " ({:.3}, {:.3}) - ({:.3}, {:.3}) | {:.3}", + x0, y0, x1, y1, y_edge + ); } loop { seg_chunk = buf[seg_chunk / 4 + 1] as usize; @@ -115,7 +138,10 @@ fn trace_ptcl(buf: &[u32]) { 4 => { let line_width = f32::from_bits(buf[tile_offset / 4 + 2]); let rgba_color = buf[tile_offset / 4 + 3]; - println!(" {:x}: stroke {:x} {}", tile_offset, rgba_color, line_width); + println!( + " {:x}: stroke {:x} {}", + tile_offset, rgba_color, line_width + ); let mut seg_chunk = buf[tile_offset / 4 + 1] as usize; let n = buf[seg_chunk / 4] as usize; let segs = buf[seg_chunk / 4 + 2] as usize; @@ -126,7 +152,10 @@ fn trace_ptcl(buf: &[u32]) { let x1 = f32::from_bits(buf[segs / 4 + i * 5 + 2]); let y1 = f32::from_bits(buf[segs / 4 + i * 5 + 3]); let y_edge = f32::from_bits(buf[segs / 4 + i * 5 + 4]); - println!(" ({:.3}, {:.3}) - ({:.3}, {:.3}) | {:.3}", x0, y0, x1, y1, y_edge); + println!( + " ({:.3}, {:.3}) - ({:.3}, {:.3}) | {:.3}", + x0, y0, x1, y1, y_edge + ); } loop { seg_chunk = buf[seg_chunk / 4 + 1] as usize; @@ -152,18 +181,16 @@ fn trace_ptcl(buf: &[u32]) { } } - fn main() -> Result<(), Error> { let matches = App::new("piet-gpu test") - .arg(Arg::with_name("INPUT") - .index(1)) - .arg(Arg::with_name("flip") - .short("f") - .long("flip")) - .arg(Arg::with_name("scale") - .short("s") - .long("scale") - .takes_value(true)) + .arg(Arg::with_name("INPUT").index(1)) + .arg(Arg::with_name("flip").short("f").long("flip")) + .arg( + Arg::with_name("scale") + .short("s") + .long("scale") + .takes_value(true), + ) .get_matches(); let (instance, _) = VkInstance::new(None)?; unsafe { @@ -175,7 +202,8 @@ fn main() -> Result<(), Error> { let mut ctx = PietGpuRenderContext::new(); if let Some(input) = matches.value_of("INPUT") { - let mut scale = matches.value_of("scale") + let mut scale = matches + .value_of("scale") .map(|scale| scale.parse().unwrap()) .unwrap_or(8.0); if matches.is_present("flip") { @@ -198,11 +226,16 @@ fn main() -> Result<(), Error> { renderer.record(&mut cmd_buf, &query_pool); cmd_buf.copy_image_to_buffer(&renderer.image_dev, &image_buf); cmd_buf.finish(); + let start = std::time::Instant::now(); device.run_cmd_buf(&cmd_buf, &[], &[], Some(&fence))?; device.wait_and_reset(&[fence])?; + println!("elapsed = {:?}", start.elapsed()); let ts = device.reap_query_pool(&query_pool).unwrap(); println!("Element kernel time: {:.3}ms", ts[0] * 1e3); - println!("Tile allocation kernel time: {:.3}ms", (ts[1] - ts[0]) * 1e3); + println!( + "Tile allocation kernel time: {:.3}ms", + (ts[1] - ts[0]) * 1e3 + ); println!("Coarse path kernel time: {:.3}ms", (ts[2] - ts[1]) * 1e3); println!("Backdrop kernel time: {:.3}ms", (ts[3] - ts[2]) * 1e3); println!("Binning kernel time: {:.3}ms", (ts[4] - ts[3]) * 1e3); diff --git a/piet-gpu/src/lib.rs b/piet-gpu/src/lib.rs index 6177b3e..29bdb09 100644 --- a/piet-gpu/src/lib.rs +++ b/piet-gpu/src/lib.rs @@ -162,12 +162,20 @@ pub struct Renderer { } impl Renderer { - pub unsafe fn new(device: &D, scene: &[u8], n_paths: usize, n_pathseg: usize) -> Result { + pub unsafe fn new( + device: &D, + scene: &[u8], + n_paths: usize, + n_pathseg: usize, + ) -> Result { let host = MemFlags::host_coherent(); let dev = MemFlags::device_local(); let n_elements = scene.len() / piet_gpu_types::scene::Element::fixed_size(); - println!("scene: {} elements, {} paths, {} path_segments", n_elements, n_paths, n_pathseg); + println!( + "scene: {} elements, {} paths, {} path_segments", + n_elements, n_paths, n_pathseg + ); let scene_buf = device .create_buffer(std::mem::size_of_val(&scene[..]) as u64, host) @@ -256,17 +264,20 @@ impl Renderer { let coarse_pipeline = device.create_simple_compute_pipeline(coarse_code, 5, 0)?; let coarse_ds = device.create_descriptor_set( &coarse_pipeline, - &[&anno_buf, &bin_buf, &tile_buf, &coarse_alloc_buf_dev, &ptcl_buf], + &[ + &anno_buf, + &bin_buf, + &tile_buf, + &coarse_alloc_buf_dev, + &ptcl_buf, + ], &[], )?; let k4_code = include_bytes!("../shader/kernel4.spv"); let k4_pipeline = device.create_simple_compute_pipeline(k4_code, 2, 1)?; - let k4_ds = device.create_descriptor_set( - &k4_pipeline, - &[&ptcl_buf, &tile_buf], - &[&image_dev] - )?; + let k4_ds = + device.create_descriptor_set(&k4_pipeline, &[&ptcl_buf, &tile_buf], &[&image_dev])?; Ok(Renderer { scene_buf, diff --git a/piet-gpu/src/render_ctx.rs b/piet-gpu/src/render_ctx.rs index c3e1dd7..9593704 100644 --- a/piet-gpu/src/render_ctx.rs +++ b/piet-gpu/src/render_ctx.rs @@ -1,28 +1,28 @@ -use std::borrow::Cow; +use std::{borrow::Cow, ops::RangeBounds}; use piet_gpu_types::encoder::{Encode, Encoder}; use piet_gpu_types::scene::{CubicSeg, Element, Fill, LineSeg, QuadSeg, SetLineWidth, Stroke}; -use piet::kurbo::{Affine, PathEl, Point, Rect, Shape}; +use piet::{ + kurbo::Size, + kurbo::{Affine, PathEl, Point, Rect, Shape}, + HitTestPosition, TextAttribute, TextStorage, +}; use piet::{ - Color, Error, FixedGradient, Font, FontBuilder, HitTestPoint, HitTestTextPosition, ImageFormat, - InterpolationMode, IntoBrush, LineMetric, RenderContext, StrokeStyle, Text, TextLayout, - TextLayoutBuilder, + Color, Error, FixedGradient, FontFamily, HitTestPoint, ImageFormat, InterpolationMode, + IntoBrush, LineMetric, RenderContext, StrokeStyle, Text, TextLayout, TextLayoutBuilder, }; pub struct PietGpuImage; -pub struct PietGpuFont; - -pub struct PietGpuFontBuilder; - #[derive(Clone)] pub struct PietGpuTextLayout; pub struct PietGpuTextLayoutBuilder; +#[derive(Clone)] pub struct PietGpuText; pub struct PietGpuRenderContext { @@ -103,7 +103,7 @@ impl RenderContext for PietGpuRenderContext { self.stroke_width = width; } let brush = brush.make_brush(self, || shape.bounding_box()).into_owned(); - let path = shape.to_bez_path(TOLERANCE); + let path = shape.path_elements(TOLERANCE); self.encode_path(path, false); match brush { PietGpuBrush::Solid(rgba_color) => { @@ -126,7 +126,7 @@ impl RenderContext for PietGpuRenderContext { fn fill(&mut self, shape: impl Shape, brush: &impl IntoBrush) { let brush = brush.make_brush(self, || shape.bounding_box()).into_owned(); - let path = shape.to_bez_path(TOLERANCE); + let path = shape.path_elements(TOLERANCE); self.encode_path(path, true); match brush { PietGpuBrush::Solid(rgba_color) => { @@ -146,23 +146,7 @@ impl RenderContext for PietGpuRenderContext { &mut self.inner_text } - fn draw_text( - &mut self, - _layout: &Self::TextLayout, - pos: impl Into, - brush: &impl IntoBrush, - ) { - let _pos = pos.into(); - - let brush: PietGpuBrush = brush.make_brush(self, || Rect::ZERO).into_owned(); - - match brush { - PietGpuBrush::Solid(_rgba) => { - // TODO: draw text - } - _ => {} - } - } + fn draw_text(&mut self, _layout: &Self::TextLayout, _pos: impl Into) {} fn save(&mut self) -> Result<(), Error> { Ok(()) @@ -335,70 +319,81 @@ impl PietGpuRenderContext { } impl Text for PietGpuText { - type Font = PietGpuFont; - type FontBuilder = PietGpuFontBuilder; type TextLayout = PietGpuTextLayout; type TextLayoutBuilder = PietGpuTextLayoutBuilder; - fn new_font_by_name(&mut self, _name: &str, _size: f64) -> Self::FontBuilder { - unimplemented!(); + fn load_font(&mut self, _data: &[u8]) -> Result { + Ok(FontFamily::default()) } - fn new_text_layout( - &mut self, - _font: &Self::Font, - _text: &str, - _width: impl Into>, - ) -> Self::TextLayoutBuilder { - unimplemented!(); + fn new_text_layout(&mut self, _text: impl TextStorage) -> Self::TextLayoutBuilder { + PietGpuTextLayoutBuilder } -} -impl Font for PietGpuFont {} - -impl FontBuilder for PietGpuFontBuilder { - type Out = PietGpuFont; - - fn build(self) -> Result { - unimplemented!(); + fn font_family(&mut self, _family_name: &str) -> Option { + Some(FontFamily::default()) } } impl TextLayoutBuilder for PietGpuTextLayoutBuilder { type Out = PietGpuTextLayout; + fn max_width(self, _width: f64) -> Self { + self + } + + fn alignment(self, _alignment: piet::TextAlignment) -> Self { + self + } + + fn default_attribute(self, _attribute: impl Into) -> Self { + self + } + + fn range_attribute( + self, + _range: impl RangeBounds, + _attribute: impl Into, + ) -> Self { + self + } + fn build(self) -> Result { - unimplemented!() + Ok(PietGpuTextLayout) } } impl TextLayout for PietGpuTextLayout { - fn width(&self) -> f64 { - 0.0 + fn size(&self) -> Size { + Size::ZERO } - fn update_width(&mut self, _new_width: impl Into>) -> Result<(), Error> { - unimplemented!() + fn image_bounds(&self) -> Rect { + Rect::ZERO } fn line_text(&self, _line_number: usize) -> Option<&str> { - unimplemented!() + None } fn line_metric(&self, _line_number: usize) -> Option { - unimplemented!() + None } fn line_count(&self) -> usize { - unimplemented!() + 0 } fn hit_test_point(&self, _point: Point) -> HitTestPoint { - unimplemented!() + HitTestPoint::default() } - fn hit_test_text_position(&self, _text_position: usize) -> Option { - unimplemented!() + fn hit_test_text_position(&self, _text_position: usize) -> HitTestPosition { + HitTestPosition::default() + } + + fn text(&self) -> &str { + "" } }