diff --git a/Cargo.lock b/Cargo.lock index 3f357753..dd25ddab 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -464,7 +464,7 @@ checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" dependencies = [ "libc", "num-integer", - "num-traits 0.2.14", + "num-traits 0.2.16", "time", "winapi 0.3.9", ] @@ -883,10 +883,11 @@ dependencies = [ [[package]] name = "dolly" -version = "0.3.0" -source = "git+https://github.com/h3r2tic/dolly.git?rev=0276fb4b5fe2e11c70919af7dbbcd645711c8f48#0276fb4b5fe2e11c70919af7dbbcd645711c8f48" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8bd01a2e160b741ea8fe693264718dda9e75a85e3fd38269b97e76361077f11" dependencies = [ - "glam", + "glam 0.22.0", ] [[package]] @@ -1200,14 +1201,23 @@ checksum = "f0a01e0497841a3b2db4f8afa483cce65f7e96a3498bd6c541734792aeac8fe7" [[package]] name = "glam" -version = "0.18.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525a3e490ba77b8e326fb67d4b44b4bd2f920f44d4cc73ccec50adc68e3bee34" +checksum = "12f597d56c1bd55a811a1be189459e8fad2bbc272616375602443bdfb37fa774" dependencies = [ - "num-traits 0.2.14", + "num-traits 0.2.16", "serde", ] +[[package]] +name = "glam" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42218cb640844e3872cc3c153dc975229e080a6c4733b34709ef445610550226" +dependencies = [ + "libm", +] + [[package]] name = "glob" version = "0.3.0" @@ -1362,7 +1372,7 @@ dependencies = [ "jpeg-decoder 0.1.22", "num-iter", "num-rational 0.3.2", - "num-traits 0.2.14", + "num-traits 0.2.16", "png 0.16.8", "scoped_threadpool", "tiff", @@ -1380,7 +1390,7 @@ dependencies = [ "jpeg-decoder 0.2.4", "num-iter", "num-rational 0.4.0", - "num-traits 0.2.14", + "num-traits 0.2.16", "png 0.17.5", ] @@ -1551,7 +1561,7 @@ dependencies = [ "easy-parallel", "exr", "fern", - "glam", + "glam 0.22.0", "half", "image 0.23.14", "kajiya-asset", @@ -1578,7 +1588,7 @@ dependencies = [ "byteorder", "bytes", "ddsfile", - "glam", + "glam 0.22.0", "gltf", "image 0.23.14", "intel_tex_2", @@ -1599,7 +1609,7 @@ dependencies = [ "easy-parallel", "env_logger", "futures", - "glam", + "glam 0.22.0", "kajiya-asset", "log", "num_cpus", @@ -1620,7 +1630,7 @@ dependencies = [ "bytes", "derive_builder", "futures", - "glam", + "glam 0.22.0", "gpu-allocator", "gpu-profiler", "hassle-rs", @@ -1674,7 +1684,7 @@ name = "kajiya-simple" version = "0.1.0" dependencies = [ "anyhow", - "glam", + "glam 0.22.0", "imgui", "kajiya", "kajiya-imgui", @@ -1774,12 +1784,12 @@ dependencies = [ [[package]] name = "macaw" -version = "0.15.0" +version = "0.18.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96ea524ece39c817dc5478897fceec1fb389eaaed9516813f1e51b21cb272239" +checksum = "b8fdbfdf07a7e53090afb7fd427eb0a4b46fc51cb484b2deba27b47919762dfb" dependencies = [ - "glam", - "num-traits 0.2.14", + "glam 0.22.0", + "num-traits 0.2.16", ] [[package]] @@ -1827,9 +1837,9 @@ dependencies = [ [[package]] name = "mikktspace" version = "0.2.0" -source = "git+https://github.com/h3r2tic/mikktspace.git?rev=f2d0412b91de385861664e54951ae7dcaaf63f2d#f2d0412b91de385861664e54951ae7dcaaf63f2d" +source = "git+https://github.com/h3r2tic/mikktspace.git?branch=master#f2d0412b91de385861664e54951ae7dcaaf63f2d" dependencies = [ - "glam", + "glam 0.24.1", ] [[package]] @@ -2120,7 +2130,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d2cc698a63b549a70bc047073d2949cce27cd1c7b0a4a862d08a8031bc2801db" dependencies = [ "autocfg", - "num-traits 0.2.14", + "num-traits 0.2.16", ] [[package]] @@ -2131,7 +2141,7 @@ checksum = "b2021c8337a54d21aca0d59a92577a029af9431cb59b909b03252b9c164fad59" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.14", + "num-traits 0.2.16", ] [[package]] @@ -2142,7 +2152,7 @@ checksum = "12ac428b1cb17fce6f731001d307d351ec70a6d202fc2e60f7d4c5e42d8f4f07" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.14", + "num-traits 0.2.16", ] [[package]] @@ -2153,7 +2163,7 @@ checksum = "d41702bd167c2df5520b384281bc111a4b5efcf7fbc4c9c222c815b07e0a6a6a" dependencies = [ "autocfg", "num-integer", - "num-traits 0.2.14", + "num-traits 0.2.16", ] [[package]] @@ -2162,14 +2172,14 @@ version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" dependencies = [ - "num-traits 0.2.14", + "num-traits 0.2.16", ] [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", "libm", @@ -2424,9 +2434,9 @@ checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086" [[package]] name = "proc-macro2" -version = "1.0.51" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d727cae5b39d21da60fa540906919ad737832fe0b1c165da3a34d6548c849d6" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ "unicode-ident", ] @@ -2566,7 +2576,7 @@ source = "git+https://github.com/gfx-rs/rspirv.git?rev=dae552c#dae552c484974ca28 dependencies = [ "derive_more", "fxhash", - "num-traits 0.2.14", + "num-traits 0.2.16", "spirv_headers", ] @@ -2583,6 +2593,7 @@ dependencies = [ name = "rust-shaders" version = "0.1.0" dependencies = [ + "glam 0.22.0", "macaw", "rust-shaders-shared", "spirv-std", @@ -2592,8 +2603,9 @@ dependencies = [ name = "rust-shaders-shared" version = "0.1.0" dependencies = [ + "glam 0.22.0", "macaw", - "num-traits 0.2.14", + "num-traits 0.2.16", "spirv-std", ] @@ -2823,32 +2835,31 @@ dependencies = [ [[package]] name = "spirv-std" -version = "0.4.0-alpha.12" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=b692ab5afc7fbdb4599b42ab3e0328dc7e8e0e97#b692ab5afc7fbdb4599b42ab3e0328dc7e8e0e97" +version = "0.9.0" +source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=e87c324bfda6bea144fe2635586281c4ef144f0d#e87c324bfda6bea144fe2635586281c4ef144f0d" dependencies = [ "bitflags", - "glam", - "num-traits 0.2.14", + "glam 0.24.1", + "num-traits 0.2.16", "spirv-std-macros", - "spirv-types", + "spirv-std-types", ] [[package]] name = "spirv-std-macros" -version = "0.4.0-alpha.12" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=b692ab5afc7fbdb4599b42ab3e0328dc7e8e0e97#b692ab5afc7fbdb4599b42ab3e0328dc7e8e0e97" +version = "0.9.0" +source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=e87c324bfda6bea144fe2635586281c4ef144f0d#e87c324bfda6bea144fe2635586281c4ef144f0d" dependencies = [ - "heck", "proc-macro2", "quote", - "spirv-types", + "spirv-std-types", "syn", ] [[package]] -name = "spirv-types" -version = "0.4.0-alpha.12" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=b692ab5afc7fbdb4599b42ab3e0328dc7e8e0e97#b692ab5afc7fbdb4599b42ab3e0328dc7e8e0e97" +name = "spirv-std-types" +version = "0.9.0" +source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=e87c324bfda6bea144fe2635586281c4ef144f0d#e87c324bfda6bea144fe2635586281c4ef144f0d" [[package]] name = "spirv_headers" @@ -2856,15 +2867,16 @@ version = "1.5.0" source = "git+https://github.com/gfx-rs/rspirv.git?rev=dae552c#dae552c484974ca280a2f18a686b42b38b0dc2ad" dependencies = [ "bitflags", - "num-traits 0.2.14", + "num-traits 0.2.16", ] [[package]] name = "splines" -version = "4.1.0" -source = "git+https://github.com/h3r2tic/splines.git?rev=aa0ea829b025d908c8621207764601cb6b059911#aa0ea829b025d908c8621207764601cb6b059911" +version = "4.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "345f11dca845086e60f1076569dedb4c2026e8dfe420d2900de8683142480bcf" dependencies = [ - "glam", + "glam 0.22.0", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 89112556..def55c00 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,4 +1,5 @@ [workspace] +resolver = "2" members = [ "crates/bin/bake", "crates/bin/hello", @@ -27,9 +28,6 @@ exclude = [ rspirv = { git = "https://github.com/gfx-rs/rspirv.git", rev = "dae552c" } spirv_headers = { git = "https://github.com/gfx-rs/rspirv.git", rev = "dae552c" } -# TODO look-at -dolly = { git = "https://github.com/h3r2tic/dolly.git", rev = "0276fb4b5fe2e11c70919af7dbbcd645711c8f48" } - [profile.release] debug = 1 diff --git a/crates/bin/rust-shader-builder/Cargo.lock b/crates/bin/rust-shader-builder/Cargo.lock index 89201e9e..d332523a 100644 --- a/crates/bin/rust-shader-builder/Cargo.lock +++ b/crates/bin/rust-shader-builder/Cargo.lock @@ -4,15 +4,24 @@ version = 3 [[package]] name = "ahash" -version = "0.7.4" +version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" dependencies = [ "getrandom", "once_cell", "version_check", ] +[[package]] +name = "aho-corasick" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c378d78423fdad8089616f827526ee33c19f2fddbd5de1629152c9593ba4783" +dependencies = [ + "memchr", +] + [[package]] name = "anyhow" version = "1.0.43" @@ -26,16 +35,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d67af77d68a931ecd5cbd8a3b5987d63a1d1d1278f7f6a60ae33db485cdebb69" [[package]] -name = "autocfg" -version = "1.0.1" +name = "arrayvec" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" [[package]] -name = "bimap" -version = "0.6.1" +name = "autocfg" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50ae17cabbc8a38a1e3e4c1a6a664e9a09672dc14d0896fa8d865d3a5a446b07" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "bitflags" @@ -52,6 +61,12 @@ dependencies = [ "spirv-builder", ] +[[package]] +name = "bytemuck" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" + [[package]] name = "byteorder" version = "1.4.3" @@ -60,11 +75,12 @@ checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" [[package]] name = "cc" -version = "1.0.69" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" dependencies = [ "jobserver", + "libc", ] [[package]] @@ -81,15 +97,31 @@ checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" [[package]] name = "derive_more" -version = "0.99.16" +version = "0.99.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "40eebddd2156ce1bb37b20bbe5151340a31828b1f2d22ba4141f3531710e38df" +checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version", - "syn", + "syn 1.0.109", +] + +[[package]] +name = "either" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a26ae43d7bcc3b814de94796a5e736d4029efb0ee900c12e2d54c993ad1a1e07" + +[[package]] +name = "elsa" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "714f766f3556b44e7e4776ad133fcc3445a489517c25c704ace411bb14790194" +dependencies = [ + "indexmap", + "stable_deref_trait", ] [[package]] @@ -103,9 +135,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.3" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ "cfg-if", "libc", @@ -121,27 +153,48 @@ dependencies = [ "ahash", ] +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + [[package]] name = "indexmap" -version = "1.7.0" +version = "1.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "internal-iterator" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a668ef46056a63366da9d74f48062da9ece1a27958f2f3704aa6f7421c4433f5" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", ] [[package]] name = "itoa" -version = "0.4.7" +version = "1.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "af150ab688ff2122fcef229be89cb50dd66af9e01a4ff320cc137eecc9bacc38" [[package]] name = "jobserver" -version = "0.1.23" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f5ca711fd837261e14ec9e674f092cbb931d3fa1482b017ae59328ddc6f3212b" +checksum = "936cfd212a0155903bcbc060e316fb6cc7cbf2e1907329391ebadc1fe0ce77c2" dependencies = [ "libc", ] @@ -154,21 +207,27 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.99" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765" +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] name = "libm" -version = "0.2.1" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7012b1bbb0719e1097c47611d3898568c546d597c2e74d66f6087edd5233ff4" + +[[package]] +name = "longest-increasing-subsequence" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" +checksum = "b3bd0dd2cd90571056fdb71f6275fada10131182f84899f4b2a916e565d81d86" [[package]] name = "memchr" -version = "2.4.0" +version = "2.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" +checksum = "5486aed0026218e61b8a01d5fbd5a0a134649abb71a0e53b7bc088529dced86e" [[package]] name = "nanoserde" @@ -187,9 +246,9 @@ checksum = "290eec6719d68aef1f5ca0e695f8ad6421adcf8791fc17641c4ccc6c5388fb39" [[package]] name = "num-traits" -version = "0.2.14" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a64b1ec5cda2586e284722486d802acf1f7dbdc623e2bfc57e65ca1cd099290" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ "autocfg", "libm", @@ -197,33 +256,24 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.8.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" - -[[package]] -name = "pest" -version = "2.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f4872ae94d7b90ae48754df22fd42ad52ce740b8f370b03da4835417403e53" -dependencies = [ - "ucd-trie", -] +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] name = "proc-macro2" -version = "1.0.28" +version = "1.0.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c7ed8b8c7b886ea3ed7dde405212185f423ab44682667c8c6dd14aa1d9f6612" +checksum = "18fb31db3f9bddb2ea821cde30a9f70117e3f119938b5ee630b7403aa6e2ead9" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] name = "quote" -version = "1.0.9" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -236,26 +286,39 @@ checksum = "e0501e134c6905fee1f10fed25b0a7e1261bf676cffac9543a7d0730dec01af2" [[package]] name = "regex" -version = "1.5.4" +version = "1.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12de2eff854e5fa4b1295edd650e227e9d8fb0c9e90b12e7f36d6a6811791a29" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07a8629359eb56f1e2fb1652bb04212c072a87ba68546a04065d525673ac461" +checksum = "49530408a136e16e5b486e883fbb6ba058e8e4e8ae6621a77b048b314336e629" dependencies = [ + "aho-corasick", + "memchr", "regex-syntax", ] [[package]] name = "regex-syntax" -version = "0.6.25" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +checksum = "dbb5fb1acd8a1a18b3dd5be62d25485eb770e05afb408a9627d14d451bae12da" [[package]] name = "rspirv" -version = "0.10.0+1.5.4" +version = "0.11.0+1.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce0e0a01cf9883c6f2846168515b5be6c4995bb90d4eeb7595bb0088a1001759" +checksum = "1503993b59ca9ae4127365c3293517576d7ce56be9f3d8abb1625c85ddc583ba" dependencies = [ - "derive_more", "fxhash", "num-traits", "spirv", @@ -263,52 +326,72 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.21" +version = "0.1.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" + +[[package]] +name = "rustc-hash" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" [[package]] name = "rustc_codegen_spirv" -version = "0.4.0-alpha.12" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=b692ab5afc7fbdb4599b42ab3e0328dc7e8e0e97#b692ab5afc7fbdb4599b42ab3e0328dc7e8e0e97" +version = "0.9.0" +source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=e87c324bfda6bea144fe2635586281c4ef144f0d#e87c324bfda6bea144fe2635586281c4ef144f0d" dependencies = [ "ar", - "bimap", - "hashbrown", + "either", + "hashbrown 0.11.2", "indexmap", + "itertools", + "lazy_static", "libc", "num-traits", + "once_cell", + "regex", "rspirv", "rustc-demangle", + "rustc_codegen_spirv-types", "sanitize-filename", "serde", "serde_json", "smallvec", + "spirt", "spirv-tools", - "syn", - "topological-sort", + "syn 1.0.109", +] + +[[package]] +name = "rustc_codegen_spirv-types" +version = "0.9.0" +source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=e87c324bfda6bea144fe2635586281c4ef144f0d#e87c324bfda6bea144fe2635586281c4ef144f0d" +dependencies = [ + "rspirv", + "serde", ] [[package]] name = "rustc_version" -version = "0.3.3" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" +checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ "semver", ] [[package]] name = "ryu" -version = "1.0.5" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] name = "sanitize-filename" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf18934a12018228c5b55a6dae9df5d0641e3566b3630cb46cc55564068e7c2f" +checksum = "08c502bdb638f1396509467cb0580ef3b29aa2a45c5d43e5d84928241280296c" dependencies = [ "lazy_static", "regex", @@ -316,47 +399,35 @@ dependencies = [ [[package]] name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.10.2" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] +checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" [[package]] name = "serde" -version = "1.0.127" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f03b9878abf6d14e6779d3f24f07b2cfa90352cfec4acc5aab8f1ac7f146fae8" +checksum = "cf9e0fcba69a370eed61bcf2b728575f726b50b55cba78064753d708ddc7549e" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.127" +version = "1.0.188" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a024926d3432516606328597e0f224a51355a493b49fdd67e9209187cbe55ecc" +checksum = "4eca7ac642d82aa35b60049a6eccb4be6be75e599bd2e9adb5f875a737654af2" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.29", ] [[package]] name = "serde_json" -version = "1.0.66" +version = "1.0.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "336b10da19a12ad094b59d870ebde26a45402e5b470add4b5fd03c5048a32127" +checksum = "693151e1ac27563d6dbcec9dee9fbd5da8539b20fa14ad3752b2e6d363ace360" dependencies = [ "itoa", "ryu", @@ -365,9 +436,33 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.6.1" +version = "1.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" +dependencies = [ + "serde", +] + +[[package]] +name = "spirt" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64e1f7903720ff818d6da824edf2c4082c6e7a029a99317fd10c39dd7c40c7ff" +dependencies = [ + "arrayvec", + "bytemuck", + "derive_more", + "elsa", + "indexmap", + "internal-iterator", + "itertools", + "lazy_static", + "longest-increasing-subsequence", + "rustc-hash", + "serde", + "serde_json", + "smallvec", +] [[package]] name = "spirv" @@ -381,71 +476,77 @@ dependencies = [ [[package]] name = "spirv-builder" -version = "0.4.0-alpha.12" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=b692ab5afc7fbdb4599b42ab3e0328dc7e8e0e97#b692ab5afc7fbdb4599b42ab3e0328dc7e8e0e97" +version = "0.9.0" +source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=e87c324bfda6bea144fe2635586281c4ef144f0d#e87c324bfda6bea144fe2635586281c4ef144f0d" dependencies = [ "memchr", "raw-string", "rustc_codegen_spirv", + "rustc_codegen_spirv-types", "serde", "serde_json", ] [[package]] name = "spirv-tools" -version = "0.7.1" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "47ffcd721c949125c13b1213a292477a2d82621512b094564bd918c3a1c7f7ff" +checksum = "dc7c8ca2077515286505bd3ccd396e55ac5706e80322e1d6d22a82e1cad4f7c3" dependencies = [ "spirv-tools-sys", ] [[package]] name = "spirv-tools-sys" -version = "0.5.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b967db819666ccf7a0373876321bfe852922edcc7f3e30e3a7668b02e1961119" +checksum = "b4b32d9d6469cd6b50dcd6bd841204b5946b4fb7b70a97872717cdc417659c9a" dependencies = [ "cc", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "syn" -version = "1.0.74" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1873d832550d4588c3dbc20f01361ab00bfe741048f71e3fecf145a7cc18b29c" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] -name = "topological-sort" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa7c7f42dea4b1b99439786f5633aeb9c14c1b53f75e282803c2ec2ad545873c" - -[[package]] -name = "ucd-trie" -version = "0.1.3" +name = "syn" +version = "2.0.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c" +checksum = "c324c494eba9d92503e6f1ef2e6df781e78f6a7705a0202d9801b198807d518a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] -name = "unicode-xid" -version = "0.2.2" +name = "unicode-ident" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3" +checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" [[package]] name = "version_check" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fecdca9a5291cc2b8dcf7dc02453fee791a280f3743cb0905f8822ae463b3fe" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] name = "wasi" -version = "0.10.2+wasi-snapshot-preview1" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" diff --git a/crates/bin/rust-shader-builder/Cargo.toml b/crates/bin/rust-shader-builder/Cargo.toml index 56e8ef7f..c8cc08b6 100644 --- a/crates/bin/rust-shader-builder/Cargo.toml +++ b/crates/bin/rust-shader-builder/Cargo.toml @@ -8,6 +8,6 @@ edition = "2021" [dependencies] anyhow = "1.0" nanoserde = "0.1" -spirv-builder = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "b692ab5afc7fbdb4599b42ab3e0328dc7e8e0e97" } +spirv-builder = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "e87c324bfda6bea144fe2635586281c4ef144f0d" } [workspace] \ No newline at end of file diff --git a/crates/bin/rust-shader-builder/rust-toolchain b/crates/bin/rust-shader-builder/rust-toolchain index 58417737..23aa9e1d 100644 --- a/crates/bin/rust-shader-builder/rust-toolchain +++ b/crates/bin/rust-shader-builder/rust-toolchain @@ -5,5 +5,5 @@ # to the user in the error, instead of "error: invalid channel name '[toolchain]'". [toolchain] -channel = "nightly-2021-09-29" -components = ["rust-src", "rustc-dev", "llvm-tools-preview"] +channel = "nightly-2023-07-08" +components = ["rust-src", "rustc-dev", "llvm-tools-preview"] \ No newline at end of file diff --git a/crates/bin/view/Cargo.toml b/crates/bin/view/Cargo.toml index 9970ef4d..fb566453 100644 --- a/crates/bin/view/Cargo.toml +++ b/crates/bin/view/Cargo.toml @@ -11,15 +11,15 @@ kajiya-simple = { path = "../../lib/kajiya-simple", features = ["dear-imgui", "w kajiya-asset-pipe = { path = "../../lib/kajiya-asset-pipe"} anyhow = "1.0" -dolly = "0.3" +dolly = "=0.4.0" imgui = "0.7" log = "0.4" ron = "0.6.2" serde = { version = "1.0", features = ["derive"] } structopt = "0.3" -splines = { git = "https://github.com/h3r2tic/splines.git", rev = "aa0ea829b025d908c8621207764601cb6b059911", features = ["impl-glam"] } toml = "0.7.2" +splines = { version = "4.2.0", features = ["glam"] } [features] dlss = ["kajiya/dlss"] -puffin-server = ['kajiya-simple/puffin-server'] \ No newline at end of file +puffin-server = ['kajiya-simple/puffin-server'] diff --git a/crates/bin/view/src/keymap.rs b/crates/bin/view/src/keymap.rs index a691fa00..e78ac5d2 100644 --- a/crates/bin/view/src/keymap.rs +++ b/crates/bin/view/src/keymap.rs @@ -1,10 +1,11 @@ use anyhow::{anyhow, Context}; -use kajiya_simple::VirtualKeyCode::*; -use kajiya_simple::{KeyMap, KeyboardMap, VirtualKeyCode}; +use kajiya_simple::{KeyMap, KeyboardMap, VirtualKeyCode, VirtualKeyCode::*}; use serde::{Deserialize, Serialize}; -use std::fs::{canonicalize, File}; -use std::io::Read; -use std::path::PathBuf; +use std::{ + fs::{canonicalize, File}, + io::Read, + path::PathBuf, +}; use toml::from_str; #[derive(Serialize, Deserialize, Default, Clone)] diff --git a/crates/lib/kajiya-asset-pipe/Cargo.toml b/crates/lib/kajiya-asset-pipe/Cargo.toml index 1ea7d555..675532a0 100644 --- a/crates/lib/kajiya-asset-pipe/Cargo.toml +++ b/crates/lib/kajiya-asset-pipe/Cargo.toml @@ -14,7 +14,7 @@ async-executor = "1.4" easy-parallel = "3.1" env_logger = "0.8.4" futures = "0.3" -glam = "0.18" +glam = "0.22" log = "0.4" num_cpus = "1.13" smol = "1.2.5" diff --git a/crates/lib/kajiya-asset/Cargo.toml b/crates/lib/kajiya-asset/Cargo.toml index 82f4046a..c559f9dc 100644 --- a/crates/lib/kajiya-asset/Cargo.toml +++ b/crates/lib/kajiya-asset/Cargo.toml @@ -13,11 +13,11 @@ base64 = "0.12" byteorder = "1.4" bytes = "1.0" ddsfile = "0.4" -glam = "0.18" +glam = "0.22" gltf = { git = "https://github.com/gltf-rs/gltf.git", rev = "b9c04be69363b8353d58f99aa1008ead93020851", features = ["KHR_texture_transform", "KHR_materials_pbrSpecularGlossiness"] } # no submodules image = { version = "0.23.13", default-features = false, features = ["gif", "jpeg", "ico", "png", "pnm", "tga", "tiff", "webp", "bmp", "hdr", "dxt"] } intel_tex_2 = "0.2.0" log = "0.4" -mikktspace = { git = "https://github.com/h3r2tic/mikktspace.git", rev = "f2d0412b91de385861664e54951ae7dcaaf63f2d", default-features = false, features = ["glam"] } +mikktspace = { git = "https://github.com/h3r2tic/mikktspace.git", branch = "master", default-features = false, features = ["glam"] } turbosloth = { git = "https://github.com/h3r2tic/turbosloth.git", rev = "92030af" } urlencoding = "2.1" diff --git a/crates/lib/kajiya-backend/Cargo.toml b/crates/lib/kajiya-backend/Cargo.toml index 43cdc1fa..6834eec5 100644 --- a/crates/lib/kajiya-backend/Cargo.toml +++ b/crates/lib/kajiya-backend/Cargo.toml @@ -15,7 +15,7 @@ byte-slice-cast = "0.3" bytes = "1.0" derive_builder = { version = "0.9", default-features = false } futures = "0.3" -glam = "0.18" +glam = "0.22" gpu-allocator = { git = "https://github.com/Traverse-Research/gpu-allocator.git", rev = "e66d062cbd73a6c98834fc3e3acef98318097156" } gpu-profiler = { git = "https://github.com/h3r2tic/gpu-profiler.git", rev = "fac8dd96ceacfb69ec278c9697c3bfd2d8b8a9b7", features = ["use-ash"] } hassle-rs = "0.10" diff --git a/crates/lib/kajiya-backend/src/vulkan/ray_tracing.rs b/crates/lib/kajiya-backend/src/vulkan/ray_tracing.rs index b8ae0fa3..fd89120f 100644 --- a/crates/lib/kajiya-backend/src/vulkan/ray_tracing.rs +++ b/crates/lib/kajiya-backend/src/vulkan/ray_tracing.rs @@ -885,8 +885,7 @@ pub fn create_ray_tracing_pipeline( let mut descriptor_pool_sizes: Vec = Vec::new(); for bindings in set_layout_info.iter() { for ty in bindings.values() { - if let Some(mut dps) = descriptor_pool_sizes.iter_mut().find(|item| item.ty == *ty) - { + if let Some(dps) = descriptor_pool_sizes.iter_mut().find(|item| item.ty == *ty) { dps.descriptor_count += 1; } else { descriptor_pool_sizes.push(vk::DescriptorPoolSize { diff --git a/crates/lib/kajiya-backend/src/vulkan/shader.rs b/crates/lib/kajiya-backend/src/vulkan/shader.rs index 705159e0..ee97c414 100644 --- a/crates/lib/kajiya-backend/src/vulkan/shader.rs +++ b/crates/lib/kajiya-backend/src/vulkan/shader.rs @@ -448,8 +448,7 @@ pub fn create_compute_pipeline( let mut descriptor_pool_sizes: Vec = Vec::new(); for bindings in set_layout_info.iter() { for ty in bindings.values() { - if let Some(mut dps) = descriptor_pool_sizes.iter_mut().find(|item| item.ty == *ty) - { + if let Some(dps) = descriptor_pool_sizes.iter_mut().find(|item| item.ty == *ty) { dps.descriptor_count += 1; } else { descriptor_pool_sizes.push(vk::DescriptorPoolSize { @@ -984,8 +983,7 @@ pub fn create_raster_pipeline( let mut descriptor_pool_sizes: Vec = Vec::new(); for bindings in set_layout_info.iter() { for ty in bindings.values() { - if let Some(mut dps) = descriptor_pool_sizes.iter_mut().find(|item| item.ty == *ty) - { + if let Some(dps) = descriptor_pool_sizes.iter_mut().find(|item| item.ty == *ty) { dps.descriptor_count += 1; } else { descriptor_pool_sizes.push(vk::DescriptorPoolSize { diff --git a/crates/lib/kajiya-simple/Cargo.toml b/crates/lib/kajiya-simple/Cargo.toml index 1bba2503..adbc8e48 100644 --- a/crates/lib/kajiya-simple/Cargo.toml +++ b/crates/lib/kajiya-simple/Cargo.toml @@ -10,7 +10,7 @@ kajiya = { path = "../kajiya" } kajiya-imgui = { path = "../kajiya-imgui", optional = true } anyhow = "1.0" -glam = { version = "0.18", features = ["serde"] } +glam = { version = "0.22", features = ["serde"] } log = "0.4" puffin = { version = "0.11.0" } turbosloth = { git = "https://github.com/h3r2tic/turbosloth.git", rev = "92030af" } diff --git a/crates/lib/kajiya/Cargo.toml b/crates/lib/kajiya/Cargo.toml index 9bff5792..db23231b 100644 --- a/crates/lib/kajiya/Cargo.toml +++ b/crates/lib/kajiya/Cargo.toml @@ -18,7 +18,7 @@ bytemuck = "1.9.1" chrono = "0.4" exr = "1.4.1" fern = { version = "0.6", features = ["colored"] } -glam = { version = "0.18" } +glam = "0.22" half = { version = "1.8.2", features = ["bytemuck"] } image = { version = "0.23.13", default-features = false, features = ["gif", "jpeg", "ico", "png", "pnm", "tga", "tiff", "webp", "bmp", "hdr", "dxt"] } lazy_static = "1.4" diff --git a/crates/lib/rust-shaders-shared/Cargo.toml b/crates/lib/rust-shaders-shared/Cargo.toml index d79b62be..c83006f0 100644 --- a/crates/lib/rust-shaders-shared/Cargo.toml +++ b/crates/lib/rust-shaders-shared/Cargo.toml @@ -8,8 +8,9 @@ test = false doctest = false [dependencies] -macaw = { version = "0.15", default-features = false, features = ["libm"] } -num-traits = { version = "0.2.14", default-features = false, features = ["libm"] } +glam = { version = "0.22", default-features = false, features = ["libm"] } +macaw = { version = "0.18.6", default-features = false, features = ["libm"] } +num-traits = { version = "0.2.16", default-features = false, features = ["libm"] } [target.'cfg(target_arch = "spirv")'.dependencies] -spirv-std = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "b692ab5afc7fbdb4599b42ab3e0328dc7e8e0e97", features = ["glam"] } +spirv-std = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "e87c324bfda6bea144fe2635586281c4ef144f0d" } diff --git a/crates/lib/rust-shaders-shared/src/camera.rs b/crates/lib/rust-shaders-shared/src/camera.rs index 64f44da3..efb8b180 100644 --- a/crates/lib/rust-shaders-shared/src/camera.rs +++ b/crates/lib/rust-shaders-shared/src/camera.rs @@ -1,4 +1,4 @@ -use macaw::{Mat4, Vec3, Vec4}; +use glam::{Mat4, Vec3, Vec4}; #[derive(PartialEq, Clone, Copy)] #[repr(C)] diff --git a/crates/lib/rust-shaders-shared/src/frame_constants.rs b/crates/lib/rust-shaders-shared/src/frame_constants.rs index 1584a4df..dc66a600 100644 --- a/crates/lib/rust-shaders-shared/src/frame_constants.rs +++ b/crates/lib/rust-shaders-shared/src/frame_constants.rs @@ -1,5 +1,5 @@ use crate::{render_overrides::RenderOverrides, view_constants::ViewConstants}; -use macaw::{IVec4, Vec4}; +use glam::{IVec4, Vec4}; pub const IRCACHE_CASCADE_COUNT: usize = 12; diff --git a/crates/lib/rust-shaders-shared/src/gbuffer.rs b/crates/lib/rust-shaders-shared/src/gbuffer.rs index 875ea53a..17f6d052 100644 --- a/crates/lib/rust-shaders-shared/src/gbuffer.rs +++ b/crates/lib/rust-shaders-shared/src/gbuffer.rs @@ -1,5 +1,5 @@ use crate::util::*; -use macaw::*; +use glam::*; #[cfg(target_arch = "spirv")] use spirv_std::float::{f16x2_to_vec2, vec2_to_f16x2}; diff --git a/crates/lib/rust-shaders-shared/src/ssgi.rs b/crates/lib/rust-shaders-shared/src/ssgi.rs index b4985c34..d43e6c35 100644 --- a/crates/lib/rust-shaders-shared/src/ssgi.rs +++ b/crates/lib/rust-shaders-shared/src/ssgi.rs @@ -1,16 +1,16 @@ -use macaw::Vec4; +use glam::Vec4; #[derive(Clone, Copy)] #[repr(C)] pub struct SsgiConstants { pub input_tex_size: Vec4, pub output_tex_size: Vec4, - pub use_ao_only: bool, + pub use_ao_only: u8, pub ssgi_half_sample_count: u32, pub max_kernel_radius_cs: f32, - pub use_kernel_distance_scaling: bool, - pub use_random_jitter: bool, + pub use_kernel_distance_scaling: u8, + pub use_random_jitter: u8, pub kernel_radius: f32, } @@ -19,11 +19,11 @@ impl SsgiConstants { Self { input_tex_size, output_tex_size, - use_ao_only: true, + use_ao_only: 1, ssgi_half_sample_count: 6, max_kernel_radius_cs: 0.4, - use_kernel_distance_scaling: false, - use_random_jitter: false, + use_kernel_distance_scaling: 0, + use_random_jitter: 0, kernel_radius: 60.0, } } @@ -32,11 +32,11 @@ impl SsgiConstants { Self { input_tex_size, output_tex_size, - use_ao_only: false, + use_ao_only: 0, ssgi_half_sample_count: 32, max_kernel_radius_cs: 100.0, - use_kernel_distance_scaling: true, - use_random_jitter: true, + use_kernel_distance_scaling: 1, + use_random_jitter: 1, kernel_radius: 5.0, } } diff --git a/crates/lib/rust-shaders-shared/src/util.rs b/crates/lib/rust-shaders-shared/src/util.rs index 071a1302..6c63214a 100644 --- a/crates/lib/rust-shaders-shared/src/util.rs +++ b/crates/lib/rust-shaders-shared/src/util.rs @@ -1,7 +1,6 @@ use crate::frame_constants::FrameConstants; -use macaw::{ - const_mat3, FloatExt, Mat3, UVec2, UVec3, Vec2, Vec3, Vec3Swizzles, Vec4, Vec4Swizzles, -}; +use glam::{Mat3, UVec2, UVec3, Vec2, Vec3, Vec3Swizzles, Vec4, Vec4Swizzles}; +use macaw::FloatExt; #[cfg(target_arch = "spirv")] use spirv_std::num_traits::Float; @@ -89,12 +88,12 @@ pub fn depth_to_view_z_vec4(depth: Vec4, frame_constants: &FrameConstants) -> Ve // therefore the initializers _appear_ transposed compared to HLSL. // The difference is only in the `top` and `bottom` ones; the others are symmetric. pub const CUBE_MAP_FACE_ROTATIONS: [Mat3; 6] = [ - const_mat3!([0.0, 0.0, -1.0], [0.0, -1.0, 0.0], [-1.0, 0.0, 0.0]), // right - const_mat3!([0.0, 0.0, 1.0], [0.0, -1.0, 0.0], [1.0, 0.0, 0.0]), // left - const_mat3!([1.0, 0.0, 0.0], [0.0, 0.0, 1.0], [0.0, -1.0, 0.0]), // top - const_mat3!([1.0, 0.0, 0.0], [0.0, 0.0, -1.0], [0.0, 1.0, 0.0]), // bottom - const_mat3!([1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, -1.0]), // back - const_mat3!([-1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, 1.0]), // front + Mat3::from_cols_array_2d(&[[0.0, 0.0, -1.0], [0.0, -1.0, 0.0], [-1.0, 0.0, 0.0]]), // right + Mat3::from_cols_array_2d(&[[0.0, 0.0, 1.0], [0.0, -1.0, 0.0], [1.0, 0.0, 0.0]]), // left + Mat3::from_cols_array_2d(&[[1.0, 0.0, 0.0], [0.0, 0.0, 1.0], [0.0, -1.0, 0.0]]), // top + Mat3::from_cols_array_2d(&[[1.0, 0.0, 0.0], [0.0, 0.0, -1.0], [0.0, 1.0, 0.0]]), // bottom + Mat3::from_cols_array_2d(&[[1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, -1.0]]), // back + Mat3::from_cols_array_2d(&[[-1.0, 0.0, 0.0], [0.0, -1.0, 0.0], [0.0, 0.0, 1.0]]), // front ]; pub fn radical_inverse_vdc(mut bits: u32) -> f32 { diff --git a/crates/lib/rust-shaders-shared/src/view_constants.rs b/crates/lib/rust-shaders-shared/src/view_constants.rs index babec961..a538f2e7 100644 --- a/crates/lib/rust-shaders-shared/src/view_constants.rs +++ b/crates/lib/rust-shaders-shared/src/view_constants.rs @@ -1,5 +1,5 @@ use crate::camera::CameraMatrices; -use macaw::{Mat4, UVec2, Vec2, Vec3}; +use glam::{Mat4, UVec2, Vec2, Vec3}; #[derive(Clone, Copy)] #[repr(C, align(16))] diff --git a/crates/lib/rust-shaders-shared/src/view_ray.rs b/crates/lib/rust-shaders-shared/src/view_ray.rs index b2d523cc..7266a3c6 100644 --- a/crates/lib/rust-shaders-shared/src/view_ray.rs +++ b/crates/lib/rust-shaders-shared/src/view_ray.rs @@ -1,5 +1,5 @@ use crate::{frame_constants::FrameConstants, util::*}; -use macaw::*; +use glam::*; #[repr(C)] pub struct ViewRayContext { diff --git a/crates/lib/rust-shaders/Cargo.toml b/crates/lib/rust-shaders/Cargo.toml index fa496c07..6fc37b33 100644 --- a/crates/lib/rust-shaders/Cargo.toml +++ b/crates/lib/rust-shaders/Cargo.toml @@ -10,5 +10,6 @@ doctest = false [dependencies] rust-shaders-shared = { path = "../rust-shaders-shared" } -spirv-std = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "b692ab5afc7fbdb4599b42ab3e0328dc7e8e0e97", features = ["glam"] } -macaw = { version = "0.15", default-features = false, features = ["libm"] } \ No newline at end of file +spirv-std = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "e87c324bfda6bea144fe2635586281c4ef144f0d" } +macaw = { version = "0.18", default-features = false, features = ["libm"] } +glam = { version = "0.22", default-features = false, features = ["libm"] } diff --git a/crates/lib/rust-shaders/src/blur.rs b/crates/lib/rust-shaders/src/blur.rs index e57c0d2a..18f02ff5 100644 --- a/crates/lib/rust-shaders/src/blur.rs +++ b/crates/lib/rust-shaders/src/blur.rs @@ -1,4 +1,4 @@ -use macaw::{IVec2, UVec2, UVec3, Vec4}; +use glam::{IVec2, UVec2, UVec3, Vec4}; use spirv_std::{ arch::control_barrier, memory::{Scope, Semantics}, diff --git a/crates/lib/rust-shaders/src/color.rs b/crates/lib/rust-shaders/src/color.rs index b578ea26..49ba0720 100644 --- a/crates/lib/rust-shaders/src/color.rs +++ b/crates/lib/rust-shaders/src/color.rs @@ -1,15 +1,17 @@ -use macaw::{const_mat3, Mat3, Vec3}; +use macaw::{Mat3, Vec3}; pub fn lin_srgb_to_ycbcr(col: Vec3) -> Vec3 { // NOTE! This matrix needs to be transposed from the HLSL equivalent. - const M: Mat3 = - const_mat3!([0.2126, -0.1146, 0.5, 0.7152, -0.3854, -0.4542, 0.0722, 0.5, -0.0458]); + const M: Mat3 = Mat3::from_cols_array(&[ + 0.2126, -0.1146, 0.5, 0.7152, -0.3854, -0.4542, 0.0722, 0.5, -0.0458, + ]); M * col } pub fn ycbcr_to_lin_srgb(col: Vec3) -> Vec3 { // NOTE! This matrix needs to be transposed from the HLSL equivalent. - const M: Mat3 = const_mat3!([1.0, 1.0, 1.0, 0.0, -0.1873, 1.8556, 1.5748, -0.4681, 0.0]); + const M: Mat3 = + Mat3::from_cols_array(&[1.0, 1.0, 1.0, 0.0, -0.1873, 1.8556, 1.5748, -0.4681, 0.0]); M * col } diff --git a/crates/lib/rust-shaders/src/copy_depth_to_r.rs b/crates/lib/rust-shaders/src/copy_depth_to_r.rs index 9867c4a0..1d1e86a8 100644 --- a/crates/lib/rust-shaders/src/copy_depth_to_r.rs +++ b/crates/lib/rust-shaders/src/copy_depth_to_r.rs @@ -1,4 +1,4 @@ -use macaw::{UVec3, Vec4}; +use glam::{UVec3, Vec4}; use spirv_std::Image; #[cfg(not(target_arch = "spirv"))] diff --git a/crates/lib/rust-shaders/src/gbuffer.rs b/crates/lib/rust-shaders/src/gbuffer.rs index 6d465940..fb4819aa 100644 --- a/crates/lib/rust-shaders/src/gbuffer.rs +++ b/crates/lib/rust-shaders/src/gbuffer.rs @@ -1,4 +1,4 @@ -use macaw::{UVec4, Vec2, Vec3}; +use glam::{UVec4, Vec2, Vec3}; use rust_shaders_shared::util; #[repr(C)] diff --git a/crates/lib/rust-shaders/src/lib.rs b/crates/lib/rust-shaders/src/lib.rs index 6cf04dd4..4d2dd8c9 100644 --- a/crates/lib/rust-shaders/src/lib.rs +++ b/crates/lib/rust-shaders/src/lib.rs @@ -1,9 +1,4 @@ -#![cfg_attr( - target_arch = "spirv", - no_std, - feature(register_attr, asm), - register_attr(spirv) -)] +#![cfg_attr(target_arch = "spirv", no_std)] #![allow(clippy::too_many_arguments)] pub mod bilinear; @@ -16,3 +11,6 @@ pub mod motion_blur; pub mod pack_unpack; pub mod rev_blur; pub mod ssgi; + +#[macro_use] +extern crate spirv_std; diff --git a/crates/lib/rust-shaders/src/motion_blur.rs b/crates/lib/rust-shaders/src/motion_blur.rs index 47cdcfb4..bd8d7a0c 100644 --- a/crates/lib/rust-shaders/src/motion_blur.rs +++ b/crates/lib/rust-shaders/src/motion_blur.rs @@ -1,6 +1,4 @@ -use macaw::{ - uvec2, vec2, IVec2, IVec3, UVec2, UVec3, Vec2, Vec3, Vec3Swizzles, Vec4, Vec4Swizzles, -}; +use glam::{uvec2, vec2, IVec2, IVec3, UVec2, UVec3, Vec2, Vec3, Vec3Swizzles, Vec4, Vec4Swizzles}; use rust_shaders_shared::{ frame_constants::FrameConstants, util::{depth_to_view_z, get_uv_u}, diff --git a/crates/lib/rust-shaders/src/rev_blur.rs b/crates/lib/rust-shaders/src/rev_blur.rs index c5260f62..85554d31 100644 --- a/crates/lib/rust-shaders/src/rev_blur.rs +++ b/crates/lib/rust-shaders/src/rev_blur.rs @@ -1,6 +1,6 @@ use spirv_std::{Image, Sampler}; -use macaw::{UVec3, Vec2, Vec4}; +use glam::{UVec3, Vec2, Vec4}; #[cfg(not(target_arch = "spirv"))] use spirv_std::macros::spirv; diff --git a/crates/lib/rust-shaders/src/ssgi.rs b/crates/lib/rust-shaders/src/ssgi.rs index 383a4435..23721077 100644 --- a/crates/lib/rust-shaders/src/ssgi.rs +++ b/crates/lib/rust-shaders/src/ssgi.rs @@ -1,7 +1,7 @@ -use macaw::{ - ivec2, uvec3, vec2, vec4, FloatExt, IVec3, UVec3, Vec2, Vec3, Vec3Swizzles, Vec4, Vec4Ext, - Vec4Swizzles, +use glam::{ + ivec2, uvec3, uvec4, vec2, vec4, IVec3, UVec3, Vec2, Vec3, Vec3Swizzles, Vec4, Vec4Swizzles, }; +use macaw::FloatExt; use rust_shaders_shared::{ frame_constants::FrameConstants, gbuffer::*, ssgi::SsgiConstants, util::*, view_ray::ViewRayContext, @@ -15,7 +15,7 @@ use spirv_std::macros::spirv; use spirv_std::num_traits::Float; fn ssgi_kernel_radius(constants: &SsgiConstants) -> f32 { - if constants.use_ao_only { + if constants.use_ao_only == 1 { constants.kernel_radius * constants.output_tex_size.w } else { constants.kernel_radius @@ -221,8 +221,13 @@ pub fn temporal_filter_cs( let ex = vsum / wsum; let ex2 = vsum2 / wsum; - let dev = (Vec4::ZERO.max(ex2 - ex * ex)).sqrt(); - + let variance = Vec4::ZERO.max(ex2 - ex * ex); + let dev = vec4( + variance.x.sqrt(), + variance.y.sqrt(), + variance.z.sqrt(), + variance.w.sqrt(), + ); let box_size = 0.5; let n_deviations = 5.0; @@ -416,7 +421,13 @@ pub fn ssgi_cs( } let gbuffer_packed: Vec4 = gbuffer_tex.fetch(px.xy() * 2); - let gbuffer = GbufferDataPacked::from(gbuffer_packed.to_bits()).unpack(); + let gbuffer = GbufferDataPacked::from(uvec4( + gbuffer_packed.x.to_bits(), + gbuffer_packed.y.to_bits(), + gbuffer_packed.z.to_bits(), + gbuffer_packed.w.to_bits(), + )) + .unpack(); let normal_vs = (frame_constants.view_constants.world_to_view * gbuffer.normal.extend(0.0)) .xyz() .normalize(); @@ -435,7 +446,7 @@ pub fn ssgi_cs( let spatial_offset_noise = (1.0 / 4.0) * ((px.y - px.x) & 3) as f32; let temporal_offset_noise = TEMPORAL_OFFSETS[(frame_constants.frame_index / 6 % 4) as usize]; - if constants.use_random_jitter { + if constants.use_random_jitter == 1 { let seed0 = hash3(uvec3(frame_constants.frame_index, px.x, px.y)); spatial_direction_noise += uint_to_u01_float(seed0) * 0.1; } @@ -451,7 +462,7 @@ pub fn ssgi_cs( let kernel_radius_shrinkage = { // Convert AO radius into world scale - let cs_kernel_radius_scaled = if constants.use_kernel_distance_scaling { + let cs_kernel_radius_scaled = if constants.use_kernel_distance_scaling == 1 { kernel_radius_cs * frame_constants .view_constants @@ -571,7 +582,7 @@ pub fn ssgi_cs( let inv_ao = integrate_arc(h1p, h2p, n_angle); - let mut col = if constants.use_ao_only { + let mut col = if constants.use_ao_only == 1 { Vec4::splat(0.0f32.max(inv_ao)) } else { color_accum.xyz().extend(0.0f32.max(inv_ao))