diff --git a/.gitignore b/.gitignore index fdd8195..1ad7f2f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ /target /.todo +/.vscode \ No newline at end of file diff --git a/Cargo.lock b/Cargo.lock index ddc1bee..7f99c39 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,33 +4,33 @@ version = 3 [[package]] name = "addr2line" -version = "0.21.0" +version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a30b2e23b9e17a9f90641c7ab1549cd9b44f296d3ccbf309d2863cfe398a0cb" +checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" 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" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "arrayvec" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" +checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "askama" @@ -47,9 +47,9 @@ dependencies = [ [[package]] name = "askama_derive" -version = "0.12.2" +version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a0fc7dcf8bd4ead96b1d36b41df47c14beedf7b0301fc543d8f2384e66a2ec0" +checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" dependencies = [ "askama_parser", "basic-toml", @@ -69,45 +69,45 @@ checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" [[package]] name = "askama_parser" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c268a96e01a4c47c8c5c2472aaa570707e006a875ea63e819f75474ceedaf7b4" +checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" dependencies = [ "nom", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.69" +version = "0.3.74" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2089b7e3f35b9dd2d0ed921ead4f6d318c27680d4a5bd167b3ee120edb105837" +checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" dependencies = [ "addr2line", - "cc", "cfg-if", "libc", "miniz_oxide", "object", "rustc-demangle", + "windows-targets 0.52.6", ] [[package]] name = "base64" -version = "0.21.5" +version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35636a1494ede3b646cc98f74f8e62c773a38a659ebc777a2cf26b9b74171df9" +checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] name = "basic-toml" -version = "0.1.7" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f2139706359229bfa8f19142ac1155b4b80beafb7a60471ac5dd109d4a19778" +checksum = "823388e228f614e9558c6804262db37960ec8821856535f5c3f59913140558f8" dependencies = [ "serde", ] @@ -118,7 +118,16 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ - "bit-vec", + "bit-vec 0.6.3", +] + +[[package]] +name = "bit-set" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0481a0e032742109b1133a095184ee93d88f3dc9e0d28a5d033dc77a073f44f" +dependencies = [ + "bit-vec 0.7.0", ] [[package]] @@ -127,6 +136,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bit-vec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2c54ff287cfc0a34f38a6b832ea1bd8e448a330b3e40a50859e6488bee07f22" + [[package]] name = "bitflags" version = "1.3.2" @@ -141,30 +156,30 @@ checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "bumpalo" -version = "3.14.0" +version = "3.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" +checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" [[package]] name = "bytes" -version = "1.5.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "camino" -version = "1.1.6" +version = "1.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59e92b5a388f549b863a7bea62612c09f24c8393560709a54558a9abdfb3b9c" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" dependencies = [ "serde", ] [[package]] name = "cargo-platform" -version = "0.1.5" +version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e34637b3140142bdf929fb439e8aa4ebad7651ebf7b1080b3930aa16ac1459ff" +checksum = "24b1f0365a6c6bb4020cd05806fd0d33c44d38046b8bd7f0e40814b9763cabfc" dependencies = [ "serde", ] @@ -185,11 +200,11 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.83" +version = "1.1.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +checksum = "2e80e3b6a3ab07840e1cae9b0666a63970dc28e8ed5ffbcdacbfc760c281bfc1" dependencies = [ - "libc", + "shlex", ] [[package]] @@ -198,6 +213,12 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" + [[package]] name = "codespan-reporting" version = "0.11.1" @@ -215,15 +236,18 @@ dependencies = [ "cargo_metadata", "docs", "flate2", + "markdown-rs", "naga 0.12.3", "naga 0.13.0", - "naga 0.14.1", + "naga 0.14.2", "naga 0.19.2", "naga 0.20.0", + "naga 22.1.0", "naga_oil 0.10.1", "naga_oil 0.11.0", "naga_oil 0.13.0", "naga_oil 0.14.0", + "naga_oil 0.15.0", "naga_oil 0.8.2", "regex", "reqwest", @@ -242,38 +266,38 @@ 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 = "crc32fast" -version = "1.3.2" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" dependencies = [ "cfg-if", ] [[package]] name = "data-encoding" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e962a19be5cfc3f3bf6dd8f61eb50107f356ad6270fbb3ed41476571db78be5" +checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" [[package]] name = "docs" version = "0.1.0" dependencies = [ - "indexmap 2.1.0", + "indexmap 2.6.0", "semver", ] [[package]] name = "encoding_rs" -version = "0.8.33" +version = "0.8.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7268b386296a025e474d5140678f75d6de9493ae55a5d709eeb9dd08149945e1" +checksum = "b45de904aa0b010bce2ab45264d0631681847fa7b6f2eaa7dab7619943bc4f59" dependencies = [ "cfg-if", ] @@ -286,9 +310,9 @@ checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" [[package]] name = "errno" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a258e46cdc063eb8519c00b9fc845fc47bcfca4130e2f08e88665ceda8474245" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" dependencies = [ "libc", "windows-sys 0.52.0", @@ -296,27 +320,27 @@ dependencies = [ [[package]] name = "fastrand" -version = "2.0.1" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +checksum = "e8c02a5121d4ea3eb16a80748c74f5549a5665e4c21333c6098f283870fbdea6" [[package]] name = "filetime" -version = "0.2.22" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4029edd3e734da6fe05b6cd7bd2960760a616bd2ddd0d59a0124746d6272af0" +checksum = "35c0522e981e68cbfa8c3f978441a5f34b30b96e146b33cd3359176b50fe8586" dependencies = [ "cfg-if", "libc", - "redox_syscall 0.3.5", - "windows-sys 0.48.0", + "libredox", + "windows-sys 0.59.0", ] [[package]] name = "flate2" -version = "1.0.28" +version = "1.0.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +checksum = "a1b589b4dc103969ad3cf85c950899926ec64300a1a46d76c03a6072957036f0" dependencies = [ "crc32fast", "miniz_oxide", @@ -354,42 +378,42 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff4dd66668b557604244583e3e1e1eada8c5c2e96a6d0d6653ede395b78bbacb" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" dependencies = [ "futures-core", ] [[package]] name = "futures-core" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] name = "futures-io" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf34a163b5c4c52d0478a4d757da8fb65cabef42ba90515efee0f6f9fa45aaa" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-sink" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" [[package]] name = "futures-task" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" [[package]] name = "futures-util" -version = "0.3.29" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ "futures-core", "futures-io", @@ -406,21 +430,22 @@ version = "0.1.0" dependencies = [ "askama", "docs", + "markdown", "serde", "serde_json", ] [[package]] name = "gimli" -version = "0.28.1" +version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4271d37baee1b8c7e4b708028c57d816cf9d2434acb33a549475f78c181f6253" +checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "h2" -version = "0.3.22" +version = "0.3.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d6250322ef6e60f93f9a2162799302cd6f68f79f6e5d85c8c16f14d1d958178" +checksum = "81fe527a889e1532da5c525686d96d4c2e74cdd345badf8dfef9f6b39dd5f5e8" dependencies = [ "bytes", "fnv", @@ -428,7 +453,7 @@ dependencies = [ "futures-sink", "futures-util", "http", - "indexmap 2.1.0", + "indexmap 2.6.0", "slab", "tokio", "tokio-util", @@ -443,15 +468,15 @@ checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" [[package]] name = "hashbrown" -version = "0.14.3" +version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "290f1a1d9242c78d09ce40a5e87e7554ee637af1351968159f4952f028f75604" +checksum = "1e087f84d4f86bf4b218b927129862374b72199ae7d8657835f1e89000eea4fb" [[package]] name = "hermit-abi" -version = "0.3.3" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" +checksum = "d231dfb89cfffdbc30e7fc41579ed6066ad03abda9e567ccafae602b97ec5024" [[package]] name = "hexf-parse" @@ -461,9 +486,9 @@ checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" [[package]] name = "http" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8947b1a6fad4393052c7ba1f4cd97bed3e953a95c79c92ad9b051a04611d9fbb" +checksum = "601cbb57e577e2f5ef5be8e7b83f0f63994f25aa94d673e54a92d5c516d101f1" dependencies = [ "bytes", "fnv", @@ -472,9 +497,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.4.5" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" +checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", "http", @@ -483,9 +508,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" [[package]] name = "httpdate" @@ -504,9 +529,9 @@ dependencies = [ [[package]] name = "hyper" -version = "0.14.27" +version = "0.14.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" +checksum = "a152ddd61dfaec7273fe8419ab357f33aee0d914c5f4efbf0d96fa749eea5ec9" dependencies = [ "bytes", "futures-channel", @@ -519,7 +544,7 @@ dependencies = [ "httpdate", "itoa", "pin-project-lite", - "socket2 0.4.10", + "socket2", "tokio", "tower-service", "tracing", @@ -561,46 +586,46 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.1.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d530e1a18b1cb4c484e6e34556a0d948706958449fca0cab753d649f2bce3d1f" +checksum = "707907fe3c25f5424cce2cb7e1cbcafee6bdbe735ca90ef77c29e84591e5b9da" dependencies = [ "equivalent", - "hashbrown 0.14.3", + "hashbrown 0.15.0", ] [[package]] name = "ipnet" -version = "2.9.0" +version = "2.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" +checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" [[package]] name = "itoa" -version = "1.0.9" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" +checksum = "49f1f14873335454500d59611f1cf4a4b0f786f9ac11f4312a78e4cf2566695b" [[package]] name = "js-sys" -version = "0.3.66" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +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 = "libc" -version = "0.2.150" +version = "0.2.159" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +checksum = "561d97a539a36e26a9a5fad1ea11a3039a67714694aaa379433e580854bc3dc5" [[package]] name = "libm" @@ -608,17 +633,28 @@ version = "0.2.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.6.0", + "libc", + "redox_syscall", +] + [[package]] name = "linux-raw-sys" -version = "0.4.12" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4cd1a83af159aa67994778be9070f0ae1bd732942279cabb14f86f986a21456" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" [[package]] name = "log" -version = "0.4.20" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" [[package]] name = "make" @@ -629,11 +665,28 @@ dependencies = [ "generator", ] +[[package]] +name = "markdown" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef3aab6a1d529b112695f72beec5ee80e729cb45af58663ec902c8fac764ecdd" +dependencies = [ + "lazy_static", + "pipeline", + "regex", +] + +[[package]] +name = "markdown-rs" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ea041fc3a6fb9235217bde03eb9d505eba5d79a8dbee5f08cb4c2e59c4ed9c" + [[package]] name = "memchr" -version = "2.6.4" +version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" [[package]] name = "mime" @@ -643,9 +696,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "mime_guess" -version = "2.0.4" +version = "2.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +checksum = "f7c44f8e672c00fe5308fa235f821cb4198414e1c77935c1ab6948d3fd78550e" dependencies = [ "mime", "unicase", @@ -659,22 +712,23 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" dependencies = [ - "adler", + "adler2", ] [[package]] name = "mio" -version = "0.8.9" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dce281c5e46beae905d4de1870d8b1509a9142b62eedf18b443b011ca8343d0" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" dependencies = [ + "hermit-abi", "libc", "wasi", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -683,7 +737,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbcc2e0513220fd2b598e6068608d4462db20322c0e77e47f6f488dfcfc279cb" dependencies = [ - "bit-set", + "bit-set 0.5.3", "bitflags 1.3.2", "codespan-reporting", "hexf-parse", @@ -703,7 +757,7 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e" dependencies = [ - "bit-set", + "bit-set 0.5.3", "bitflags 2.6.0", "codespan-reporting", "hexf-parse", @@ -719,15 +773,15 @@ dependencies = [ [[package]] name = "naga" -version = "0.14.1" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cd05939c491da968a42986204b7431678be21fdcd4b10cc84997ba130ada5a4" +checksum = "ae585df4b6514cf8842ac0f1ab4992edc975892704835b549cf818dc0191249e" dependencies = [ - "bit-set", + "bit-set 0.5.3", "bitflags 2.6.0", "codespan-reporting", "hexf-parse", - "indexmap 2.1.0", + "indexmap 2.6.0", "log", "num-traits", "pp-rs", @@ -743,11 +797,11 @@ version = "0.19.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50e3524642f53d9af419ab5e8dd29d3ba155708267667c2f3f06c88c9e130843" dependencies = [ - "bit-set", + "bit-set 0.5.3", "bitflags 2.6.0", "codespan-reporting", "hexf-parse", - "indexmap 2.1.0", + "indexmap 2.6.0", "log", "num-traits", "pp-rs", @@ -764,11 +818,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e536ae46fcab0876853bd4a632ede5df4b1c2527a58f6c5a4150fe86be858231" dependencies = [ "arrayvec", - "bit-set", + "bit-set 0.5.3", "bitflags 2.6.0", "codespan-reporting", "hexf-parse", - "indexmap 2.1.0", + "indexmap 2.6.0", "log", "num-traits", "pp-rs", @@ -778,13 +832,32 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "naga" +version = "22.1.0" +dependencies = [ + "arrayvec", + "bit-set 0.6.0", + "bitflags 2.6.0", + "cfg_aliases", + "codespan-reporting", + "hexf-parse", + "indexmap 2.6.0", + "log", + "pp-rs", + "rustc-hash", + "termcolor", + "thiserror", + "unicode-xid", +] + [[package]] name = "naga_oil" version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8be942a5c21c58b9b0bf4d9b99db3634ddb7a916f8e1d1d0b71820cc4150e56b" dependencies = [ - "bit-set", + "bit-set 0.5.3", "codespan-reporting", "data-encoding", "indexmap 1.9.3", @@ -804,7 +877,7 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ac54c77b3529887f9668d3dd81e955e58f252b31a333f836e3548c06460b958" dependencies = [ - "bit-set", + "bit-set 0.5.3", "codespan-reporting", "data-encoding", "indexmap 1.9.3", @@ -824,11 +897,11 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fff3f369dd665ee365daeab786466a6f70ff53e4a95a76117363b1077e1b0492" dependencies = [ - "bit-set", + "bit-set 0.5.3", "codespan-reporting", "data-encoding", - "indexmap 2.1.0", - "naga 0.14.1", + "indexmap 2.6.0", + "naga 0.14.2", "once_cell", "regex", "regex-syntax 0.7.5", @@ -844,14 +917,14 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ea62ae0f2787456afca7209ca180522b41f00cbe159ee369eba1e07d365cd1" dependencies = [ - "bit-set", + "bit-set 0.5.3", "codespan-reporting", "data-encoding", - "indexmap 2.1.0", + "indexmap 2.6.0", "naga 0.19.2", "once_cell", "regex", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", "rustc-hash", "thiserror", "tracing", @@ -864,14 +937,32 @@ version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "275d9720a7338eedac966141089232514c84d76a246a58ef501af88c5edf402f" dependencies = [ - "bit-set", + "bit-set 0.5.3", "codespan-reporting", "data-encoding", - "indexmap 2.1.0", + "indexmap 2.6.0", "naga 0.20.0", "once_cell", "regex", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", + "rustc-hash", + "thiserror", + "tracing", + "unicode-ident", +] + +[[package]] +name = "naga_oil" +version = "0.15.0" +dependencies = [ + "bit-set 0.5.3", + "codespan-reporting", + "data-encoding", + "indexmap 2.6.0", + "naga 22.1.0", + "once_cell", + "regex", + "regex-syntax 0.8.5", "rustc-hash", "thiserror", "tracing", @@ -880,11 +971,10 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.11" +version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" +checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" dependencies = [ - "lazy_static", "libc", "log", "openssl", @@ -908,43 +998,33 @@ dependencies = [ [[package]] name = "num-traits" -version = "0.2.17" +version = "0.2.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e3200413f237f41ab11ad6d161bc7239c84dcb631773ccd7de3dfe4b5c267c" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "object" -version = "0.32.1" +version = "0.36.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf5f9dd3933bd50a9e1f149ec995f39ae2c496d31fd772c1fd45ebc27e902b0" +checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.18.0" +version = "1.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "openssl" -version = "0.10.60" +version = "0.10.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800" +checksum = "9529f4786b70a3e8c61e11179af17ab6188ad8d0ded78c5529441ed39d4bd9c1" dependencies = [ "bitflags 2.6.0", "cfg-if", @@ -974,9 +1054,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" [[package]] name = "openssl-sys" -version = "0.9.96" +version = "0.9.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3812c071ba60da8b5677cc12bcb1d42989a65553772897a7e0355545a819838f" +checksum = "7f9e8deee91df40a943c71b917e5874b951d32a802526c85721ce3b776c929d6" dependencies = [ "cc", "libc", @@ -992,9 +1072,9 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pin-project-lite" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" +checksum = "bda66fc9667c18cb2758a2ac84d1167245054bcf85d5d1aaa6923f45801bdd02" [[package]] name = "pin-utils" @@ -1002,11 +1082,17 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pipeline" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d15b6607fa632996eb8a17c9041cb6071cb75ac057abd45dece578723ea8c7c0" + [[package]] name = "pkg-config" -version = "0.3.27" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" [[package]] name = "pp-rs" @@ -1019,61 +1105,52 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.82" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ad3d49ab951a01fbaafe34f2ec74122942fe18a3f9814c3268f1bb72042131b" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ "unicode-ident", ] [[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 = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.4.1" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4722d768eff46b75989dd134e5c353f0d6296e5aaa3132e776cbdb56be7731aa" +checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] name = "regex" -version = "1.10.2" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" +checksum = "38200e5ee88914975b69f657f0801b6f6dccafd44fd9326302a4aaeecfacb1d8" dependencies = [ "aho-corasick", "memchr", "regex-automata", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", ] [[package]] name = "regex-automata" -version = "0.4.3" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +checksum = "368758f23274712b504848e9d5a6f010445cc8b87a7cdb4d7cbee666c1288da3" dependencies = [ "aho-corasick", "memchr", - "regex-syntax 0.8.2", + "regex-syntax 0.8.5", ] [[package]] @@ -1090,15 +1167,15 @@ checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "reqwest" -version = "0.11.22" +version = "0.11.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "046cd98826c46c2ac8ddecae268eb5c2e58628688a5fc7a2643704a73faba95b" +checksum = "dd67538700a17451e7cba03ac727fb961abb7607553461627b97de0b89cf4a62" dependencies = [ "base64", "bytes", @@ -1118,9 +1195,11 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", + "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", + "sync_wrapper", "system-configuration", "tokio", "tokio-native-tls", @@ -1134,9 +1213,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.23" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" +checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" [[package]] name = "rustc-hash" @@ -1146,9 +1225,9 @@ checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustix" -version = "0.38.26" +version = "0.38.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9470c4bf8246c8daf25f9598dca807fb6510347b1e1cfa55749113850c79d88a" +checksum = "8acb788b847c24f28525660c4d7758620a7210875711f79e7f663cc152726811" dependencies = [ "bitflags 2.6.0", "errno", @@ -1157,28 +1236,37 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls-pemfile" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c74cae0a4cf6ccbbf5f359f08efdf8ee7e1dc532573bf0db71968cb56b1448c" +dependencies = [ + "base64", +] + [[package]] name = "ryu" -version = "1.0.15" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" +checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" [[package]] name = "schannel" -version = "0.1.22" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" +checksum = "01227be5826fa0690321a2ba6c5cd57a19cf3f6a09e76973b58e61de6ab9d1c1" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "security-framework" -version = "2.9.2" +version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05b64fb303737d99b81884b2c63433e9ae28abebe5eb5045dcdd175dc2ecf4de" +checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "core-foundation", "core-foundation-sys", "libc", @@ -1187,9 +1275,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.9.1" +version = "2.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e932934257d3b408ed8f30db49d85ea163bfe74961f017f405b025af298f0c7a" +checksum = "ea4a292869320c0272d7bc55a5a6aafaff59b4f63404a003887b679a2e05b4b6" dependencies = [ "core-foundation-sys", "libc", @@ -1197,27 +1285,27 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.20" +version = "1.0.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "836fa6a3e1e547f9a2c4040802ec865b5d85f4014efe00555d7090a3dcaa1090" +checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.193" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" +checksum = "c8e3592472072e6e22e0a54d5904d9febf8508f65fb8552499a1abc7d1078c3a" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.193" +version = "1.0.210" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" +checksum = "243902eda00fad750862fc144cea25caca5e20d615af0a81bee94ca738f1df1f" dependencies = [ "proc-macro2", "quote", @@ -1226,11 +1314,12 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.108" +version = "1.0.128" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" +checksum = "6ff5456707a1de34e7e37f2a6fd3d3f808c318259cbd01ab6377795054b483d8" dependencies = [ "itoa", + "memchr", "ryu", "serde", ] @@ -1247,6 +1336,12 @@ dependencies = [ "serde", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "slab" version = "0.4.9" @@ -1258,35 +1353,31 @@ dependencies = [ [[package]] name = "socket2" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f7916fc008ca5542385b89a3d3ce689953c143e9304a9bf8beec1de48994c0d" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "socket2" -version = "0.5.5" +version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" +checksum = "ce305eb0b4296696835b71df73eb912e0f1ffd2556a501fcede6e0c50349191c" dependencies = [ "libc", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "syn" -version = "2.0.61" +version = "2.0.79" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c993ed8ccba56ae856363b1845da7266a7cb78e1d146c8a32d54b45a8b831fc9" +checksum = "89132cd0bf050864e1d38dc3bbc07a0eb8e7530af26344d3d2bbbef83499f590" dependencies = [ "proc-macro2", "quote", "unicode-ident", ] +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + [[package]] name = "system-configuration" version = "0.5.1" @@ -1310,9 +1401,9 @@ dependencies = [ [[package]] name = "tar" -version = "0.4.40" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16afcea1f22891c49a00c751c7b63b2233284064f11a200fc624137c51e2ddb" +checksum = "4ff6c40d3aedb5e06b57c6f669ad17ab063dd1e63d977c6a88e7f4dfa4f04020" dependencies = [ "filetime", "libc", @@ -1321,15 +1412,15 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.8.1" +version = "3.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef1adac450ad7f4b3c28589471ade84f25f731a7a0fe30d71dfa9f60fd808e5" +checksum = "f0f2c9fc62d0beef6951ccffd757e241266a2c833136efbe35af6cd2567dca5b" dependencies = [ "cfg-if", "fastrand", - "redox_syscall 0.4.1", + "once_cell", "rustix", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -1343,18 +1434,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.60" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "579e9083ca58dd9dcf91a9923bb9054071b9ebbd800b342194c9feb0ee89fc18" +checksum = "d50af8abc119fb8bb6dbabcfa89656f46f84aa0ac7688088608076ad2b459a84" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.60" +version = "1.0.64" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2470041c06ec3ac1ab38d0356a6119054dedaea53e12fbefc0de730a1c08524" +checksum = "08904e7672f5eb876eaaf87e0ce17857500934f4981c4a0ab2b4aa98baac7fc3" dependencies = [ "proc-macro2", "quote", @@ -1363,9 +1454,9 @@ dependencies = [ [[package]] name = "tinyvec" -version = "1.6.0" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +checksum = "445e881f4f6d382d5f27c034e25eb92edd7c784ceab92a0937db7f2e9471b938" dependencies = [ "tinyvec_macros", ] @@ -1378,18 +1469,17 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.34.0" +version = "1.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0c014766411e834f7af5b8f4cf46257aab4036ca95e9d2c144a10f59ad6f5b9" +checksum = "e2b070231665d27ad9ec9b8df639893f46727666c6767db40317fbe920a5d998" dependencies = [ "backtrace", "bytes", "libc", "mio", - "num_cpus", "pin-project-lite", - "socket2 0.5.5", - "windows-sys 0.48.0", + "socket2", + "windows-sys 0.52.0", ] [[package]] @@ -1404,23 +1494,22 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.10" +version = "0.7.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5419f34732d9eb6ee4c3578b7989078579b7f039cbbb9ca2c4da015749371e15" +checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" dependencies = [ "bytes", "futures-core", "futures-sink", "pin-project-lite", "tokio", - "tracing", ] [[package]] name = "tower-service" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" [[package]] name = "tracing" @@ -1455,9 +1544,9 @@ dependencies = [ [[package]] name = "try-lock" -version = "0.2.4" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "unicase" @@ -1470,42 +1559,42 @@ dependencies = [ [[package]] name = "unicode-bidi" -version = "0.3.13" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "5ab17db44d7388991a428b2ee655ce0c212e862eff1768a455c58f9aad6e7893" [[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 = "unicode-normalization" -version = "0.1.22" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +checksum = "5033c97c4262335cded6d6fc3e5c18ab755e1a3dc96376350f3d8e9f009ad956" dependencies = [ "tinyvec", ] [[package]] name = "unicode-width" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51733f11c9c4f72aa0c160008246859e340b00807569a0da0e7a1079b27ba85" +checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" [[package]] name = "unicode-xid" -version = "0.2.4" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" [[package]] name = "url" -version = "2.5.0" +version = "2.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31e6302e3bb753d46e83516cae55ae196fc0c309407cf11ab35cc51a4c2a4633" +checksum = "22784dbdf76fdde8af1aeda5622b546b422b6fc585325248a2bf9f5e41e94d6c" dependencies = [ "form_urlencoded", "idna", @@ -1520,9 +1609,9 @@ checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" [[package]] name = "version_check" -version = "0.9.4" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "want" @@ -1541,19 +1630,20 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.89" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +checksum = "a82edfc16a6c469f5f44dc7b571814045d60404b55a0ee849f9bcfa2e63dd9b5" dependencies = [ "cfg-if", + "once_cell", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.89" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +checksum = "9de396da306523044d3302746f1208fa71d7532227f15e347e2d93e4145dd77b" dependencies = [ "bumpalo", "log", @@ -1566,9 +1656,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.39" +version = "0.4.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac36a15a220124ac510204aec1c3e5db8a22ab06fd6706d881dc6149f8ed9a12" +checksum = "61e9300f63a621e96ed275155c108eb6f843b6a26d053f122ab69724559dc8ed" dependencies = [ "cfg-if", "js-sys", @@ -1578,9 +1668,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.89" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +checksum = "585c4c91a46b072c92e908d99cb1dcdf95c5218eeb6f3bf1efa991ee7a68cccf" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1588,9 +1678,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.89" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +checksum = "afc340c74d9005395cf9dd098506f7f44e38f2b4a21c6aaacf9a105ea5e1e836" dependencies = [ "proc-macro2", "quote", @@ -1601,51 +1691,29 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.89" +version = "0.2.93" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" +checksum = "c62a0a307cb4a311d3a07867860911ca130c3494e8c2719593806c08bc5d0484" [[package]] name = "web-sys" -version = "0.3.66" +version = "0.3.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" +checksum = "26fdeaafd9bd129f65e7c031593c24d62186301e0c72c8978fa1678be7d532c0" dependencies = [ "js-sys", "wasm-bindgen", ] -[[package]] -name = "winapi" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" -dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", -] - -[[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" - [[package]] name = "winapi-util" -version = "0.1.6" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f29e6f9198ba0d26b4c9f07dbe6f9ed633e1f3d5b8b414090084349e46a52596" +checksum = "cf221c93e13a30d793f7645a0e7762c55d169dbb0a49671918a2319d289b10bb" dependencies = [ - "winapi", + "windows-sys 0.52.0", ] -[[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" - [[package]] name = "windows-sys" version = "0.48.0" @@ -1661,7 +1729,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.0", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -1681,17 +1758,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.0", - "windows_aarch64_msvc 0.52.0", - "windows_i686_gnu 0.52.0", - "windows_i686_msvc 0.52.0", - "windows_x86_64_gnu 0.52.0", - "windows_x86_64_gnullvm 0.52.0", - "windows_x86_64_msvc 0.52.0", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "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", ] [[package]] @@ -1702,9 +1780,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -1714,9 +1792,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -1726,9 +1804,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -1738,9 +1822,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -1750,9 +1834,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -1762,9 +1846,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -1774,9 +1858,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.0" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winreg" @@ -1790,9 +1874,11 @@ dependencies = [ [[package]] name = "xattr" -version = "1.0.1" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4686009f71ff3e5c4dbcf1a282d0a44db3f021ba69350cd42086b3e5f1c6985" +checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", + "linux-raw-sys", + "rustix", ] diff --git a/Cargo.toml b/Cargo.toml index a848b85..9c854b7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,3 +1,7 @@ [workspace] resolver = "2" members = ["crates/*"] + +[patch.crates-io] +naga_oil = { path = "../naga_oil" } +naga = { path = "../wgpu/naga" } diff --git a/README.md b/README.md index 82bd7f4..9f60f52 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,16 @@ # shader docs -... +Shader docs allows to parse wgsl shaders exposed from crates, and display documentation about it in a webpage. + +Information can contain functions, types, and shaderdefs. + +## Architecture + +- Supports different naga backends. +- Uses naga and naga_oil to get accurate information + +![architecture](docs/shader_docs_diagram.svg) + ## License diff --git a/crates/compiler/Cargo.toml b/crates/compiler/Cargo.toml index b23ac37..945e782 100644 --- a/crates/compiler/Cargo.toml +++ b/crates/compiler/Cargo.toml @@ -12,13 +12,16 @@ cargo_metadata = "0.18.1" tar = "0.4.40" flate2 = "1.0.28" regex = "1.10.2" +markdown-rs = "0.1.0" +naga_oil_v0_15 = { package = "naga_oil", version = "0.15.0", optional = true } naga_oil_v0_14 = { package = "naga_oil", version = "0.14.0", optional = true } naga_oil_v0_13 = { package = "naga_oil", version = "0.13.0", optional = true } naga_oil_v0_11 = { package = "naga_oil", version = "0.11.0", optional = true } naga_oil_v0_10 = { package = "naga_oil", version = "0.10.1", optional = true } naga_oil_v0_08 = { package = "naga_oil", version = "0.8.2", optional = true } +naga_v22_1 = { package = "naga", version = "22.1.0", optional = true } naga_v0_20 = { package = "naga", version = "0.20.0", optional = true } naga_v0_19 = { package = "naga", version = "0.19.2", optional = true } naga_v0_14 = { package = "naga", version = "0.14.1", optional = true } @@ -28,6 +31,7 @@ naga_v0_12 = { package = "naga", version = "0.12.3", optional = true } [features] default = [] +backend_v0_15 = ["dep:naga_oil_v0_15", "dep:naga_v22_1"] # bevy 0.15.x backend_v0_14 = ["dep:naga_oil_v0_14", "dep:naga_v0_20"] # bevy 0.14.x backend_v0_13 = ["dep:naga_oil_v0_13", "dep:naga_v0_19"] # bevy 0.13.x backend_v0_11 = ["dep:naga_oil_v0_11", "dep:naga_v0_14"] # ... diff --git a/crates/compiler/src/backend_v0_08/mod.rs b/crates/compiler/src/backend_v0_08/mod.rs index a04e617..d09d9f2 100644 --- a/crates/compiler/src/backend_v0_08/mod.rs +++ b/crates/compiler/src/backend_v0_08/mod.rs @@ -103,6 +103,7 @@ pub fn compile( } }, init: build_expression(&constant.inner), + comment: None, }); } } @@ -122,6 +123,7 @@ pub fn compile( init: var .init .map(|init| build_expression(&naga_module.constants[init].inner)), + comment: None, }); } } @@ -142,8 +144,10 @@ pub fn compile( &def_paths, ), binding: member.binding.as_ref().map(build_binding), + comment: None, }) .collect(), + comment: None, }); } } @@ -175,6 +179,7 @@ pub fn compile( &def_paths, ) }), + comment: None, }); } } diff --git a/crates/compiler/src/backend_v0_10/mod.rs b/crates/compiler/src/backend_v0_10/mod.rs index 05ebf75..039a137 100644 --- a/crates/compiler/src/backend_v0_10/mod.rs +++ b/crates/compiler/src/backend_v0_10/mod.rs @@ -87,6 +87,7 @@ pub fn compile( name: Ident::from(constant.name.clone()), ty: build_ty(&naga_module.types[constant.ty], gctx, &def_paths), init: build_expression(&naga_module.const_expressions[constant.init]), + comment: None, }); } } @@ -101,6 +102,7 @@ pub fn compile( init: var .init .map(|init| build_expression(&naga_module.const_expressions[init])), + comment: None, }); } } @@ -116,8 +118,10 @@ pub fn compile( name: Ident::from(member.name.clone()), ty: build_ty(&naga_module.types[member.ty], gctx, &def_paths), binding: member.binding.as_ref().map(build_binding), + comment: None, }) .collect(), + comment: None, }); } } @@ -140,6 +144,7 @@ pub fn compile( .result .as_ref() .map(|res| build_ty(&naga_module.types[res.ty], gctx, &def_paths)), + comment: None, }); } } diff --git a/crates/compiler/src/backend_v0_11/mod.rs b/crates/compiler/src/backend_v0_11/mod.rs index 8b9536f..8b052bf 100644 --- a/crates/compiler/src/backend_v0_11/mod.rs +++ b/crates/compiler/src/backend_v0_11/mod.rs @@ -87,6 +87,7 @@ pub fn compile( name: Ident::from(constant.name.clone()), ty: build_ty(&naga_module.types[constant.ty], gctx, &def_paths), init: build_expression(&naga_module.const_expressions[constant.init]), + comment: None, }); } } @@ -101,6 +102,7 @@ pub fn compile( init: var .init .map(|init| build_expression(&naga_module.const_expressions[init])), + comment: None, }); } } @@ -116,8 +118,10 @@ pub fn compile( name: Ident::from(member.name.clone()), ty: build_ty(&naga_module.types[member.ty], gctx, &def_paths), binding: member.binding.as_ref().map(build_binding), + comment: None, }) .collect(), + comment: None, }); } } @@ -140,6 +144,7 @@ pub fn compile( .result .as_ref() .map(|res| build_ty(&naga_module.types[res.ty], gctx, &def_paths)), + comment: None, }); } } diff --git a/crates/compiler/src/backend_v0_13/mod.rs b/crates/compiler/src/backend_v0_13/mod.rs index 058257d..6b8c700 100644 --- a/crates/compiler/src/backend_v0_13/mod.rs +++ b/crates/compiler/src/backend_v0_13/mod.rs @@ -87,6 +87,7 @@ pub fn compile( name: Ident::from(constant.name.clone()), ty: build_ty(&naga_module.types[constant.ty], gctx, &def_paths), init: build_expression(&naga_module.const_expressions[constant.init]), + comment: None, }); } } @@ -101,6 +102,7 @@ pub fn compile( init: var .init .map(|init| build_expression(&naga_module.const_expressions[init])), + comment: None, }); } } @@ -116,8 +118,10 @@ pub fn compile( name: Ident::from(member.name.clone()), ty: build_ty(&naga_module.types[member.ty], gctx, &def_paths), binding: member.binding.as_ref().map(build_binding), + comment: None, }) .collect(), + comment: None, }); } } @@ -140,6 +144,7 @@ pub fn compile( .result .as_ref() .map(|res| build_ty(&naga_module.types[res.ty], gctx, &def_paths)), + comment: None, }); } } diff --git a/crates/compiler/src/backend_v0_14/mod.rs b/crates/compiler/src/backend_v0_14/mod.rs index 872e371..dd8335d 100644 --- a/crates/compiler/src/backend_v0_14/mod.rs +++ b/crates/compiler/src/backend_v0_14/mod.rs @@ -87,6 +87,7 @@ pub fn compile( name: Ident::from(constant.name.clone()), ty: build_ty(&naga_module.types[constant.ty], gctx, &def_paths), init: build_expression(&naga_module.global_expressions[constant.init]), + comment: None, }); } } @@ -101,6 +102,7 @@ pub fn compile( init: var .init .map(|init| build_expression(&naga_module.global_expressions[init])), + comment: None, }); } } @@ -116,8 +118,10 @@ pub fn compile( name: Ident::from(member.name.clone()), ty: build_ty(&naga_module.types[member.ty], gctx, &def_paths), binding: member.binding.as_ref().map(build_binding), + comment: None, }) .collect(), + comment: None, }); } } @@ -140,6 +144,7 @@ pub fn compile( .result .as_ref() .map(|res| build_ty(&naga_module.types[res.ty], gctx, &def_paths)), + comment: None, }); } } diff --git a/crates/compiler/src/backend_v0_15/mod.rs b/crates/compiler/src/backend_v0_15/mod.rs new file mode 100644 index 0000000..3c2befc --- /dev/null +++ b/crates/compiler/src/backend_v0_15/mod.rs @@ -0,0 +1,336 @@ +mod to_wgsl; +mod util; + +use naga_oil_v0_15::{self as naga_oil, compose::preprocess::PreprocessorMetaData}; +use naga_v22_1 as naga; + +use super::{common, download::ShaderSource}; +use docs::*; +use naga::TypeInner; +use naga_oil::compose::{ + self, ComposableModuleDescriptor, Composer, ImportDefinition, NagaModuleDescriptor, + ShaderLanguage, +}; +use std::{collections::HashMap, error::Error}; +use to_wgsl::build_ty; +use util::{build_address_space, build_binding, build_expression, build_resource_binding}; + +const NAGA_OIL_DECORATION_PRE: &str = "X_naga_oil_mod_X"; +const NAGA_OIL_DECORATION_POST: &str = "X"; + +pub fn compile( + root_crate_name: &str, + root_crate_version: Version, + shader_def_values: IndexMap, + shader_sources: Vec, +) -> Result> { + let (shaders, mut composer) = compile_shaders(shader_sources, false)?; + + let mut doc = common::doc_new( + root_crate_name.to_string(), + root_crate_version, + shader_def_values.clone(), + ); + + for (import_path, shader) in &shaders.composable_modules { + let (module_path, module) = common::find_or_create_module(&mut doc, import_path); + + make_naga_and_fill_module( + &mut composer, + module, + shader, + &shader_def_values, + module_path, + )?; + } + + for shader in &shaders.standalone_shaders { + let name: String = shader + .source + .path + .file_name() + .unwrap() + .to_str() + .unwrap() + .into(); + let mut module = Module::new(name.clone()); + + make_naga_and_fill_module( + &mut composer, + &mut module, + shader, + &shader_def_values, + vec!["stand_alone".to_string(), name], + )?; + doc.root.modules.push(module); + } + + Ok(doc) +} + +/// Uses composer to build the shader, then transforms data and dumps it into module. +fn make_naga_and_fill_module( + composer: &mut Composer, + module: &mut Module, + shader: &Shader, + shader_def_values: &IndexMap, + module_path: Vec, +) -> Result<(), Box> { + module + .shader_defs + .extend(shader.source.shader_defs.iter().cloned()); + module.source_url = Some(shader.source.docsrs_url.clone()); + let desc = NagaModuleDescriptor { + source: &shader.source.source, + shader_defs: shader_def_values + .iter() + .map(|(key, value)| { + ( + key.clone(), + match *value { + ShaderDefValue::Bool(value) => compose::ShaderDefValue::Bool(value), + ShaderDefValue::Int(value) => compose::ShaderDefValue::Int(value), + ShaderDefValue::UInt(value) => compose::ShaderDefValue::UInt(value), + }, + ) + }) + .collect(), + ..Default::default() + }; + let naga_module = composer.make_naga_module(desc)?; + let gctx = naga_module.to_ctx(); + let mut def_paths = HashMap::new(); + for import in &shader.imports { + let module_path = import + .import + .split("::") + .map(str::to_owned) + .collect::>(); + for item in &import.items { + def_paths.insert(item.clone(), module_path.clone()); + } + } + for (_handle, ty) in naga_module.types.iter() { + if !contains_pre(ty.name.as_deref()) { + if let TypeInner::Struct { .. } = &ty.inner { + if let Some(name) = &ty.name { + def_paths.insert(name.clone(), module_path.clone()); + } + } + } + } + for (_handle, constant) in naga_module.constants.iter() { + if !contains_pre(constant.name.as_deref()) { + module.constants.push(Constant { + name: Ident::from(constant.name.clone()), + ty: build_ty(&naga_module.types[constant.ty], gctx, &def_paths), + init: build_expression(&naga_module.global_expressions[constant.init]), + comment: naga_module + .comments + .constants + .get(&_handle) + .map(|comments| sanitize_comments(&comments)), + }); + } + } + for (_handle, var) in naga_module.global_variables.iter() { + if !contains_pre(var.name.as_deref()) { + module.global_variables.push(GlobalVariable { + name: Ident::from(var.name.clone()), + space: build_address_space(&var.space), + binding: var.binding.as_ref().map(build_resource_binding), + ty: build_ty(&naga_module.types[var.ty], gctx, &def_paths), + init: var + .init + .map(|init| build_expression(&naga_module.global_expressions[init])), + comment: naga_module + .comments + .global_variables + .get(&_handle) + .map(|comments| sanitize_comments(&comments)), + }); + } + } + for (_handle, ty) in naga_module.types.iter() { + if !contains_pre(ty.name.as_deref()) { + if let TypeInner::Struct { members, .. } = &ty.inner { + module.structs.push(Struct { + name: Ident::from(ty.name.clone()), + members: members + .iter() + .enumerate() + .map(|(index, member)| StructMember { + name: Ident::from(member.name.clone()), + ty: build_ty(&naga_module.types[member.ty], gctx, &def_paths), + binding: member.binding.as_ref().map(build_binding), + comment: naga_module + .comments + .struct_members + .get(&(_handle, index)) + .map(|comments| sanitize_comments(&comments)), + }) + .collect(), + comment: naga_module + .comments + .types + .get(&_handle) + .map(|comments| sanitize_comments(&comments)), + }); + } + } + } + Ok(for (_handle, function) in naga_module.functions.iter() { + if !contains_pre(function.name.as_deref()) { + module.functions.push(Function { + name: Ident::from(function.name.clone()), + arguments: function + .arguments + .iter() + .map(|arg| FunctionArgument { + name: Ident::from(arg.name.clone()), + ty: build_ty(&naga_module.types[arg.ty], gctx, &def_paths), + binding: arg.binding.as_ref().map(build_binding), + }) + .collect(), + ret: function + .result + .as_ref() + .map(|res| build_ty(&naga_module.types[res.ty], gctx, &def_paths)), + comment: if let Some(function_name) = &function.name { + naga_module + .comments + .functions + .get(function_name) + .map(|comments| sanitize_comments(&comments)) + } else { + None + }, + }); + } + }) +} + +fn sanitize_comments(s: &[String]) -> String { + s.iter().fold(String::new(), |mut acc, next_value| { + let mut new_value = next_value.trim(); + new_value = new_value.trim_start_matches('/'); + new_value = new_value.trim_start_matches('*').trim_start(); + new_value = new_value.trim_end_matches('/'); + new_value = new_value.trim_end_matches('*').trim_end(); + acc.push_str(&new_value); + acc.push('\n'); + acc + }) +} + +fn contains_pre(name: Option<&str>) -> bool { + name.map(|name| name.contains(NAGA_OIL_DECORATION_PRE)) + .unwrap_or(false) +} + +#[derive(Debug)] +struct Shader { + source: ShaderSource, + imports: Vec, + defines: HashMap, +} + +#[derive(Debug)] +struct Shaders { + pub composable_modules: HashMap, + pub standalone_shaders: Vec, +} + +fn compile_shaders( + shader_sources: Vec, + document_standalone_shaders: bool, +) -> Result<(Shaders, Composer), Box> { + let mut composer = Composer::default(); + let mut shaders = HashMap::new(); + let mut independent_shaders = Vec::new(); + + for shader_source in shader_sources { + match compose::try_get_preprocessor_data(&shader_source.source) { + Ok(PreprocessorMetaData { + name: Some(import_path), + imports, + defines, + .. + }) => { + let imports = imports + .into_iter() + .map(|import_with_offset| import_with_offset.definition) + .collect(); + shaders.insert( + import_path, + Shader { + source: shader_source, + imports, + defines, + }, + ); + } + Ok(metadata) => { + // An import without a name means it's missing a `#define_import_path`. + // This is possible when a shader is designed to be added as-is directly within a pipeline. + // We'll store it as a "standalone shader" and try to compile it independently. + // FIXME: import definition should be fixed and try to find the correct module the shader is declared in. + if document_standalone_shaders { + let imports = metadata + .imports + .into_iter() + .map(|import_with_offset| import_with_offset.definition) + .collect(); + + independent_shaders.push(Shader { + source: shader_source, + imports, + defines: metadata.defines, + }); + } + } + Err(_err) => { + //dbg!(err); + } + } + } + + fn add_to_composer( + composer: &mut Composer, + name: &str, + shaders: &HashMap, + ) -> Result<(), Box> { + if !composer.contains_module(name) { + let this = match shaders.get(name) { + Some(this) => this, + None => return Err(format!("shader not found: {}", name).into()), + }; + + for import in &this.imports { + add_to_composer(composer, &import.import, shaders)?; + } + + composer.add_composable_module(ComposableModuleDescriptor { + source: &this.source.source, + file_path: &this.source.path.to_string_lossy(), + language: ShaderLanguage::Wgsl, + additional_imports: Default::default(), + shader_defs: this.defines.clone(), + as_name: None, + })?; + } + + Ok(()) + } + for name in shaders.keys() { + add_to_composer(&mut composer, name, &shaders)?; + } + + Ok(( + Shaders { + standalone_shaders: independent_shaders, + composable_modules: shaders, + }, + composer, + )) +} diff --git a/crates/compiler/src/backend_v0_15/to_wgsl.rs b/crates/compiler/src/backend_v0_15/to_wgsl.rs new file mode 100644 index 0000000..5a7e7d1 --- /dev/null +++ b/crates/compiler/src/backend_v0_15/to_wgsl.rs @@ -0,0 +1,307 @@ +use super::naga::{self, proc::GlobalCtx, Scalar, TypeInner}; +use super::{NAGA_OIL_DECORATION_POST, NAGA_OIL_DECORATION_PRE}; +use std::collections::HashMap; + +pub fn build_ty( + ty: &naga::Type, + gctx: GlobalCtx, + def_paths: &HashMap>, +) -> docs::Type { + match &ty.name { + Some(name) => { + let pre_pos = name.find(NAGA_OIL_DECORATION_PRE); + let ends_with_post = name.ends_with(NAGA_OIL_DECORATION_POST); + + let name = match (pre_pos, ends_with_post) { + (Some(pre_pos), true) => name[..pre_pos].to_string(), + _ => name.clone(), + }; + let def_path = def_paths.get(&name).cloned(); + docs::Type::Named { name, def_path } + } + None => build_ty_inner(&ty.inner, gctx, def_paths), + } +} + +// Copy-pasted and adapted from: naga-0.19.2 + +pub fn build_ty_inner( + type_inner: &TypeInner, + gctx: GlobalCtx, + def_paths: &HashMap>, +) -> docs::Type { + let name = match *type_inner { + TypeInner::Vector { size, scalar } => { + format!("vec{}<{}>", vector_size_str(size), scalar_kind_str(scalar),) + } + TypeInner::Sampler { comparison: false } => "sampler".to_string(), + TypeInner::Sampler { comparison: true } => "sampler_comparison".to_string(), + TypeInner::Image { + dim, + arrayed, + class, + } => { + // More about texture types: https://gpuweb.github.io/gpuweb/wgsl/#sampled-texture-type + use naga::ImageClass as Ic; + + let dim_str = image_dimension_str(dim); + let arrayed_str = if arrayed { "_array" } else { "" }; + let (class_str, multisampled_str, format_str, storage_str) = match class { + Ic::Sampled { kind, multi } => ( + "", + if multi { "multisampled_" } else { "" }, + scalar_kind_str(naga::Scalar { kind, width: 4 }), + "", + ), + Ic::Depth { multi } => ("depth_", if multi { "multisampled_" } else { "" }, "", ""), + Ic::Storage { format, access } => ( + "storage_", + "", + storage_format_str(format), + if access.contains(naga::StorageAccess::LOAD | naga::StorageAccess::STORE) { + ",read_write" + } else if access.contains(naga::StorageAccess::LOAD) { + ",read" + } else { + ",write" + }, + ), + }; + let mut out = format!("texture_{class_str}{multisampled_str}{dim_str}{arrayed_str}"); + + if !format_str.is_empty() { + out += &format!("<{format_str}{storage_str}>"); + } + + out + } + TypeInner::Scalar(scalar) => scalar_kind_str(scalar).to_string(), + TypeInner::Atomic(scalar) => { + format!("atomic<{}>", scalar_kind_str(scalar)) + } + TypeInner::Array { + base, + size, + stride: _, + } => { + // More info https://gpuweb.github.io/gpuweb/wgsl/#array-types + // array -- Constant array + // array -- Dynamic array + let member_type = &gctx.types[base]; + return match size { + naga::ArraySize::Constant(size) => docs::Type::ArrayConstant( + Box::new(build_ty(member_type, gctx, def_paths)), + Some(size.get()), + ), + naga::ArraySize::Dynamic => { + docs::Type::ArrayDynamic(Box::new(build_ty(member_type, gctx, def_paths))) + } + }; + } + TypeInner::BindingArray { base, size } => { + // More info https://github.com/gpuweb/gpuweb/issues/2105 + let member_type = &gctx.types[base]; + return match size { + naga::ArraySize::Constant(size) => docs::Type::BindingArrayConstant( + Box::new(build_ty(member_type, gctx, def_paths)), + Some(size.get()), + ), + naga::ArraySize::Dynamic => docs::Type::BindingArrayDynamic(Box::new(build_ty( + member_type, + gctx, + def_paths, + ))), + }; + } + TypeInner::Matrix { + columns, + rows, + scalar, + } => { + format!( + "mat{}x{}<{}>", + vector_size_str(columns), + vector_size_str(rows), + scalar_kind_str(scalar) + ) + } + TypeInner::Pointer { base, space } => { + let (address, maybe_access) = address_space_str(space); + // Everything but `AddressSpace::Handle` gives us a `address` name, but + // Naga IR never produces pointers to handles, so it doesn't matter much + // how we write such a type. Just write it as the base type alone. + let base = build_ty(&gctx.types[base], gctx, def_paths); + return match address { + Some(address) => docs::Type::PointerWithAddressSpace { + base: Box::new(base), + address_space: address, + maybe_access, + }, + None => base, + }; + } + TypeInner::ValuePointer { + size, + scalar, + space, + } => { + let (address, maybe_access) = address_space_str(space); + let base = docs::Type::Named { + name: match size { + Some(size) => { + format!("vec{}<{}>", vector_size_str(size), scalar_kind_str(scalar)) + } + None => scalar_kind_str(scalar).to_string(), + }, + def_path: None, + }; + return match address { + Some(address) => docs::Type::PointerWithAddressSpace { + base: Box::new(base), + address_space: address, + maybe_access, + }, + None => base, + }; + } + TypeInner::AccelerationStructure => "acceleration_structure".to_string(), + TypeInner::Struct { .. } => { + // TODO: Actually output the struct? + "struct".to_string() + } + TypeInner::RayQuery { .. } => { + // TODO: ??? + "ray_query".to_string() + } + }; + + let def_path = def_paths.get(&name).cloned(); + docs::Type::Named { name, def_path } +} + +const fn vector_size_str(size: naga::VectorSize) -> &'static str { + match size { + naga::VectorSize::Bi => "2", + naga::VectorSize::Tri => "3", + naga::VectorSize::Quad => "4", + } +} + +const fn image_dimension_str(dim: naga::ImageDimension) -> &'static str { + use naga::ImageDimension as IDim; + + match dim { + IDim::D1 => "1d", + IDim::D2 => "2d", + IDim::D3 => "3d", + IDim::Cube => "cube", + } +} + +const fn scalar_kind_str(scalar: naga::Scalar) -> &'static str { + use naga::ScalarKind as Sk; + + match scalar { + Scalar { + kind: Sk::Float, + width: 8, + } => "f64", + Scalar { + kind: Sk::Float, + width: 4, + } => "f32", + Scalar { + kind: Sk::Sint, + width: 4, + } => "i32", + Scalar { + kind: Sk::Uint, + width: 4, + } => "u32", + Scalar { + kind: Sk::Sint, + width: 8, + } => "i64", + Scalar { + kind: Sk::Uint, + width: 8, + } => "u64", + Scalar { + kind: Sk::Bool, + width: 1, + } => "bool", + _ => unreachable!(), + } +} + +const fn storage_format_str(format: naga::StorageFormat) -> &'static str { + use naga::StorageFormat as Sf; + + match format { + Sf::R8Unorm => "r8unorm", + Sf::R8Snorm => "r8snorm", + Sf::R8Uint => "r8uint", + Sf::R8Sint => "r8sint", + Sf::R16Uint => "r16uint", + Sf::R16Sint => "r16sint", + Sf::R16Float => "r16float", + Sf::Rg8Unorm => "rg8unorm", + Sf::Rg8Snorm => "rg8snorm", + Sf::Rg8Uint => "rg8uint", + Sf::Rg8Sint => "rg8sint", + Sf::R32Uint => "r32uint", + Sf::R32Sint => "r32sint", + Sf::R32Float => "r32float", + Sf::Rg16Uint => "rg16uint", + Sf::Rg16Sint => "rg16sint", + Sf::Rg16Float => "rg16float", + Sf::Rgba8Unorm => "rgba8unorm", + Sf::Rgba8Snorm => "rgba8snorm", + Sf::Rgba8Uint => "rgba8uint", + Sf::Rgba8Sint => "rgba8sint", + Sf::Bgra8Unorm => "bgra8unorm", + Sf::Rgb10a2Uint => "rgb10a2uint", + Sf::Rgb10a2Unorm => "rgb10a2unorm", + Sf::Rg11b10Float => "rg11b10float", + Sf::Rg32Uint => "rg32uint", + Sf::Rg32Sint => "rg32sint", + Sf::Rg32Float => "rg32float", + Sf::Rgba16Uint => "rgba16uint", + Sf::Rgba16Sint => "rgba16sint", + Sf::Rgba16Float => "rgba16float", + Sf::Rgba32Uint => "rgba32uint", + Sf::Rgba32Sint => "rgba32sint", + Sf::Rgba32Float => "rgba32float", + Sf::R16Unorm => "r16unorm", + Sf::R16Snorm => "r16snorm", + Sf::Rg16Unorm => "rg16unorm", + Sf::Rg16Snorm => "rg16snorm", + Sf::Rgba16Unorm => "rgba16unorm", + Sf::Rgba16Snorm => "rgba16snorm", + } +} + +const fn address_space_str( + space: naga::AddressSpace, +) -> (Option<&'static str>, Option<&'static str>) { + use naga::AddressSpace as As; + + ( + Some(match space { + As::Private => "private", + As::Uniform => "uniform", + As::Storage { access } => { + if access.contains(naga::StorageAccess::STORE) { + return (Some("storage"), Some("read_write")); + } else { + "storage" + } + } + As::PushConstant => "push_constant", + As::WorkGroup => "workgroup", + As::Handle => return (None, None), + As::Function => "function", + }), + None, + ) +} diff --git a/crates/compiler/src/backend_v0_15/util.rs b/crates/compiler/src/backend_v0_15/util.rs new file mode 100644 index 0000000..0aeeb20 --- /dev/null +++ b/crates/compiler/src/backend_v0_15/util.rs @@ -0,0 +1,108 @@ +use super::naga; +use docs::{ + AddressSpace, Binding, BuiltIn, Expression, Interpolation, Literal, ResourceBinding, Sampling, +}; + +pub fn build_expression(expression: &naga::Expression) -> Expression { + match expression { + naga::Expression::Literal(lit) => Expression::Literal(match *lit { + naga::Literal::F64(v) => Literal::F64(v), + naga::Literal::F32(v) => Literal::F32(v), + naga::Literal::U32(v) => Literal::U32(v), + naga::Literal::I32(v) => Literal::I32(v), + naga::Literal::Bool(v) => Literal::Bool(v), + naga::Literal::I64(v) => Literal::I64(v), + naga::Literal::U64(v) => Literal::U64(v), + naga::Literal::AbstractInt(v) => Literal::AbstractInt(v), + naga::Literal::AbstractFloat(v) => Literal::AbstractFloat(v), + }), + _ => Expression::Unknown, + } +} + +pub fn build_resource_binding(binding: &naga::ResourceBinding) -> ResourceBinding { + ResourceBinding { + group: binding.group, + binding: binding.binding, + } +} + +pub fn build_address_space(address_space: &naga::AddressSpace) -> AddressSpace { + match address_space { + naga::AddressSpace::Function => AddressSpace::Function, + naga::AddressSpace::Private => AddressSpace::Private, + naga::AddressSpace::WorkGroup => AddressSpace::WorkGroup, + naga::AddressSpace::Uniform => AddressSpace::Uniform, + naga::AddressSpace::Storage { access } => AddressSpace::Storage { + load: access.contains(naga::StorageAccess::LOAD), + store: access.contains(naga::StorageAccess::STORE), + }, + naga::AddressSpace::Handle => AddressSpace::Handle, + naga::AddressSpace::PushConstant => AddressSpace::PushConstant, + } +} + +pub fn build_binding(binding: &naga::Binding) -> Binding { + match binding { + naga::Binding::BuiltIn(builtin) => Binding::BuiltIn(build_builtin(builtin)), + naga::Binding::Location { + location, + second_blend_source, + interpolation, + sampling, + } => Binding::Location { + location: *location, + second_blend_source: *second_blend_source, + interpolation: interpolation.as_ref().map(build_interpolation), + sampling: sampling.as_ref().map(build_sampling), + }, + } +} + +pub fn build_builtin(builtin: &naga::BuiltIn) -> BuiltIn { + match builtin { + naga::BuiltIn::Position { invariant } => BuiltIn::Position { + invariant: *invariant, + }, + naga::BuiltIn::ViewIndex => BuiltIn::ViewIndex, + naga::BuiltIn::BaseInstance => BuiltIn::BaseInstance, + naga::BuiltIn::BaseVertex => BuiltIn::BaseVertex, + naga::BuiltIn::ClipDistance => BuiltIn::ClipDistance, + naga::BuiltIn::CullDistance => BuiltIn::CullDistance, + naga::BuiltIn::InstanceIndex => BuiltIn::InstanceIndex, + naga::BuiltIn::PointSize => BuiltIn::PointSize, + naga::BuiltIn::VertexIndex => BuiltIn::VertexIndex, + naga::BuiltIn::FragDepth => BuiltIn::FragDepth, + naga::BuiltIn::PointCoord => BuiltIn::PointCoord, + naga::BuiltIn::FrontFacing => BuiltIn::FrontFacing, + naga::BuiltIn::PrimitiveIndex => BuiltIn::PrimitiveIndex, + naga::BuiltIn::SampleIndex => BuiltIn::SampleIndex, + naga::BuiltIn::SampleMask => BuiltIn::SampleMask, + naga::BuiltIn::GlobalInvocationId => BuiltIn::GlobalInvocationId, + naga::BuiltIn::LocalInvocationId => BuiltIn::LocalInvocationId, + naga::BuiltIn::LocalInvocationIndex => BuiltIn::LocalInvocationIndex, + naga::BuiltIn::WorkGroupId => BuiltIn::WorkGroupId, + naga::BuiltIn::WorkGroupSize => BuiltIn::WorkGroupSize, + naga::BuiltIn::NumWorkGroups => BuiltIn::NumWorkGroups, + naga::BuiltIn::NumSubgroups => BuiltIn::NumSubgroups, + naga::BuiltIn::SubgroupId => BuiltIn::SubgroupId, + naga::BuiltIn::SubgroupSize => BuiltIn::SubgroupSize, + naga::BuiltIn::SubgroupInvocationId => BuiltIn::SubgroupInvocationId, + } +} + +pub fn build_interpolation(interpolation: &naga::Interpolation) -> Interpolation { + match interpolation { + naga::Interpolation::Perspective => Interpolation::Perspective, + naga::Interpolation::Linear => Interpolation::Linear, + naga::Interpolation::Flat => Interpolation::Flat, + } +} + +pub fn build_sampling(sampling: &naga::Sampling) -> Sampling { + match sampling { + naga::Sampling::Center => Sampling::Center, + naga::Sampling::Centroid => Sampling::Centroid, + naga::Sampling::Sample => Sampling::Sample, + } +} diff --git a/crates/compiler/src/common.rs b/crates/compiler/src/common.rs index 852406d..1ac65a3 100644 --- a/crates/compiler/src/common.rs +++ b/crates/compiler/src/common.rs @@ -38,16 +38,7 @@ pub fn find_or_create_module<'a>( module = match idx { Some(idx) => &mut module.modules[idx], None => { - module.modules.push(Module { - name: segment.to_string(), - source_url: None, - modules: Vec::new(), - constants: Vec::new(), - global_variables: Vec::new(), - structs: Vec::new(), - functions: Vec::new(), - shader_defs: IndexSet::new(), - }); + module.modules.push(Module::new(segment.to_string())); module.modules.last_mut().unwrap() } }; diff --git a/crates/compiler/src/download.rs b/crates/compiler/src/download.rs index 7b84158..edc6dcc 100644 --- a/crates/compiler/src/download.rs +++ b/crates/compiler/src/download.rs @@ -1,4 +1,4 @@ -use crate::CompilerBackend; +use crate::{CompilerBackend, CrateLocation}; use cargo_metadata::MetadataCommand; use docs::Version; use regex::Regex; @@ -12,6 +12,7 @@ use std::{ }; use tar::Archive; +#[derive(Debug)] pub struct ShaderSource { pub path: PathBuf, pub source: String, @@ -20,15 +21,14 @@ pub struct ShaderSource { } pub fn download_shaders( - root_crate_name: &str, + root_crate_location: &CrateLocation, root_crate_version: &Version, package_filter: impl Fn(&str) -> bool, cache_path: &Path, backend: CompilerBackend, ) -> Result, Box> { - let manifest_path = download_crate(cache_path, root_crate_name, root_crate_version)?; + let manifest_path = retrieve_crate(cache_path, root_crate_location, root_crate_version)?; let metadata = MetadataCommand::new().manifest_path(manifest_path).exec()?; - let mut shaders = Vec::new(); for package in &metadata.packages { @@ -108,6 +108,61 @@ pub fn download_shaders( Ok(shaders) } +fn retrieve_crate( + cache_path: &Path, + crate_location: &CrateLocation, + version: &Version, +) -> Result> { + match crate_location { + CrateLocation::Local(crate_local_path) => { + let name = crate_local_path + .path + .file_name() + .ok_or_else(|| { + format!( + "Could not find the name of local path: {:?}.", + crate_local_path.path + ) + })? + .to_str() + .ok_or_else(|| { + format!( + "Could not understand the name of local path: {:?}.", + crate_local_path.path + ) + })?; + let crate_path = cache_path.join(format!("{name}@{version}")); + let manifest_path = crate_path.join(format!("{name}-{version}/Cargo.toml")); + + fn copy_dir_all(src: impl AsRef, dst: impl AsRef) -> std::io::Result<()> { + if !matches!(fs::exists(&dst), Ok(true)) { + fs::create_dir_all(&dst)?; + } + for entry in fs::read_dir(src)? { + let entry = entry?; + let ty = entry.file_type()?; + if ty.is_dir() { + if entry.file_name() == ".git" { + continue; + } + copy_dir_all(entry.path(), dst.as_ref().join(entry.file_name()))?; + } else if ty.is_file() { + fs::copy(entry.path(), dst.as_ref().join(entry.file_name()))?; + } + } + Ok(()) + } + copy_dir_all( + crate_local_path.path, + crate_path.join(format!("{name}-{version}")), + )?; + + Ok(manifest_path) + } + CrateLocation::CratesIo(crate_name) => download_crate(cache_path, crate_name.name, version), + } +} + fn download_crate( cache_path: &Path, name: &str, diff --git a/crates/compiler/src/lib.rs b/crates/compiler/src/lib.rs index 0807007..781e835 100644 --- a/crates/compiler/src/lib.rs +++ b/crates/compiler/src/lib.rs @@ -2,6 +2,9 @@ mod common; mod download; mod post_process; +#[cfg(feature = "backend_v0_15")] +mod backend_v0_15; + #[cfg(feature = "backend_v0_14")] mod backend_v0_14; @@ -21,8 +24,34 @@ use docs::{Doc, IndexMap, ShaderDefValue, Version}; use std::path::Path; +pub struct CrateLocalPath<'a> { + pub path: &'a Path, +} + +pub struct CratesIoIdentifier<'a> { + pub name: &'a str, +} + +pub enum CrateLocation<'a> { + Local(CrateLocalPath<'a>), + CratesIo(CratesIoIdentifier<'a>), +} + +impl CrateLocation<'_> { + pub fn name(&self) -> &str { + match self { + CrateLocation::Local(crate_local_path) => { + crate_local_path.path.file_name().unwrap().to_str().unwrap() + } + CrateLocation::CratesIo(crate_name) => crate_name.name, + } + } +} + #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] pub enum CompilerBackend { + #[cfg(feature = "backend_v0_15")] + V0_15, #[cfg(feature = "backend_v0_14")] V0_14, #[cfg(feature = "backend_v0_13")] @@ -38,6 +67,8 @@ pub enum CompilerBackend { impl CompilerBackend { fn naga_oil_minor(self) -> u64 { match self { + #[cfg(feature = "backend_v0_15")] + CompilerBackend::V0_15 => 15, #[cfg(feature = "backend_v0_14")] CompilerBackend::V0_14 => 14, #[cfg(feature = "backend_v0_13")] @@ -53,7 +84,7 @@ impl CompilerBackend { } pub fn compile( - root_crate_name: &str, + root_crate_location: &CrateLocation, root_crate_version: Version, package_filter: impl Fn(&str) -> bool, shader_def_values: IndexMap, @@ -61,7 +92,7 @@ pub fn compile( backend: CompilerBackend, ) -> Result> { let shader_sources = download::download_shaders( - root_crate_name, + root_crate_location, &root_crate_version, package_filter, cache_path, @@ -70,6 +101,8 @@ pub fn compile( // CompileFn type is necessary to avoid compiler error if no backend is enabled let compile: CompileFn = match backend { + #[cfg(feature = "backend_v0_15")] + CompilerBackend::V0_15 => backend_v0_15::compile, #[cfg(feature = "backend_v0_14")] CompilerBackend::V0_14 => backend_v0_14::compile, #[cfg(feature = "backend_v0_13")] @@ -83,17 +116,16 @@ pub fn compile( }; let mut doc = compile( - root_crate_name, + root_crate_location.name(), root_crate_version, shader_def_values.clone(), shader_sources, )?; - post_process::post_process(&mut doc); for key in shader_def_values.keys() { if !doc.root.shader_defs.contains(key) { - println!("Warning: shader def `{}` was provived but not used", key); + println!("Warning: shader def `{}` was provided but not used", key); } } diff --git a/crates/docs/src/lib.rs b/crates/docs/src/lib.rs index 6325dd2..f158e5c 100644 --- a/crates/docs/src/lib.rs +++ b/crates/docs/src/lib.rs @@ -3,12 +3,14 @@ use std::fmt; pub use indexmap::{IndexMap, IndexSet}; pub use semver::Version; +#[derive(Debug)] pub struct Doc { pub version: Version, pub root: Module, pub compiled_with: IndexMap, } +#[derive(Debug)] pub struct Module { pub name: String, pub source_url: Option, @@ -20,6 +22,21 @@ pub struct Module { pub shader_defs: IndexSet, } +impl Module { + pub fn new(name: String) -> Module { + Self { + name, + source_url: None, + modules: Vec::new(), + constants: Vec::new(), + global_variables: Vec::new(), + structs: Vec::new(), + functions: Vec::new(), + shader_defs: IndexSet::new(), + } + } +} + #[derive(Debug, Clone, Copy)] pub enum ShaderDefValue { Bool(bool), @@ -37,20 +54,29 @@ impl fmt::Display for ShaderDefValue { } } +#[derive(Debug)] pub struct Constant { pub name: Ident, pub ty: Type, pub init: Expression, + /// Comment is stored as a single string, without starting or trailing comment markers. + /// It is fair to expect markdown. + pub comment: Option, } +#[derive(Debug)] pub struct GlobalVariable { pub name: Ident, pub space: AddressSpace, pub binding: Option, pub ty: Type, pub init: Option, + /// Comment is stored as a single string, without starting or trailing comment markers. + /// It is fair to expect markdown. + pub comment: Option, } +#[derive(Debug)] pub enum AddressSpace { Function, Private, @@ -81,11 +107,13 @@ impl fmt::Display for AddressSpace { } } +#[derive(Debug)] pub struct ResourceBinding { pub group: u32, pub binding: u32, } +#[derive(Debug)] pub enum Expression { Literal(Literal), Unknown, @@ -100,6 +128,7 @@ impl fmt::Display for Expression { } } +#[derive(Debug)] pub enum Literal { F64(f64), F32(f32), @@ -130,17 +159,26 @@ impl fmt::Display for Literal { } } +#[derive(Debug)] pub struct Struct { pub name: Ident, pub members: Vec, + /// Comment is stored as a single string, without starting or trailing comment markers. + /// It is fair to expect markdown. + pub comment: Option, } +#[derive(Debug)] pub struct StructMember { pub name: Ident, pub ty: Type, pub binding: Option, + /// Comment is stored as a single string, without starting or trailing comment markers. + /// It is fair to expect markdown. + pub comment: Option, } +#[derive(Debug)] pub enum Type { Named { name: String, @@ -159,12 +197,17 @@ pub enum Type { Unnamed, } +#[derive(Debug)] pub struct Function { pub name: Ident, pub arguments: Vec, pub ret: Option, + /// Comment is stored as a single string, without starting or trailing comment markers. + /// It is fair to expect markdown. + pub comment: Option, } +#[derive(Debug)] pub struct FunctionArgument { pub name: Ident, pub ty: Type, @@ -198,6 +241,7 @@ impl fmt::Display for Ident { } } +#[derive(Debug)] pub enum Binding { BuiltIn(BuiltIn), Location { diff --git a/crates/generator/Cargo.toml b/crates/generator/Cargo.toml index 196716b..5293c84 100644 --- a/crates/generator/Cargo.toml +++ b/crates/generator/Cargo.toml @@ -9,3 +9,4 @@ docs = { path = "../docs" } askama = "0.12.1" serde = { version = "1.0.193", features = ["derive"] } serde_json = "1.0.108" +markdown = "0.3.0" diff --git a/crates/generator/src/functions.rs b/crates/generator/src/functions.rs new file mode 100644 index 0000000..74c487a --- /dev/null +++ b/crates/generator/src/functions.rs @@ -0,0 +1,6 @@ +pub fn to_html(comment: &Option) -> String { + let Some(comment) = comment else { + return String::new(); + }; + markdown::to_html(&comment) +} diff --git a/crates/generator/src/lib.rs b/crates/generator/src/lib.rs index abc797e..7fd1b1a 100644 --- a/crates/generator/src/lib.rs +++ b/crates/generator/src/lib.rs @@ -1,5 +1,7 @@ mod all_items; +mod functions; + use askama::Template; use docs::{ Binding, BuiltIn, Constant, Doc, Function, GlobalVariable, Interpolation, Module, Sampling, diff --git a/crates/generator/templates/base.html b/crates/generator/templates/base.html index 775134c..84aa628 100644 --- a/crates/generator/templates/base.html +++ b/crates/generator/templates/base.html @@ -120,6 +120,29 @@ width: 8px; } + .item-list>li { + display: table-row; + } + + .item-list>li:hover { + background-color: #303030; + } + + .item-list>li>div { + display: table-cell; + } + + .item-list .docblock-short p { + margin-bottom: 0em; + margin-top: 0em; + padding: 0.25em; + } + + .item-list>li>.item-name { + width: 33%; + padding: 0.25em; + } + .item-list { list-style-type: none; padding: 0; @@ -341,4 +364,4 @@

- + \ No newline at end of file diff --git a/crates/generator/templates/constant.html b/crates/generator/templates/constant.html index d72b0f1..2fbd70c 100644 --- a/crates/generator/templates/constant.html +++ b/crates/generator/templates/constant.html @@ -1,7 +1,8 @@ {% extends "base.html" %} {% block content %} +{{ functions::to_html(constant.comment)|safe }}
 const {{ constant.name }}: {{ self::render_type(constant.ty, module_path.level)|safe }} = {{ constant.init }};
 
-{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/crates/generator/templates/function.html b/crates/generator/templates/function.html index b1bbcd5..5b99aad 100644 --- a/crates/generator/templates/function.html +++ b/crates/generator/templates/function.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% block content %} +{{ functions::to_html(function.comment)|safe }}
 
 {%- let ws_pre %}
@@ -22,4 +23,4 @@
     {{- ws_post -}}
 ) {% if let Some(ret) = function.ret %}-> {{ self::render_type(ret, module_path.level)|safe }}{% endif %}
 
-{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/crates/generator/templates/global_variable.html b/crates/generator/templates/global_variable.html index 8f80e69..4932d54 100644 --- a/crates/generator/templates/global_variable.html +++ b/crates/generator/templates/global_variable.html @@ -1,10 +1,11 @@ {% extends "base.html" %} {% block content %} +{{ functions::to_html(var.comment)|safe }}
 
     {%- if let Some(binding) = var.binding %}@group({{ binding.group }}) @binding({{ binding.binding }}) {% endif -%}
     var{{ var.space }} {{ var.name }}: {{ self::render_type(var.ty, module_path.level)|safe }}
     {%- if let Some(init) = var.init %} = {{ init }}{% endif -%};
 
-{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/crates/generator/templates/overview.html b/crates/generator/templates/overview.html index 41f99ec..cd9a121 100644 --- a/crates/generator/templates/overview.html +++ b/crates/generator/templates/overview.html @@ -15,7 +15,14 @@

Modules

Constants

{% endif %} @@ -24,7 +31,14 @@

Constants

Global Variables

    {% for var in module.global_variables %} -
  • {{ var.name }}
  • +
  • + +
    + {% if var.comment.is_some() %} + {{ functions::to_html(var.comment)|safe }} + {% endif %} +
    +
  • {% endfor %}
{% endif %} @@ -33,7 +47,13 @@

Global Variables

Structs

    {% for struct_ in module.structs %} -
  • {{ struct_.name }}
  • +
  • + +
    {% if struct_.comment.is_some() %} + {{ functions::to_html(struct_.comment)|safe }} + {% endif %} +
    +
  • {% endfor %}
{% endif %} @@ -42,7 +62,12 @@

Structs

Functions

    {% for function in module.functions %} -
  • {{ function.name }}
  • +
  • + + {% if function.comment.is_some() %} +
    {{ functions::to_html(function.comment)|safe }}
    + {% endif %} +
  • {% endfor %}
{% endif %} @@ -66,4 +91,4 @@
Compiled With:
{% endif %} -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/crates/generator/templates/struct.html b/crates/generator/templates/struct.html index 52dea72..b7bff6e 100644 --- a/crates/generator/templates/struct.html +++ b/crates/generator/templates/struct.html @@ -1,6 +1,7 @@ {% extends "base.html" %} {% block content %} +{{ functions::to_html(struct_.comment)|safe }}
 struct {{ struct_.name }} {
     {%- for member in struct_.members %}
@@ -8,4 +9,14 @@
     {%- endfor %}
 }
 
-{% endblock %} + +

Fields

+{%- for member in struct_.members %} +{{ self::display_binding(member.binding.as_ref()) }}{{ member.name }}: {{ self::render_type(member.ty, + module_path.level)|safe }} +
+ {{ functions::to_html(member.comment)|safe }} +
+{%- endfor %} + +{% endblock %} \ No newline at end of file diff --git a/crates/make/Cargo.toml b/crates/make/Cargo.toml index 6212bff..9cd7fb8 100644 --- a/crates/make/Cargo.toml +++ b/crates/make/Cargo.toml @@ -4,9 +4,11 @@ version = "0.1.0" edition = "2021" license = "MIT OR Apache-2.0" + [dependencies] docs = { path = "../docs" } compiler = { path = "../compiler", features = [ + "backend_v0_15", "backend_v0_14", "backend_v0_13", "backend_v0_11", diff --git a/crates/make/src/main.rs b/crates/make/src/main.rs index 324a377..a8c7fc6 100644 --- a/crates/make/src/main.rs +++ b/crates/make/src/main.rs @@ -1,20 +1,32 @@ +use compiler::CrateLocation; use docs::{IndexMap, ShaderDefValue, Version}; use std::path::Path; fn main() -> Result<(), Box> { // Compile docs let cache_path = Path::new("target/shader_docs_cache"); + let crate_location = CrateLocation::CratesIo(compiler::CratesIoIdentifier { name: "bevy" }); let docs = vec![ compiler::compile( - "bevy", + &CrateLocation::Local(compiler::CrateLocalPath { + path: &Path::new("../bevy"), + }), + Version::new(0, 15, 0), + |name| name.starts_with("bevy"), + custom_shader_defs(), + cache_path, + compiler::CompilerBackend::V0_15, + )?, + compiler::compile( + &crate_location, Version::new(0, 14, 0), |name| name.starts_with("bevy"), - shader_def_values_0_14(), + custom_shader_defs(), cache_path, compiler::CompilerBackend::V0_14, )?, compiler::compile( - "bevy", + &crate_location, Version::new(0, 13, 2), |name| name.starts_with("bevy"), shader_def_values_0_13(), @@ -22,7 +34,7 @@ fn main() -> Result<(), Box> { compiler::CompilerBackend::V0_13, )?, compiler::compile( - "bevy", + &crate_location, Version::new(0, 13, 1), |name| name.starts_with("bevy"), shader_def_values_0_13(), @@ -30,7 +42,7 @@ fn main() -> Result<(), Box> { compiler::CompilerBackend::V0_13, )?, compiler::compile( - "bevy", + &crate_location, Version::new(0, 13, 0), |name| name.starts_with("bevy"), shader_def_values_0_13(), @@ -38,7 +50,7 @@ fn main() -> Result<(), Box> { compiler::CompilerBackend::V0_13, )?, compiler::compile( - "bevy", + &crate_location, Version::new(0, 12, 1), |name| name.starts_with("bevy"), shader_def_values_0_12(), @@ -46,7 +58,7 @@ fn main() -> Result<(), Box> { compiler::CompilerBackend::V0_10, )?, compiler::compile( - "bevy", + &crate_location, Version::new(0, 12, 0), |name| name.starts_with("bevy"), shader_def_values_0_12(), @@ -54,7 +66,7 @@ fn main() -> Result<(), Box> { compiler::CompilerBackend::V0_10, )?, compiler::compile( - "bevy", + &crate_location, Version::new(0, 11, 3), |name| name.starts_with("bevy"), shader_def_values_0_11(), @@ -62,7 +74,7 @@ fn main() -> Result<(), Box> { compiler::CompilerBackend::V0_08, )?, compiler::compile( - "bevy", + &crate_location, Version::new(0, 11, 2), |name| name.starts_with("bevy"), shader_def_values_0_11(), @@ -70,7 +82,7 @@ fn main() -> Result<(), Box> { compiler::CompilerBackend::V0_08, )?, compiler::compile( - "bevy", + &crate_location, Version::new(0, 11, 1), |name| name.starts_with("bevy"), shader_def_values_0_11(), @@ -78,7 +90,7 @@ fn main() -> Result<(), Box> { compiler::CompilerBackend::V0_08, )?, compiler::compile( - "bevy", + &crate_location, Version::new(0, 11, 0), |name| name.starts_with("bevy"), shader_def_values_0_11(), @@ -95,8 +107,7 @@ fn main() -> Result<(), Box> { Ok(()) } -// TODO: More shader defs available on 0.14 -fn shader_def_values_0_14() -> IndexMap { +fn custom_shader_defs() -> IndexMap { use ShaderDefValue::*; [ @@ -135,6 +146,8 @@ fn shader_def_values_0_14() -> IndexMap { ("VERTEX_UVS", Bool(true)), ("VERTEX_UVS_A", Bool(true)), ("VERTEX_UVS_B", Bool(true)), + // 0.15 + ("DIRECTIONAL_LIGHT_SHADOW_MAP_DEBUG_CASCADES", Bool(true)), ] .into_iter() .map(|(key, value)| (key.to_string(), value)) diff --git a/docs/shader_docs_diagram.svg b/docs/shader_docs_diagram.svg new file mode 100644 index 0000000..2a137ec --- /dev/null +++ b/docs/shader_docs_diagram.svg @@ -0,0 +1 @@ + \ No newline at end of file