From 5e0c936b4a1a86daa4ab95d02caea9dadb0227cc Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Sat, 30 Oct 2021 23:05:12 +0100 Subject: [PATCH 1/3] Start to upgrade rust-gpu This nearly works with naga, but we're blocked on https://github.com/EmbarkStudios/rust-gpu/issues/689 --- rust-gpu-toy/Cargo.lock | 806 ++++++++++++++----------------- rust-gpu-toy/Cargo.toml | 8 +- rust-gpu-toy/rust-toolchain.toml | 2 +- rust-gpu-toy/shaders/Cargo.toml | 4 +- rust-gpu-toy/shaders/src/lib.rs | 7 +- rust-gpu-toy/src/main.rs | 151 +++--- 6 files changed, 456 insertions(+), 522 deletions(-) diff --git a/rust-gpu-toy/Cargo.lock b/rust-gpu-toy/Cargo.lock index b056487..2adc584 100644 --- a/rust-gpu-toy/Cargo.lock +++ b/rust-gpu-toy/Cargo.lock @@ -4,9 +4,9 @@ version = 3 [[package]] name = "ab_glyph_rasterizer" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9fe5e32de01730eb1f6b7f5b51c17e03e2325bf40a74f754f04f130043affff" +checksum = "a13739d7177fbd22bb0ed28badfff9f372f8bef46c863db4e1c6248f6b223b6e" [[package]] name = "ahash" @@ -14,6 +14,17 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + [[package]] name = "andrew" version = "0.3.1" @@ -27,19 +38,25 @@ dependencies = [ "xml-rs", ] +[[package]] +name = "ar" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d67af77d68a931ecd5cbd8a3b5987d63a1d1d1278f7f6a60ae33db485cdebb69" + [[package]] name = "arrayvec" -version = "0.5.2" +version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" +checksum = "8da52d66c7071e2e3fa2a1e5c6d088fec47b593032b254f5e980de8ea54454d6" [[package]] name = "ash" -version = "0.32.1" +version = "0.33.3+1.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06063a002a77d2734631db74e8f4ce7148b77fe522e6bca46f2ae7774fd48112" +checksum = "cc4f1d82f164f838ae413296d1131aa6fa79b917d25bebaa7033d25620c09219" dependencies = [ - "libloading 0.7.0", + "libloading 0.7.1", ] [[package]] @@ -91,9 +108,9 @@ checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block" @@ -103,15 +120,15 @@ checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" [[package]] name = "bumpalo" -version = "3.7.0" +version = "3.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c59e7af012c713f529e7a3ee57ce9b31ddd858d4b512923602f74608b009631" +checksum = "8f1e260c3a9040a7c19a12468758f4c16f31a81a1fe087482be9570ec864bb6c" [[package]] name = "bytemuck" -version = "1.7.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9966d2ab714d0f785dbac0a0396251a35280aeb42413281617d0209ab4898435" +checksum = "72957246c41db82b8ef88a5486143830adeb8227ef9837740bdec67724cf2c5b" dependencies = [ "bytemuck_derive", ] @@ -151,9 +168,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.68" +version = "1.0.71" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a72c244c1ff497a746a7e1fb3d14bd08420ecda70c8f25c7112f2781652d787" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" dependencies = [ "jobserver", ] @@ -185,7 +202,7 @@ dependencies = [ "bitflags", "block", "cocoa-foundation", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "core-graphics 0.22.2", "foreign-types", "libc", @@ -200,7 +217,7 @@ checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" dependencies = [ "bitflags", "block", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "core-graphics-types", "foreign-types", "libc", @@ -226,12 +243,6 @@ dependencies = [ "cache-padded", ] -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - [[package]] name = "copyless" version = "0.1.5" @@ -250,11 +261,11 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" dependencies = [ - "core-foundation-sys 0.8.2", + "core-foundation-sys 0.8.3", "libc", ] @@ -266,9 +277,9 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "core-foundation-sys" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "core-graphics" @@ -289,7 +300,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "269f35f69b542b80e736a20a89a05215c0ce80c2c03c514abb2e318b78379d86" dependencies = [ "bitflags", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "core-graphics-types", "foreign-types", "libc", @@ -302,7 +313,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" dependencies = [ "bitflags", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "foreign-types", "libc", ] @@ -346,9 +357,9 @@ dependencies = [ [[package]] name = "crossbeam-deque" -version = "0.8.0" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" +checksum = "6455c0ca19f0d2fbf751b908d5c55c1f5cbc65e03c4225427254b46890bdde1e" dependencies = [ "cfg-if 1.0.0", "crossbeam-epoch", @@ -390,12 +401,12 @@ dependencies = [ [[package]] name = "d3d12" -version = "0.4.0" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "091ed1b25fe47c7ff129fc440c23650b6114f36aa00bc7212cc8041879294428" +checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c" dependencies = [ "bitflags", - "libloading 0.7.0", + "libloading 0.7.1", "winapi", ] @@ -446,15 +457,23 @@ dependencies = [ ] [[package]] -name = "derive_more" -version = "0.99.14" +name = "dirs" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7b9cef1e351660e5443924e4f43ab25fbbed3e9a5f052df3677deb4d6b320" +checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "syn", + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +dependencies = [ + "libc", + "redox_users", + "winapi", ] [[package]] @@ -478,7 +497,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" dependencies = [ - "libloading 0.7.0", + "libloading 0.7.1", ] [[package]] @@ -489,18 +508,18 @@ checksum = "9ea835d29036a4087793836fa931b08837ad5e957da9e23886b29586fb9b6650" [[package]] name = "fastrand" -version = "1.4.1" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77b705829d1e87f762c2df6da140b26af5839e1033aa84aa5f56bb688e4e1bdb" +checksum = "b394ed3d285a429378d3b384b9eb1285267e7df4b166df24b7a6939a04dc392e" dependencies = [ "instant", ] [[package]] name = "filetime" -version = "0.2.14" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d34cfa13a63ae058bfa601fe9e313bbdb3746427c1459185464ce0fcf62e1e8" +checksum = "975ccf83d8d9d0d84682850a38c8169027be83368805971cc4f238c2b245bc98" dependencies = [ "cfg-if 1.0.0", "libc", @@ -510,9 +529,9 @@ dependencies = [ [[package]] name = "fixedbitset" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" +checksum = "398ea4fabe40b9b0d885340a2a991a44c8a645624075ad966d21f88688e2b69e" [[package]] name = "fnv" @@ -546,15 +565,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1" +checksum = "88d1c26957f23603395cd326b0ffe64124b818f4449552f960d815cfba83a53d" [[package]] name = "futures-io" -version = "0.3.15" +version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acc499defb3b348f8d8f3f66415835a9131856ff7714bf10dadfc4ec4bdb29a1" +checksum = "522de2a0fe3e380f1bc577ba0474108faf3f6b18321dbf60b3b9c39a75073377" [[package]] name = "futures-lite" @@ -581,165 +600,30 @@ dependencies = [ ] [[package]] -name = "gfx-auxil" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccf8711c9994dfa34337466bee3ae1462e172874c432ce4eb120ab2e98d39cf" -dependencies = [ - "fxhash", - "gfx-hal", - "spirv_cross", -] - -[[package]] -name = "gfx-backend-dx11" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f839f27f8c8a6dc553ccca7f5b35a42009432bc25db9688bba7061cd394161f" -dependencies = [ - "arrayvec", - "bitflags", - "gfx-auxil", - "gfx-hal", - "libloading 0.7.0", - "log", - "parking_lot", - "range-alloc", - "raw-window-handle", - "smallvec", - "spirv_cross", - "thunderdome", - "winapi", - "wio", -] - -[[package]] -name = "gfx-backend-dx12" -version = "0.8.0" +name = "getrandom" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3937738b0da5839bba4e33980d29f9a06dbce184d04a3a08c9a949e7953700e3" +checksum = "7fcd999463524c52659517fe2cea98493cfe485d10565e7b0fb07dbba7ad2753" dependencies = [ - "arrayvec", - "bit-set", - "bitflags", - "d3d12", - "gfx-auxil", - "gfx-hal", - "log", - "parking_lot", - "range-alloc", - "raw-window-handle", - "smallvec", - "spirv_cross", - "thunderdome", - "winapi", -] - -[[package]] -name = "gfx-backend-empty" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2ac55ada4bfcd35479b3421eea324d36d7da5f724e2f66ecb36d4efdb7041a5e" -dependencies = [ - "gfx-hal", - "log", - "raw-window-handle", -] - -[[package]] -name = "gfx-backend-gl" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0caa03d6e0b7b4f202aea1f20c3f3288cfa06d92d24cea9d69c9a7627967244a" -dependencies = [ - "arrayvec", - "bitflags", - "fxhash", - "gfx-hal", - "glow", - "js-sys", - "khronos-egl", - "libloading 0.7.0", - "log", - "naga", - "parking_lot", - "raw-window-handle", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "gfx-backend-metal" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "340895ad544ba46433acb3bdabece0ef16f2dbedc030adbd7c9eaf2839fbed41" -dependencies = [ - "arrayvec", - "bitflags", - "block", - "cocoa-foundation", - "copyless", - "foreign-types", - "fxhash", - "gfx-hal", - "log", - "metal", - "naga", - "objc", - "parking_lot", - "profiling", - "range-alloc", - "raw-window-handle", - "storage-map", -] - -[[package]] -name = "gfx-backend-vulkan" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a353fc6fdb42ec646de49bbb74e4870e37a7e680caf33f3ac0615c30b1146d94" -dependencies = [ - "arrayvec", - "ash", - "byteorder", - "core-graphics-types", - "gfx-hal", - "inplace_it", - "log", - "naga", - "objc", - "parking_lot", - "raw-window-handle", - "smallvec", - "winapi", -] - -[[package]] -name = "gfx-hal" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d285bfd566f6b9134af908446ca350c0a1047495dfb9bbd826e701e8ee1d259" -dependencies = [ - "bitflags", - "naga", - "raw-window-handle", - "thiserror", + "cfg-if 1.0.0", + "libc", + "wasi", ] [[package]] name = "glam" -version = "0.15.2" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3abb554f8ee44336b72d522e0a7fe86a29e09f839a36022fa869a7dfe941a54b" +checksum = "2b8509e6791516e81c1a630d0bd7fbac36d2fa8712a9da8662e716b52d5051ca" dependencies = [ "num-traits", ] [[package]] name = "glow" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b80b98efaa8a34fce11d60dd2ce2760d5d83c373cbcc73bb87c2a3a84a54108" +checksum = "4f04649123493bc2483cbef4daddb45d40bbdae5adb221a63a23efdb0cc99520" dependencies = [ "js-sys", "slotmap", @@ -749,9 +633,9 @@ dependencies = [ [[package]] name = "gpu-alloc" -version = "0.4.7" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbc1b6ca374e81862526786d9cb42357ce03706ed1b8761730caafd02ab91f3a" +checksum = "0e64cbb8d36508d3e19da95e56e196a84f674fc190881f2cc010000798838aa6" dependencies = [ "bitflags", "gpu-alloc-types", @@ -768,13 +652,13 @@ dependencies = [ [[package]] name = "gpu-descriptor" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8a70f1e87a3840ed6a3e99e02c2b861e4dbdf26f0d07e38f42ea5aff46cfce2" +checksum = "d7a237f0419ab10d17006d55c62ac4f689a6bf52c75d3f38b8361d249e8d4b0b" dependencies = [ "bitflags", "gpu-descriptor-types", - "hashbrown", + "hashbrown 0.9.1", ] [[package]] @@ -792,7 +676,16 @@ version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" dependencies = [ - "ahash", + "ahash 0.4.7", +] + +[[package]] +name = "hashbrown" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" +dependencies = [ + "ahash 0.7.6", ] [[package]] @@ -804,6 +697,12 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "hexf-parse" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" + [[package]] name = "ident_case" version = "1.0.1" @@ -812,19 +711,19 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" -version = "1.6.2" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "824845a0bf897a9042383849b02c1bc219c2383772efcd5c6f9766fa4b81aef3" +checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.11.2", ] [[package]] name = "inotify" -version = "0.9.3" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b031475cb1b103ee221afb806a23d35e0570bf7271d7588762ceba8127ed43b3" +checksum = "9e5fc8f41dbaa9c8492a96c8afffda4f76896ee041d6a57606e70581b80c901f" dependencies = [ "bitflags", "inotify-sys", @@ -848,18 +747,21 @@ checksum = "90953f308a79fe6d62a4643e51f848fbfddcd05975a38e69fdf4ab86a7baf7ca" [[package]] name = "instant" -version = "0.1.9" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" +checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" dependencies = [ "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] name = "itoa" -version = "0.4.7" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd25036021b0de88a0aff6b850051563c6516d0bf53f8638938edbb9de732736" +checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" [[package]] name = "jni-sys" @@ -869,18 +771,18 @@ checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" [[package]] name = "jobserver" -version = "0.1.22" +version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "972f5ae5d1cb9c6ae417789196c803205313edde988685da5e3aae0827b9e7fd" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" dependencies = [ "libc", ] [[package]] name = "js-sys" -version = "0.3.51" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83bdfbace3a0e81a4253f73b49e960b053e396a11012cbd49b9b74d6a2b67062" +checksum = "7cc9ffccd38c451a86bf13657df244e9c3f37493cce8e5e21e940963777acc84" dependencies = [ "wasm-bindgen", ] @@ -892,7 +794,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" dependencies = [ "libc", - "libloading 0.7.0", + "libloading 0.7.1", +] + +[[package]] +name = "kqueue" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "058a107a784f8be94c7d35c1300f4facced2e93d2fbe5b1452b44e905ddca4a9" +dependencies = [ + "kqueue-sys", + "libc", +] + +[[package]] +name = "kqueue-sys" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8367585489f01bc55dd27404dcf56b95e6da061a256a666ab23be9ba96a2e587" +dependencies = [ + "bitflags", + "libc", ] [[package]] @@ -903,9 +825,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.96" +version = "0.2.105" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5600b4e6efc5421841a2138a6b082e07fe12f9aaa12783d50e5d13325b26b4fc" +checksum = "869d572136620d55835903746bcb5cdc54cb2851fd0aeec53220b4bb65ef3013" [[package]] name = "libloading" @@ -919,9 +841,9 @@ dependencies = [ [[package]] name = "libloading" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "c0cf036d15402bea3c5d4de17b3fce76b3e4a56ebc1f577be0e7a72f7c607cf0" dependencies = [ "cfg-if 1.0.0", "winapi", @@ -935,9 +857,9 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "lock_api" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0382880606dff6d15c9476c416d18690b72742aa7b605bb6dd6ec9030fbf07eb" +checksum = "712a4d093c9976e24e7dbca41db895dabcbac38eb5f4045393d17a95bdfb1109" dependencies = [ "scopeguard", ] @@ -960,17 +882,11 @@ dependencies = [ "libc", ] -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "memchr" -version = "2.4.0" +version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc" +checksum = "308cc39be01b73d0d18f82a0e7b2a3df85245f84af96fdddc5d202d27e47b86a" [[package]] name = "memmap2" @@ -992,23 +908,29 @@ dependencies = [ [[package]] name = "metal" -version = "0.22.0" +version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c12e48c737ee9a55e8bb2352bcde588f79ae308d3529ee888f7cc0f469b5777" +checksum = "e0514f491f4cc03632ab399ee01e2c1c1b12d3e1cf2d667c1ff5f87d6dcd2084" dependencies = [ "bitflags", "block", - "cocoa-foundation", + "core-graphics-types", "foreign-types", "log", "objc", ] +[[package]] +name = "minimal-lexical" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c64630dcdd71f1a64c435f54885086a0de5d6a12d104d69b165fb7d5286d677" + [[package]] name = "mio" -version = "0.7.11" +version = "0.7.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf80d3e903b34e0bd7282b218398aec54e082c840d9baf8339e0080a0c542956" +checksum = "8067b404fe97c70829f082dec8bcf4f71225d7eaea1d8645349cb76fa06205cc" dependencies = [ "libc", "log", @@ -1040,18 +962,20 @@ dependencies = [ [[package]] name = "naga" -version = "0.4.2" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8d74f2c7ace793a760165ac0679d6830809ad4e85f6886f72e4f8c4aa4291c5" +checksum = "eda66d09f712e1f0a6ab436137da4fac312f78301f6d4ac7cb8bfe96e988734f" dependencies = [ "bit-set", "bitflags", "codespan-reporting", "fxhash", + "hexf-parse", + "indexmap", "log", "num-traits", "petgraph", - "spirv_headers 1.5.0", + "spirv", "thiserror", ] @@ -1088,7 +1012,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" dependencies = [ "darling", - "proc-macro-crate", + "proc-macro-crate 0.1.5", "proc-macro2", "quote", "syn", @@ -1126,25 +1050,27 @@ dependencies = [ [[package]] name = "nom" -version = "6.1.2" +version = "7.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" +checksum = "7ffd9d26838a953b4af82cbeb9f1592c6798916983959be223a7124e992742c1" dependencies = [ "memchr", + "minimal-lexical", "version_check", ] [[package]] name = "notify" -version = "5.0.0-pre.10" +version = "5.0.0-pre.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f18203a26893ca1d3526cf58084025d5639f91c44f8b70ab3b724f60e819a0" +checksum = "245d358380e2352c2d020e8ee62baac09b3420f1f6c012a31326cfced4ad487d" dependencies = [ "bitflags", "crossbeam-channel", "filetime", "fsevent-sys", "inotify", + "kqueue", "libc", "mio", "walkdir", @@ -1172,9 +1098,9 @@ dependencies = [ [[package]] name = "num_enum" -version = "0.5.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "226b45a5c2ac4dd696ed30fa6b94b057ad909c7b7fc2e0d0808192bced894066" +checksum = "3f9bd055fb730c4f8f4f57d45d35cd6b3f0980535b056dc7ff119cee6a66ed6f" dependencies = [ "derivative", "num_enum_derive", @@ -1182,11 +1108,11 @@ dependencies = [ [[package]] name = "num_enum_derive" -version = "0.5.1" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c0fd9eba1d5db0994a239e09c1be402d35622277e35468ba891aa5e3188ce7e" +checksum = "486ea01961c4a818096de679a8b740b26d9033146ac5291b1c98557658f8cdd9" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 1.1.0", "proc-macro2", "quote", "syn", @@ -1213,9 +1139,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.7.2" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af8b08b04175473088b46763e51ee54da5f9a164bc162f615b91bc179dbf15a3" +checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" [[package]] name = "owned_ttf_parser" @@ -1234,9 +1160,9 @@ checksum = "427c3892f9e783d91cc128285287e70a59e206ca452770ece88a76f7a3eddd72" [[package]] name = "parking_lot" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" +checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" dependencies = [ "instant", "lock_api", @@ -1245,9 +1171,9 @@ dependencies = [ [[package]] name = "parking_lot_core" -version = "0.8.3" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa7a782938e745763fe6907fc6ba86946d72f49fe7e21de074e08128a99fb018" +checksum = "d76e8e1493bcac0d2766c42737f34458f1c8c50c0d23bcb24ea953affb273216" dependencies = [ "cfg-if 1.0.0", "instant", @@ -1265,9 +1191,9 @@ checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" [[package]] name = "petgraph" -version = "0.5.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7" +checksum = "4a13a2fa9d0b63e5f22328828741e523766fff0ee9e779316902290dff3f824f" dependencies = [ "fixedbitset", "indexmap", @@ -1275,15 +1201,15 @@ dependencies = [ [[package]] name = "pin-project-lite" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905" +checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "12295df4f294471248581bc09bef3c38a5e46f1e36d6a37353621a0c6c357e1f" [[package]] name = "pollster" @@ -1300,26 +1226,36 @@ dependencies = [ "toml", ] +[[package]] +name = "proc-macro-crate" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ebace6889caf889b4d3f76becee12e90353f2b8c7d875534a71e5742f8f6f83" +dependencies = [ + "thiserror", + "toml", +] + [[package]] name = "proc-macro2" -version = "1.0.27" +version = "1.0.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0d8caf72986c1a598726adc988bb5984792ef84f5ee5aa50209145ee8077038" +checksum = "ba508cc11742c0dc5c1659771673afbab7a0efab23aa17e854cbab0837ed0b43" dependencies = [ "unicode-xid", ] [[package]] name = "profiling" -version = "1.0.2" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a7c000c0ce9d9bb94c0fbacdf20e5087fbe652c556ffb2c9387d980e17d51fb" +checksum = "87dfd5592a8eed7e74f56ad7b125f8234763b805c30f0c7c95c486920026a6ec" [[package]] name = "quote" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ "proc-macro2", ] @@ -1347,13 +1283,23 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.2.8" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "742739e41cd49414de871ea5e549afb7e2a3ac77b589bcbebe8c82fab37147fc" +checksum = "8383f39639269cde97d255a32bdb68c047337295414940c68bdd30c2e13203ff" dependencies = [ "bitflags", ] +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom", + "redox_syscall", +] + [[package]] name = "regex" version = "1.5.4" @@ -1369,15 +1315,21 @@ version = "0.6.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f497285884f3fcff424ffc933e56d7cbca511def0c9831a7f9b5f6153e3cc89b" +[[package]] +name = "renderdoc-sys" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" + [[package]] name = "rspirv" -version = "0.8.0" -source = "git+https://github.com/gfx-rs/rspirv.git?rev=4419db432d90cd333e62aae9669dd263acff0499#4419db432d90cd333e62aae9669dd263acff0499" +version = "0.11.0+1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1503993b59ca9ae4127365c3293517576d7ce56be9f3d8abb1625c85ddc583ba" dependencies = [ - "derive_more", "fxhash", "num-traits", - "spirv_headers 1.5.1", + "spirv", ] [[package]] @@ -1410,17 +1362,18 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.19" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "410f7acf3cb3a44527c5d9546bad4bf4e6c460915d5f9f2fc524498bfe8f70ce" +checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustc_codegen_spirv" -version = "0.4.0-alpha.9" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=e66e72b049a88f3ae1f7c54cd6823ae458612952#e66e72b049a88f3ae1f7c54cd6823ae458612952" +version = "0.4.0-alpha.12" +source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=c4eb7af88ee0baf556cc6b46389a2e71b34919bf#c4eb7af88ee0baf556cc6b46389a2e71b34919bf" dependencies = [ + "ar", "bimap", - "hashbrown", + "hashbrown 0.11.2", "indexmap", "libc", "num-traits", @@ -1432,7 +1385,6 @@ dependencies = [ "smallvec", "spirv-tools", "syn", - "tar", "topological-sort", ] @@ -1485,18 +1437,18 @@ checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] name = "serde" -version = "1.0.126" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec7505abeacaec74ae4778d9d9328fe5a5d04253220a85c4ee022239fc996d03" +checksum = "f12d06de37cf59146fbdecab66aa99f9fe4f78722e3607577a5375d66bd0c913" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.126" +version = "1.0.130" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "963a7dbc9895aeac7ac90e74f34a5d5261828f79df35cbed41e10189d3804d43" +checksum = "d7bc1a1ab1961464eae040d96713baa5a724a8152c1222492465b54322ec508b" dependencies = [ "proc-macro2", "quote", @@ -1505,9 +1457,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.64" +version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "799e97dc9fdae36a5c8b8f2cae9ce2ee9fdce2058c57a93e6099d919fd982f79" +checksum = "0f690853975602e1bfe1ccbf50504d67174e3bcf340f23b5ea9992e0587a52d8" dependencies = [ "itoa", "ryu", @@ -1516,21 +1468,24 @@ dependencies = [ [[package]] name = "slab" -version = "0.4.3" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527" +checksum = "9def91fd1e018fe007022791f865d0ccc9b3a0d5001e01aabb8b40e46000afb5" [[package]] name = "slotmap" -version = "0.4.0" +version = "1.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c46a3482db8f247956e464d783693ece164ca056e6e67563ee5505bdb86452cd" +checksum = "e1e08e261d0e8f5c43123b7adf3e4ca1690d655377ac93a03b2c9d3e98de1342" +dependencies = [ + "version_check", +] [[package]] name = "smallvec" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" [[package]] name = "smithay-client-toolkit" @@ -1551,10 +1506,20 @@ dependencies = [ "wayland-protocols", ] +[[package]] +name = "spirv" +version = "0.2.0+1.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246bfa38fe3db3f1dfc8ca5a2cdeb7348c78be2112740cc0ec8ef18b6d94f830" +dependencies = [ + "bitflags", + "num-traits", +] + [[package]] name = "spirv-builder" -version = "0.4.0-alpha.9" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=e66e72b049a88f3ae1f7c54cd6823ae458612952#e66e72b049a88f3ae1f7c54cd6823ae458612952" +version = "0.4.0-alpha.12" +source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=c4eb7af88ee0baf556cc6b46389a2e71b34919bf#c4eb7af88ee0baf556cc6b46389a2e71b34919bf" dependencies = [ "memchr", "notify", @@ -1566,8 +1531,8 @@ dependencies = [ [[package]] name = "spirv-std" -version = "0.4.0-alpha.9" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=e66e72b049a88f3ae1f7c54cd6823ae458612952#e66e72b049a88f3ae1f7c54cd6823ae458612952" +version = "0.4.0-alpha.12" +source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=c4eb7af88ee0baf556cc6b46389a2e71b34919bf#c4eb7af88ee0baf556cc6b46389a2e71b34919bf" dependencies = [ "bitflags", "glam", @@ -1578,8 +1543,8 @@ dependencies = [ [[package]] name = "spirv-std-macros" -version = "0.4.0-alpha.9" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=e66e72b049a88f3ae1f7c54cd6823ae458612952#e66e72b049a88f3ae1f7c54cd6823ae458612952" +version = "0.4.0-alpha.12" +source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=c4eb7af88ee0baf556cc6b46389a2e71b34919bf#c4eb7af88ee0baf556cc6b46389a2e71b34919bf" dependencies = [ "heck", "proc-macro2", @@ -1590,65 +1555,26 @@ dependencies = [ [[package]] name = "spirv-tools" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "663d6a7c1627d47e402e3a41076f6147bbe4bf11fd98687e1016599b3979f6d3" +checksum = "47ffcd721c949125c13b1213a292477a2d82621512b094564bd918c3a1c7f7ff" dependencies = [ "spirv-tools-sys", ] [[package]] name = "spirv-tools-sys" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbb083780a3721ff6dd496dbdc3b90c033b443bec676918b89c179b330081983" +checksum = "b967db819666ccf7a0373876321bfe852922edcc7f3e30e3a7668b02e1961119" dependencies = [ "cc", ] [[package]] name = "spirv-types" -version = "0.4.0-alpha.9" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=e66e72b049a88f3ae1f7c54cd6823ae458612952#e66e72b049a88f3ae1f7c54cd6823ae458612952" - -[[package]] -name = "spirv_cross" -version = "0.23.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60647fadbf83c4a72f0d7ea67a7ca3a81835cf442b8deae5c134c3e0055b2e14" -dependencies = [ - "cc", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "spirv_headers" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f5b132530b1ac069df335577e3581765995cba5a13995cdbbdbc8fb057c532c" -dependencies = [ - "bitflags", - "num-traits", -] - -[[package]] -name = "spirv_headers" -version = "1.5.1" -source = "git+https://github.com/gfx-rs/rspirv.git?rev=4419db432d90cd333e62aae9669dd263acff0499#4419db432d90cd333e62aae9669dd263acff0499" -dependencies = [ - "bitflags", - "num-traits", -] - -[[package]] -name = "storage-map" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418bb14643aa55a7841d5303f72cf512cfb323b8cc221d51580500a1ca75206c" -dependencies = [ - "lock_api", -] +version = "0.4.0-alpha.12" +source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=c4eb7af88ee0baf556cc6b46389a2e71b34919bf#c4eb7af88ee0baf556cc6b46389a2e71b34919bf" [[package]] name = "strsim" @@ -1658,26 +1584,15 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] name = "syn" -version = "1.0.73" +version = "1.0.81" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f71489ff30030d2ae598524f61326b902466f72a0fb1a8564c001cc63425bcc7" +checksum = "f2afee18b8beb5a596ecb4a2dce128c719b4ba399d34126b9e4396e3f9860966" dependencies = [ "proc-macro2", "quote", "unicode-xid", ] -[[package]] -name = "tar" -version = "0.4.35" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d779dc6aeff029314570f666ec83f19df7280bb36ef338442cfa8c604021b80" -dependencies = [ - "filetime", - "libc", - "xattr", -] - [[package]] name = "termcolor" version = "1.1.2" @@ -1689,30 +1604,24 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.25" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa6f76457f59514c7eeb4e59d891395fab0b2fd1d40723ae737d64153392e9c6" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.25" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a36768c0fbf1bb15eca10defa29526bda730a2376c2ab4393ccfa16fb1a318d" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", "syn", ] -[[package]] -name = "thunderdome" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87b4947742c93ece24a0032141d9caa3d853752e694a57e35029dd2bd08673e0" - [[package]] name = "toml" version = "0.5.8" @@ -1736,15 +1645,15 @@ checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" [[package]] name = "unicode-segmentation" -version = "1.7.1" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb0d2e7be6ae3a5fa87eed5fb451aff96f2573d2694942e40543ae0bbe19c796" +checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b" [[package]] name = "unicode-width" -version = "0.1.8" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" +checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" [[package]] name = "unicode-xid" @@ -1775,11 +1684,17 @@ dependencies = [ "winapi-util", ] +[[package]] +name = "wasi" +version = "0.10.2+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" + [[package]] name = "wasm-bindgen" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54ee1d4ed486f78874278e63e4069fc1ab9f6a18ca492076ffb90c5eb2997fd" +checksum = "632f73e236b219150ea279196e54e610f5dbafa5d61786303d4da54f84e47fce" dependencies = [ "cfg-if 1.0.0", "wasm-bindgen-macro", @@ -1787,9 +1702,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b33f6a0694ccfea53d94db8b2ed1c3a8a4c86dd936b13b9f0a15ec4a451b900" +checksum = "a317bf8f9fba2476b4b2c85ef4c4af8ff39c3c7f0cdfeed4f82c34a880aa837b" dependencies = [ "bumpalo", "lazy_static", @@ -1802,9 +1717,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.24" +version = "0.4.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5fba7978c679d53ce2d0ac80c8c175840feb849a161664365d1287b41f2e67f1" +checksum = "8e8d7523cb1f2a4c96c1317ca690031b714a51cc14e05f712446691f413f5d39" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -1814,9 +1729,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "088169ca61430fe1e58b8096c24975251700e7b1f6fd91cc9d59b04fb9b18bd4" +checksum = "d56146e7c495528bf6587663bea13a8eb588d39b36b679d83972e1a2dbbdacf9" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1824,9 +1739,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be2241542ff3d9f241f5e2cb6dd09b37efe786df8851c54957683a49f0987a97" +checksum = "7803e0eea25835f8abdc585cd3021b3deb11543c6fe226dcd30b228857c5c5ab" dependencies = [ "proc-macro2", "quote", @@ -1837,15 +1752,15 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.74" +version = "0.2.78" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7cff876b8f18eed75a66cf49b65e7f967cb354a7aa16003fb55dbfd25b44b4f" +checksum = "0237232789cf037d5480773fe568aac745bfe2afbc11a863e97901780a6b47cc" [[package]] name = "wayland-client" -version = "0.28.5" +version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06ca44d86554b85cf449f1557edc6cc7da935cc748c8e4bf1c507cbd43bae02c" +checksum = "e3ab332350e502f159382201394a78e3cc12d0f04db863429260164ea40e0355" dependencies = [ "bitflags", "downcast-rs", @@ -1859,9 +1774,9 @@ dependencies = [ [[package]] name = "wayland-commons" -version = "0.28.5" +version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bd75ae380325dbcff2707f0cd9869827ea1d2d6d534cff076858d3f0460fd5a" +checksum = "a21817947c7011bbd0a27e11b17b337bfd022e8544b071a2641232047966fbda" dependencies = [ "nix 0.20.0", "once_cell", @@ -1871,9 +1786,9 @@ dependencies = [ [[package]] name = "wayland-cursor" -version = "0.28.5" +version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b37e5455ec72f5de555ec39b5c3704036ac07c2ecd50d0bffe02d5fe2d4e65ab" +checksum = "be610084edd1586d45e7bdd275fe345c7c1873598caa464c4fb835dee70fa65a" dependencies = [ "nix 0.20.0", "wayland-client", @@ -1882,9 +1797,9 @@ dependencies = [ [[package]] name = "wayland-protocols" -version = "0.28.5" +version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95df3317872bcf9eec096c864b69aa4769a1d5d6291a5b513f8ba0af0efbd52c" +checksum = "286620ea4d803bacf61fa087a4242ee316693099ee5a140796aaba02b29f861f" dependencies = [ "bitflags", "wayland-client", @@ -1894,9 +1809,9 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.28.5" +version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389d680d7bd67512dc9c37f39560224327038deb0f0e8d33f870900441b68720" +checksum = "ce923eb2deb61de332d1f356ec7b6bf37094dc5573952e1c8936db03b54c03f1" dependencies = [ "proc-macro2", "quote", @@ -1905,9 +1820,9 @@ dependencies = [ [[package]] name = "wayland-sys" -version = "0.28.5" +version = "0.28.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2907bd297eef464a95ba9349ea771611771aa285b932526c633dc94d5400a8e2" +checksum = "d841fca9aed7febf9bed2e9796c49bf58d4152ceda8ac949ebe00868d8f0feb8" dependencies = [ "dlib 0.5.0", "lazy_static", @@ -1916,9 +1831,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.50" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a905d57e488fec8861446d3393670fb50d27a262344013181c2cdf9fff5481be" +checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" dependencies = [ "js-sys", "wasm-bindgen", @@ -1926,9 +1841,9 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.8.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "215fd50e66f794bd16683e7e0e0b9b53be265eb10fdf02276caf5de3e5743fcf" +checksum = "d1577ecc4f6992b9e965878ac594efb24eed2bdf089c11f45b3d1c5f216e2e30" dependencies = [ "arrayvec", "js-sys", @@ -1941,44 +1856,75 @@ dependencies = [ "wasm-bindgen-futures", "web-sys", "wgpu-core", + "wgpu-hal", "wgpu-types", ] [[package]] name = "wgpu-core" -version = "0.8.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d56c368fc0e6f3927c711d2b55a51ad4321218efc0239c4acf69e456ab70399" +checksum = "3bdcbfa4885b32c2b1feb2faeb8b6a76065b752b8f08751b82f994e937687f46" dependencies = [ "arrayvec", "bitflags", "cfg_aliases", "copyless", "fxhash", - "gfx-backend-dx11", - "gfx-backend-dx12", - "gfx-backend-empty", - "gfx-backend-gl", - "gfx-backend-metal", - "gfx-backend-vulkan", - "gfx-hal", + "log", + "naga", + "parking_lot", + "profiling", + "raw-window-handle", + "smallvec", + "thiserror", + "wgpu-hal", + "wgpu-types", +] + +[[package]] +name = "wgpu-hal" +version = "0.11.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e493835d9edb153d5c8a9d8d016e1811dbe32ddb707a110be1453c7b051d3ec" +dependencies = [ + "arrayvec", + "ash", + "bit-set", + "bitflags", + "block", + "core-graphics-types", + "d3d12", + "foreign-types", + "fxhash", + "glow", "gpu-alloc", "gpu-descriptor", + "inplace_it", + "js-sys", + "khronos-egl", + "libloading 0.7.1", "log", + "metal", "naga", + "objc", "parking_lot", "profiling", + "range-alloc", "raw-window-handle", - "smallvec", + "renderdoc-sys", "thiserror", + "wasm-bindgen", + "web-sys", "wgpu-types", + "winapi", ] [[package]] name = "wgpu-types" -version = "0.8.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa248d90c8e6832269b8955bf800e8241f942c25e18a235b7752226804d21556" +checksum = "e15e44ba88ec415466e18e91881319e7c9e96cb905dc623305168aea65b85ccc" dependencies = [ "bitflags", ] @@ -2022,7 +1968,7 @@ checksum = "79610794594d5e86be473ef7763f604f2159cbac8c94debd00df8fb41e86c2f8" dependencies = [ "bitflags", "cocoa", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "core-graphics 0.22.2", "core-video-sys", "dispatch", @@ -2046,53 +1992,37 @@ dependencies = [ "x11-dl", ] -[[package]] -name = "wio" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d129932f4644ac2396cb456385cbf9e63b5b30c6e8dc4820bdca4eb082037a5" -dependencies = [ - "winapi", -] - [[package]] name = "x11-dl" -version = "2.18.5" +version = "2.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" +checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" dependencies = [ "lazy_static", "libc", - "maybe-uninit", "pkg-config", ] -[[package]] -name = "xattr" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "244c3741f4240ef46274860397c7c74e50eb23624996930e484c16679633a54c" -dependencies = [ - "libc", -] - [[package]] name = "xcursor" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a9a231574ae78801646617cefd13bfe94be907c0e4fa979cfd8b770aa3c5d08" +checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" dependencies = [ "nom", ] [[package]] name = "xdg" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" +checksum = "3a23fe958c70412687039c86f578938b4a0bb50ec788e96bce4d6ab00ddd5803" +dependencies = [ + "dirs", +] [[package]] name = "xml-rs" -version = "0.8.3" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b07db065a5cf61a7e4ba64f29e67db906fb1787316516c4e6e5ff0fea1efcd8a" +checksum = "d2d7d3948613f75c98fd9328cfdcc45acc4d360655289d0a7d4ec931392200a3" diff --git a/rust-gpu-toy/Cargo.toml b/rust-gpu-toy/Cargo.toml index 461681d..7dcbc85 100644 --- a/rust-gpu-toy/Cargo.toml +++ b/rust-gpu-toy/Cargo.toml @@ -4,15 +4,17 @@ version = "0.1.0" authors = ["Raph Levien "] license = "MIT/Apache-2.0" description = "A simple compute shader example that draws in a window, based on wgpu and rust-gpu." -edition = "2018" +edition = "2021" [dependencies] -wgpu = "0.8" +wgpu = { version = "0.11", features = ["spirv"] } winit = "0.25" pollster = "0.2" async-executor = "1.0" bytemuck = "1.6.3" -spirv-builder = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "e66e72b049a88f3ae1f7c54cd6823ae458612952", features = ["watch"] } +spirv-builder = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "c4eb7af88ee0baf556cc6b46389a2e71b34919bf", features = [ + "watch", +] } rust-gpu-toy-shared = { path = "./shared" } [workspace] diff --git a/rust-gpu-toy/rust-toolchain.toml b/rust-gpu-toy/rust-toolchain.toml index 5812cb7..9a35070 100644 --- a/rust-gpu-toy/rust-toolchain.toml +++ b/rust-gpu-toy/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "nightly-2021-05-24" +channel = "nightly-2021-10-26" components = ["rust-src", "rustc-dev", "llvm-tools-preview"] diff --git a/rust-gpu-toy/shaders/Cargo.toml b/rust-gpu-toy/shaders/Cargo.toml index c1780e9..b9f4c16 100644 --- a/rust-gpu-toy/shaders/Cargo.toml +++ b/rust-gpu-toy/shaders/Cargo.toml @@ -10,5 +10,7 @@ edition = "2018" crate-type = ["dylib"] [dependencies] -spirv-std = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "e66e72b049a88f3ae1f7c54cd6823ae458612952", features = ["glam", "const-generics"] } +spirv-std = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "c4eb7af88ee0baf556cc6b46389a2e71b34919bf", features = [ + "glam", +] } rust-gpu-toy-shared = { path = "../shared" } diff --git a/rust-gpu-toy/shaders/src/lib.rs b/rust-gpu-toy/shaders/src/lib.rs index 2baf02f..478ea4c 100644 --- a/rust-gpu-toy/shaders/src/lib.rs +++ b/rust-gpu-toy/shaders/src/lib.rs @@ -19,10 +19,11 @@ use spirv_std::{ #[spirv(compute(threads(16, 16)))] pub fn main( #[spirv(push_constant)] config: &Config, - #[spirv(descriptor_set = 0, binding = 0)] output_buffer: &image::StorageImage2d, + #[spirv(descriptor_set = 0, binding = 0, storage_buffer)] output_buffer: &image::Image!(2D, format=rgba8, sampled=false), #[spirv(global_invocation_id)] global_ix: UVec3, ) { - let frag_coord = global_ix.truncate().as_f32() + asm!(); + let frag_coord = global_ix.truncate().as_vec2() / vec2(config.width as f32, config.height as f32) - vec2(0.5, 0.5); @@ -38,7 +39,7 @@ pub fn main( // A better choice might be to just enable the int8 capability if global_ix.x < config.width { if global_ix.y < config.height { - unsafe { output_buffer.write(global_ix.truncate(), frag_color) } + unsafe { output_buffer.write(global_ix.truncate().as_ivec2(), frag_color) } } } } diff --git a/rust-gpu-toy/src/main.rs b/rust-gpu-toy/src/main.rs index d42262e..42fdd8f 100644 --- a/rust-gpu-toy/src/main.rs +++ b/rust-gpu-toy/src/main.rs @@ -19,7 +19,6 @@ use std::time::Instant; use rust_gpu_toy_shared::Config; -use wgpu::util::make_spirv; use wgpu::{Extent3d, ShaderModule}; use winit::dpi::PhysicalSize; @@ -55,8 +54,7 @@ struct State { device: wgpu::Device, queue: wgpu::Queue, - sc_desc: wgpu::SwapChainDescriptor, - swap_chain: Option, + surface_config: wgpu::SurfaceConfiguration, size: winit::dpi::PhysicalSize, sampler: wgpu::Sampler, @@ -70,16 +68,17 @@ struct State { impl State { async fn new(window: &Window, compilation: CompileResult) -> Self { let size = window.inner_size(); - let instance = wgpu::Instance::new(wgpu::BackendBit::PRIMARY); + let instance = wgpu::Instance::new(wgpu::Backends::PRIMARY); let surface = unsafe { instance.create_surface(window) }; let adapter = instance .request_adapter(&wgpu::RequestAdapterOptions { power_preference: Default::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .expect("error finding adapter"); - let features = wgpu::Features::PUSH_CONSTANTS; + let features = wgpu::Features::PUSH_CONSTANTS /* | wgpu::Features::SPIRV_SHADER_PASSTHROUGH */; let limits = wgpu::Limits { max_push_constant_size: std::mem::size_of::() as u32, ..Default::default() @@ -95,16 +94,18 @@ impl State { ) .await .expect("error creating device"); - let swapchain_format = adapter.get_swap_chain_preferred_format(&surface).unwrap(); - let sc_desc = wgpu::SwapChainDescriptor { - usage: wgpu::TextureUsage::RENDER_ATTACHMENT, - format: swapchain_format, + let preferred_format = surface + .get_preferred_format(&adapter) + .expect("Surface is compatible with adapter, as adapter creation succeeded"); + let surface_config = wgpu::SurfaceConfiguration { + usage: wgpu::TextureUsages::RENDER_ATTACHMENT, + format: preferred_format, width: size.width, height: size.height, present_mode: wgpu::PresentMode::Mailbox, }; - let swap_chain = device.create_swap_chain(&surface, &sc_desc); + surface.configure(&device, &surface_config); let sampler = device.create_sampler(&wgpu::SamplerDescriptor { address_mode_u: wgpu::AddressMode::ClampToEdge, @@ -116,7 +117,7 @@ impl State { ..Default::default() }); let layouts = Self::create_layouts(&device); - let pipelines = Self::create_pipelines(&device, &sc_desc, &layouts, &compilation); + let pipelines = Self::create_pipelines(&device, &surface_config, &layouts, &compilation); let (compute_group, copy_group) = Self::bind_for_size(&device, &sampler, size, &layouts); let start_time = Instant::now(); State { @@ -125,8 +126,7 @@ impl State { surface, device, queue, - sc_desc, - swap_chain: Some(swap_chain), + surface_config, size, sampler, compute_bind_group: compute_group, @@ -137,17 +137,15 @@ impl State { fn resize(&mut self, new_size: PhysicalSize) { if new_size.width != 0 && new_size.height != 0 { - self.sc_desc.width = new_size.width; - self.sc_desc.height = new_size.height; + self.surface_config.width = new_size.width; + self.surface_config.height = new_size.height; self.size = new_size; - let new_swap_chain = self.device.create_swap_chain(&self.surface, &self.sc_desc); - self.swap_chain = Some(new_swap_chain); + self.surface.configure(&self.device, &self.surface_config); + let (compute_bind_group, copy_bind_group) = State::bind_for_size(&self.device, &self.sampler, new_size, &self.layouts); self.compute_bind_group = compute_bind_group; self.copy_bind_group = copy_bind_group; - } else { - self.swap_chain = None; } } @@ -168,7 +166,7 @@ impl State { sample_count: 1, dimension: wgpu::TextureDimension::D2, format: wgpu::TextureFormat::Rgba8Unorm, - usage: wgpu::TextureUsage::STORAGE | wgpu::TextureUsage::SAMPLED, + usage: wgpu::TextureUsages::STORAGE_BINDING | wgpu::TextureUsages::TEXTURE_BINDING, }); let img_view = img.create_view(&Default::default()); let compute_bind_group = device.create_bind_group(&wgpu::BindGroupDescriptor { @@ -203,7 +201,7 @@ impl State { entries: &[ wgpu::BindGroupLayoutEntry { binding: 0, - visibility: wgpu::ShaderStage::FRAGMENT, + visibility: wgpu::ShaderStages::FRAGMENT, ty: wgpu::BindingType::Texture { multisampled: false, // Should filterable be false if we want nearest-neighbor? @@ -214,7 +212,7 @@ impl State { }, wgpu::BindGroupLayoutEntry { binding: 1, - visibility: wgpu::ShaderStage::FRAGMENT, + visibility: wgpu::ShaderStages::FRAGMENT, ty: wgpu::BindingType::Sampler { filtering: false, comparison: false, @@ -232,7 +230,7 @@ impl State { label: Some("Compute Bind Group Layout"), entries: &[wgpu::BindGroupLayoutEntry { binding: 0, - visibility: wgpu::ShaderStage::COMPUTE, + visibility: wgpu::ShaderStages::COMPUTE, ty: wgpu::BindingType::StorageTexture { access: wgpu::StorageTextureAccess::WriteOnly, format: wgpu::TextureFormat::Rgba8Unorm, @@ -246,7 +244,7 @@ impl State { label: None, bind_group_layouts: &[&compute_bg_layout], push_constant_ranges: &[wgpu::PushConstantRange { - stages: wgpu::ShaderStage::COMPUTE, + stages: wgpu::ShaderStages::COMPUTE, range: 0..std::mem::size_of::() as u32, }], }); @@ -259,14 +257,18 @@ impl State { } fn replace_pipelines(&mut self, compilation: &CompileResult) { - let new_pipelines = - State::create_pipelines(&self.device, &self.sc_desc, &self.layouts, compilation); + let new_pipelines = State::create_pipelines( + &self.device, + &self.surface_config, + &self.layouts, + compilation, + ); self.pipelines = new_pipelines; } fn create_pipelines( device: &wgpu::Device, - sc_desc: &wgpu::SwapChainDescriptor, + surface_config: &wgpu::SurfaceConfiguration, layouts: &Layouts, compilation: &CompileResult, ) -> Pipelines { @@ -288,7 +290,7 @@ impl State { fragment: Some(wgpu::FragmentState { module: &module, entry_point: "fs_main", - targets: &[sc_desc.format.into()], + targets: &[surface_config.format.into()], }), primitive: wgpu::PrimitiveState::default(), depth_stencil: None, @@ -301,60 +303,58 @@ impl State { } fn create_shader_module(device: &wgpu::Device, compilation: &CompileResult) -> ShaderModule { - let shader_flags = wgpu::ShaderFlags::empty(); let spirv_path = compilation.module.unwrap_single(); - let f = std::fs::read(spirv_path).expect("spirv should exist"); - let shader = make_spirv(&f); + let data = std::fs::read(spirv_path).expect("spirv should exist"); + let source = wgpu::util::make_spirv(&data); device.create_shader_module(&wgpu::ShaderModuleDescriptor { label: None, - source: shader, - flags: shader_flags, + source, }) } fn render_frame(&self) { - if let Some(chain) = &self.swap_chain { - let frame = chain - .get_current_frame() - .expect("error getting frame from swap chain") - .output; - - let i_time: f32 = 0.5 + self.start_time.elapsed().as_micros() as f32 * 1e-6; - let size = self.size; - let config = Config { - width: size.width, - height: size.height, - time: i_time, - }; - - let mut encoder = self.device.create_command_encoder(&Default::default()); - { - let mut cpass = encoder.begin_compute_pass(&Default::default()); - cpass.set_pipeline(&self.pipelines.compute_pipeline); - cpass.set_push_constants(0, bytemuck::bytes_of(&config)); - cpass.set_bind_group(0, &self.compute_bind_group, &[]); - // Round up to next multiple - cpass.dispatch((size.width + 16 - 1) / 16, (size.height + 16 - 1) / 16, 1); - } - { - let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { - label: None, - color_attachments: &[wgpu::RenderPassColorAttachment { - view: &frame.view, - resolve_target: None, - ops: wgpu::Operations { - load: wgpu::LoadOp::Clear(wgpu::Color::GREEN), - store: true, - }, - }], - depth_stencil_attachment: None, - }); - rpass.set_pipeline(&self.pipelines.copy_pipeline); - rpass.set_bind_group(0, &self.copy_bind_group, &[]); - rpass.draw(0..3, 0..2); - } - self.queue.submit(Some(encoder.finish())); + let frame = match self.surface.get_current_texture() { + Ok(output) => output, + Err(_) => todo!(), + }; + let frame_view = frame + .texture + .create_view(&wgpu::TextureViewDescriptor::default()); + let i_time: f32 = 0.5 + self.start_time.elapsed().as_micros() as f32 * 1e-6; + let size = self.size; + let config = Config { + width: size.width, + height: size.height, + time: i_time, + }; + + let mut encoder = self.device.create_command_encoder(&Default::default()); + { + let mut cpass = encoder.begin_compute_pass(&Default::default()); + cpass.set_pipeline(&self.pipelines.compute_pipeline); + cpass.set_push_constants(0, bytemuck::bytes_of(&config)); + cpass.set_bind_group(0, &self.compute_bind_group, &[]); + // Round up to next multiple + cpass.dispatch((size.width + 16 - 1) / 16, (size.height + 16 - 1) / 16, 1); + } + { + let mut rpass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { + label: None, + color_attachments: &[wgpu::RenderPassColorAttachment { + view: &frame_view, + resolve_target: None, + ops: wgpu::Operations { + load: wgpu::LoadOp::Clear(wgpu::Color::GREEN), + store: true, + }, + }], + depth_stencil_attachment: None, + }); + rpass.set_pipeline(&self.pipelines.copy_pipeline); + rpass.set_bind_group(0, &self.copy_bind_group, &[]); + rpass.draw(0..3, 0..2); } + self.queue.submit(Some(encoder.finish())); } } @@ -395,9 +395,8 @@ fn main() { let event_loop = EventLoop::with_user_event(); let proxy = event_loop.create_proxy(); // Watch for changes on a background thread - let initial_result = SpirvBuilder::new("./shaders", "spirv-unknown-vulkan1.2") + let initial_result = SpirvBuilder::new("./shaders", "spirv-unknown-spv1.5") .print_metadata(spirv_builder::MetadataPrintout::None) - .capability(spirv_builder::Capability::StorageImageWriteWithoutFormat) .watch(move |result| proxy.send_event(result).unwrap()) .expect("Correctly setup"); From dcafcc87b5fd2c4b54391fd37e350927f876e975 Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Sun, 31 Oct 2021 13:18:00 +0000 Subject: [PATCH 2/3] Upgrade to a lightly non-standard rust-gpu --- rust-gpu-toy/Cargo.lock | 18 +++++++++--------- rust-gpu-toy/Cargo.toml | 2 +- rust-gpu-toy/shaders/Cargo.toml | 2 +- rust-gpu-toy/shaders/src/lib.rs | 3 +-- rust-gpu-toy/src/main.rs | 15 ++++++++++++++- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/rust-gpu-toy/Cargo.lock b/rust-gpu-toy/Cargo.lock index 2adc584..ab1ac2b 100644 --- a/rust-gpu-toy/Cargo.lock +++ b/rust-gpu-toy/Cargo.lock @@ -825,9 +825,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.105" +version = "0.2.106" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "869d572136620d55835903746bcb5cdc54cb2851fd0aeec53220b4bb65ef3013" +checksum = "a60553f9a9e039a333b4e9b20573b9e9b9c0bb3a11e201ccc48ef4283456d673" [[package]] name = "libloading" @@ -1247,9 +1247,9 @@ dependencies = [ [[package]] name = "profiling" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87dfd5592a8eed7e74f56ad7b125f8234763b805c30f0c7c95c486920026a6ec" +checksum = "9926767b8b8244d7b6b64546585121d193c3d0b4856ccd656b7bfa9deb91ab6a" [[package]] name = "quote" @@ -1369,7 +1369,7 @@ checksum = "7ef03e0a2b150c7a90d01faf6254c9c48a41e95fb2a8c2ac1c6f0d2b9aefc342" [[package]] name = "rustc_codegen_spirv" version = "0.4.0-alpha.12" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=c4eb7af88ee0baf556cc6b46389a2e71b34919bf#c4eb7af88ee0baf556cc6b46389a2e71b34919bf" +source = "git+https://github.com/DJMcNab/rust-gpu?rev=c5bb9ebcf90a6bef3d9f11f79d3d33414f36091f#c5bb9ebcf90a6bef3d9f11f79d3d33414f36091f" dependencies = [ "ar", "bimap", @@ -1519,7 +1519,7 @@ dependencies = [ [[package]] name = "spirv-builder" version = "0.4.0-alpha.12" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=c4eb7af88ee0baf556cc6b46389a2e71b34919bf#c4eb7af88ee0baf556cc6b46389a2e71b34919bf" +source = "git+https://github.com/DJMcNab/rust-gpu?rev=c5bb9ebcf90a6bef3d9f11f79d3d33414f36091f#c5bb9ebcf90a6bef3d9f11f79d3d33414f36091f" dependencies = [ "memchr", "notify", @@ -1532,7 +1532,7 @@ dependencies = [ [[package]] name = "spirv-std" version = "0.4.0-alpha.12" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=c4eb7af88ee0baf556cc6b46389a2e71b34919bf#c4eb7af88ee0baf556cc6b46389a2e71b34919bf" +source = "git+https://github.com/DJMcNab/rust-gpu?rev=c5bb9ebcf90a6bef3d9f11f79d3d33414f36091f#c5bb9ebcf90a6bef3d9f11f79d3d33414f36091f" dependencies = [ "bitflags", "glam", @@ -1544,7 +1544,7 @@ dependencies = [ [[package]] name = "spirv-std-macros" version = "0.4.0-alpha.12" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=c4eb7af88ee0baf556cc6b46389a2e71b34919bf#c4eb7af88ee0baf556cc6b46389a2e71b34919bf" +source = "git+https://github.com/DJMcNab/rust-gpu?rev=c5bb9ebcf90a6bef3d9f11f79d3d33414f36091f#c5bb9ebcf90a6bef3d9f11f79d3d33414f36091f" dependencies = [ "heck", "proc-macro2", @@ -1574,7 +1574,7 @@ dependencies = [ [[package]] name = "spirv-types" version = "0.4.0-alpha.12" -source = "git+https://github.com/EmbarkStudios/rust-gpu?rev=c4eb7af88ee0baf556cc6b46389a2e71b34919bf#c4eb7af88ee0baf556cc6b46389a2e71b34919bf" +source = "git+https://github.com/DJMcNab/rust-gpu?rev=c5bb9ebcf90a6bef3d9f11f79d3d33414f36091f#c5bb9ebcf90a6bef3d9f11f79d3d33414f36091f" [[package]] name = "strsim" diff --git a/rust-gpu-toy/Cargo.toml b/rust-gpu-toy/Cargo.toml index 7dcbc85..cfc3045 100644 --- a/rust-gpu-toy/Cargo.toml +++ b/rust-gpu-toy/Cargo.toml @@ -12,7 +12,7 @@ winit = "0.25" pollster = "0.2" async-executor = "1.0" bytemuck = "1.6.3" -spirv-builder = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "c4eb7af88ee0baf556cc6b46389a2e71b34919bf", features = [ +spirv-builder = { git = "https://github.com/DJMcNab/rust-gpu", rev = "c5bb9ebcf90a6bef3d9f11f79d3d33414f36091f", features = [ "watch", ] } rust-gpu-toy-shared = { path = "./shared" } diff --git a/rust-gpu-toy/shaders/Cargo.toml b/rust-gpu-toy/shaders/Cargo.toml index b9f4c16..d556ce7 100644 --- a/rust-gpu-toy/shaders/Cargo.toml +++ b/rust-gpu-toy/shaders/Cargo.toml @@ -10,7 +10,7 @@ edition = "2018" crate-type = ["dylib"] [dependencies] -spirv-std = { git = "https://github.com/EmbarkStudios/rust-gpu", rev = "c4eb7af88ee0baf556cc6b46389a2e71b34919bf", features = [ +spirv-std = { git = "https://github.com/DJMcNab/rust-gpu", rev = "c5bb9ebcf90a6bef3d9f11f79d3d33414f36091f", features = [ "glam", ] } rust-gpu-toy-shared = { path = "../shared" } diff --git a/rust-gpu-toy/shaders/src/lib.rs b/rust-gpu-toy/shaders/src/lib.rs index 478ea4c..b42ded6 100644 --- a/rust-gpu-toy/shaders/src/lib.rs +++ b/rust-gpu-toy/shaders/src/lib.rs @@ -19,10 +19,9 @@ use spirv_std::{ #[spirv(compute(threads(16, 16)))] pub fn main( #[spirv(push_constant)] config: &Config, - #[spirv(descriptor_set = 0, binding = 0, storage_buffer)] output_buffer: &image::Image!(2D, format=rgba8, sampled=false), + #[spirv(descriptor_set = 0, binding = 0, non_readable)] output_buffer: &image::Image!(2D, format=rgba8, sampled=false), #[spirv(global_invocation_id)] global_ix: UVec3, ) { - asm!(); let frag_coord = global_ix.truncate().as_vec2() / vec2(config.width as f32, config.height as f32) - vec2(0.5, 0.5); diff --git a/rust-gpu-toy/src/main.rs b/rust-gpu-toy/src/main.rs index 42fdd8f..92135cd 100644 --- a/rust-gpu-toy/src/main.rs +++ b/rust-gpu-toy/src/main.rs @@ -315,7 +315,19 @@ impl State { fn render_frame(&self) { let frame = match self.surface.get_current_texture() { Ok(output) => output, - Err(_) => todo!(), + Err(err) => { + eprintln!("get_current_texture error: {:?}", err); + match err { + wgpu::SurfaceError::Lost => { + self.surface.configure(&self.device, &self.surface_config); + } + wgpu::SurfaceError::OutOfMemory => { + panic!(); + } + _ => (), + } + return; + } }; let frame_view = frame .texture @@ -355,6 +367,7 @@ impl State { rpass.draw(0..3, 0..2); } self.queue.submit(Some(encoder.finish())); + frame.present(); } } From 649bd1cd075c2d9bc9e2e2cf70b0594b3a20acb4 Mon Sep 17 00:00:00 2001 From: Daniel McNab <36049421+DJMcNab@users.noreply.github.com> Date: Sun, 31 Oct 2021 16:03:58 +0000 Subject: [PATCH 3/3] Remove surplus comment --- rust-gpu-toy/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-gpu-toy/src/main.rs b/rust-gpu-toy/src/main.rs index 92135cd..3f7ace9 100644 --- a/rust-gpu-toy/src/main.rs +++ b/rust-gpu-toy/src/main.rs @@ -78,7 +78,7 @@ impl State { }) .await .expect("error finding adapter"); - let features = wgpu::Features::PUSH_CONSTANTS /* | wgpu::Features::SPIRV_SHADER_PASSTHROUGH */; + let features = wgpu::Features::PUSH_CONSTANTS; let limits = wgpu::Limits { max_push_constant_size: std::mem::size_of::() as u32, ..Default::default()