From ac0f7cd60636dcb282178ae1ff37371fb8dc61c0 Mon Sep 17 00:00:00 2001 From: Benjamin Hansen Date: Sat, 20 Jul 2024 13:09:00 -0600 Subject: [PATCH] update to 22.0 --- .cargo/{config => config.toml} | 0 Cargo.lock | 850 +++--------------- Cargo.toml | 2 +- code/beginner/tutorial1-window/Cargo.toml | 4 +- code/beginner/tutorial2-surface/Cargo.toml | 4 +- .../tutorial2-surface/src/challenge.rs | 1 + code/beginner/tutorial2-surface/src/lib.rs | 1 + code/beginner/tutorial3-pipeline/Cargo.toml | 4 +- .../tutorial3-pipeline/src/challenge.rs | 8 + code/beginner/tutorial3-pipeline/src/lib.rs | 5 + code/beginner/tutorial4-buffer/Cargo.toml | 6 +- .../tutorial4-buffer/src/challenge.rs | 5 + code/beginner/tutorial4-buffer/src/lib.rs | 5 + code/beginner/tutorial5-textures/Cargo.toml | 6 +- .../tutorial5-textures/src/challenge.rs | 5 + code/beginner/tutorial5-textures/src/lib.rs | 5 + .../tutorial5-textures/src/texture.rs | 1 + code/beginner/tutorial6-uniforms/Cargo.toml | 6 +- .../tutorial6-uniforms/src/challenge.rs | 5 + code/beginner/tutorial6-uniforms/src/lib.rs | 5 + .../tutorial6-uniforms/src/texture.rs | 1 + code/beginner/tutorial7-instancing/Cargo.toml | 6 +- .../tutorial7-instancing/src/challenge.rs | 5 + code/beginner/tutorial7-instancing/src/lib.rs | 5 + .../tutorial7-instancing/src/texture.rs | 1 + code/beginner/tutorial8-depth/Cargo.toml | 6 +- .../beginner/tutorial8-depth/src/challenge.rs | 9 + code/beginner/tutorial8-depth/src/lib.rs | 5 + code/beginner/tutorial8-depth/src/texture.rs | 1 + code/beginner/tutorial9-models/Cargo.toml | 6 +- code/beginner/tutorial9-models/src/lib.rs | 5 + code/beginner/tutorial9-models/src/model.rs | 5 + code/beginner/tutorial9-models/src/texture.rs | 1 + .../tutorial10-lighting/Cargo.toml | 6 +- .../tutorial10-lighting/src/lib.rs | 4 + .../tutorial10-lighting/src/model.rs | 6 + .../tutorial10-lighting/src/texture.rs | 1 + .../tutorial11-normals/Cargo.toml | 6 +- .../tutorial11-normals/src/lib.rs | 4 + .../tutorial11-normals/src/model.rs | 8 + .../tutorial11-normals/src/texture.rs | 1 + .../intermediate/tutorial12-camera/Cargo.toml | 6 +- .../intermediate/tutorial12-camera/src/lib.rs | 4 + .../tutorial12-camera/src/model.rs | 8 + .../tutorial12-camera/src/texture.rs | 1 + code/intermediate/tutorial13-hdr/Cargo.toml | 4 +- code/intermediate/tutorial13-hdr/src/lib.rs | 4 + code/intermediate/tutorial13-hdr/src/model.rs | 8 + .../tutorial13-hdr/src/resources.rs | 2 + .../tutorial13-hdr/src/texture.rs | 1 + code/intermediate/wip-terrain/Cargo.toml | 6 +- .../wip-terrain/src/bindgroups.rs | 1 + code/intermediate/wip-terrain/src/lib.rs | 4 + code/intermediate/wip-terrain/src/model.rs | 8 + code/intermediate/wip-terrain/src/terrain.rs | 6 + code/intermediate/wip-terrain/src/texture.rs | 1 + code/showcase/compute/Cargo.toml | 2 +- code/showcase/compute/src/main.rs | 1 + code/showcase/compute/src/model.rs | 8 + code/showcase/compute/src/pipeline.rs | 5 + code/showcase/compute/src/texture.rs | 1 + code/showcase/framework/Cargo.toml | 4 +- code/showcase/framework/src/lib.rs | 1 + code/showcase/framework/src/pipeline.rs | 3 + code/showcase/framework/src/shader_canvas.rs | 4 + code/showcase/gifs/Cargo.toml | 4 +- code/showcase/gifs/src/main.rs | 4 + code/showcase/imgui-demo/Cargo.toml | 4 +- code/showcase/mouse-picking/Cargo.toml | 6 +- code/showcase/mouse-picking/src/lib.rs | 4 + code/showcase/mouse-picking/src/math.rs | 4 - code/showcase/mouse-picking/src/model.rs | 8 + code/showcase/mouse-picking/src/texture.rs | 1 + code/showcase/pong/Cargo.toml | 6 +- code/showcase/pong/src/render/mod.rs | 3 + code/showcase/pong/src/state.rs | 1 + code/showcase/snow/Cargo.toml | 2 +- code/showcase/snow/src/camera.rs | 1 + code/showcase/snow/src/main.rs | 6 + code/showcase/threading/Cargo.toml | 6 +- code/showcase/threading/src/lib.rs | 4 + code/showcase/threading/src/model.rs | 8 + code/showcase/threading/src/texture.rs | 1 + code/showcase/windowless/Cargo.toml | 2 +- code/showcase/windowless/src/main.rs | 3 + code/wasm-builder/src/main.rs | 2 +- docs/README.md | 58 +- docs/beginner/tutorial1-window/README.md | 14 +- docs/beginner/tutorial2-surface/README.md | 4 +- docs/beginner/tutorial3-pipeline/README.md | 15 +- docs/beginner/tutorial4-buffer/README.md | 2 +- docs/beginner/tutorial5-textures/README.md | 5 +- .../tutorial10-lighting/README.md | 2 + docs/intermediate/tutorial13-hdr/readme.md | 4 +- docs/news/0.16/readme.md | 2 +- docs/news/22.0/readme.md | 17 + docs/showcase/imgui-demo/README.md | 2 +- docs/showcase/pong/README.md | 19 +- docs/showcase/windowless/README.md | 2 +- wasm-targets.json | 4 - 100 files changed, 526 insertions(+), 817 deletions(-) rename .cargo/{config => config.toml} (100%) create mode 100644 docs/news/22.0/readme.md diff --git a/.cargo/config b/.cargo/config.toml similarity index 100% rename from .cargo/config rename to .cargo/config.toml diff --git a/Cargo.lock b/Cargo.lock index aa35ae37f..4fc1ca77b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -62,26 +62,10 @@ name = "alignment" version = "0.1.0" [[package]] -name = "alsa" -version = "0.6.0" +name = "allocator-api2" +version = "0.2.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5915f52fe2cf65e83924d037b6c5290b7cee097c6b5c8700746e6168a343fd6b" -dependencies = [ - "alsa-sys", - "bitflags 1.3.2", - "libc", - "nix 0.23.2", -] - -[[package]] -name = "alsa-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" -dependencies = [ - "libc", - "pkg-config", -] +checksum = "5c6cb57a04249c6480766f7f7cef5467412af1490f8d1e243141daddada3264f" [[package]] name = "android-activity" @@ -90,17 +74,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39b801912a977c3fd52d80511fe1c0c8480c6f957f21ae2ce1b92ffe970cf4b9" dependencies = [ "android-properties", - "bitflags 2.4.2", + "bitflags 2.6.0", "cc", "cesu8", - "jni 0.21.1", + "jni", "jni-sys", "libc", "log", - "ndk 0.8.0", + "ndk", "ndk-context", - "ndk-sys 0.5.0+25.2.9519653", - "num_enum 0.7.2", + "ndk-sys", + "num_enum", "thiserror", ] @@ -143,15 +127,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -dependencies = [ - "num-traits", -] - [[package]] name = "arrayref" version = "0.3.6" @@ -172,11 +147,11 @@ checksum = "175571dd1d178ced59193a6fc02dde1b972eb0bc56c892cde9beeceac5bf0f6b" [[package]] name = "ash" -version = "0.37.3+1.3.251" +version = "0.38.0+1.3.281" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39e9c3835d686b0a6084ab4234fcd1b07dbf6e4767dce60874b12356a25ecd4a" +checksum = "0bb44936d800fea8f016d7f2311c6a4f97aebd5dc86f09906139ec848cf3a46f" dependencies = [ - "libloading 0.7.3", + "libloading", ] [[package]] @@ -292,12 +267,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - [[package]] name = "base64" version = "0.13.0" @@ -311,32 +280,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" [[package]] -name = "bindgen" -version = "0.69.4" +name = "bit-set" +version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a00dc851838a2120612785d195287475a3ac45514741da670b735818822129a0" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" dependencies = [ - "bitflags 2.4.2", - "cexpr", - "clang-sys", - "itertools", - "lazy_static", - "lazycell", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", - "syn 2.0.48", + "bit-vec 0.6.3", ] [[package]] name = "bit-set" -version = "0.5.3" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "f0481a0e032742109b1133a095184ee93d88f3dc9e0d28a5d033dc77a073f44f" dependencies = [ - "bit-vec", + "bit-vec 0.7.0", ] [[package]] @@ -345,6 +303,12 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +[[package]] +name = "bit-vec" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2c54ff287cfc0a34f38a6b832ea1bd8e448a330b3e40a50859e6488bee07f22" + [[package]] name = "bit_field" version = "0.10.1" @@ -359,9 +323,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.4.2" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" [[package]] name = "block" @@ -410,9 +374,9 @@ checksum = "572f695136211188308f16ad2ca5c851a712c464060ae6974944458eb83880ba" [[package]] name = "bytemuck" -version = "1.13.1" +version = "1.16.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "17febce684fd15d89027105661fec94afb475cb995fbc59d2865198446ba2eea" +checksum = "b236fc92302c97ed75b38da1f4917b5cdda4984745740f153a5d3059e48d725e" dependencies = [ "bytemuck_derive", ] @@ -452,7 +416,7 @@ version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fba7adb4dd5aa98e5553510223000e7148f621165ec5f9acd7113f6ca4995298" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "log", "polling 3.3.2", "rustix 0.38.30", @@ -498,15 +462,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" -[[package]] -name = "cexpr" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" -dependencies = [ - "nom", -] - [[package]] name = "cfg-if" version = "1.0.0" @@ -525,7 +480,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a98d30140e3296250832bbaaff83b27dcd6fa3cc70fb6f1f3e5c9c0023b5317" dependencies = [ - "approx 0.4.0", + "approx", "num-traits", ] @@ -541,17 +496,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "clang-sys" -version = "1.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" -dependencies = [ - "glob", - "libc", - "libloading 0.8.0", -] - [[package]] name = "cmake" version = "0.1.48" @@ -678,9 +622,9 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ "core-foundation-sys", "libc", @@ -688,9 +632,9 @@ dependencies = [ [[package]] name = "core-foundation-sys" -version = "0.8.3" +version = "0.8.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" [[package]] name = "core-graphics" @@ -707,58 +651,13 @@ dependencies = [ [[package]] name = "core-graphics-types" -version = "0.1.1" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ "bitflags 1.3.2", "core-foundation", - "foreign-types 0.3.2", - "libc", -] - -[[package]] -name = "coreaudio-rs" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11894b20ebfe1ff903cbdc52259693389eea03b94918a2def2c30c3bf227ad88" -dependencies = [ - "bitflags 1.3.2", - "coreaudio-sys", -] - -[[package]] -name = "coreaudio-sys" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f01585027057ff5f0a5bf276174ae4c1594a2c5bde93d5f46a016d76270f5a9" -dependencies = [ - "bindgen", -] - -[[package]] -name = "cpal" -version = "0.14.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f342c1b63e185e9953584ff2199726bf53850d96610a310e3aca09e9405a2d0b" -dependencies = [ - "alsa", - "core-foundation-sys", - "coreaudio-rs", - "jni 0.19.0", - "js-sys", "libc", - "mach", - "ndk 0.7.0", - "ndk-context", - "oboe", - "once_cell", - "parking_lot 0.12.1", - "stdweb", - "thiserror", - "wasm-bindgen", - "web-sys", - "windows 0.37.0", ] [[package]] @@ -881,12 +780,12 @@ dependencies = [ [[package]] name = "d3d12" -version = "0.19.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e3d747f100290a1ca24b752186f61f6637e1deffe3bf6320de6fcb29510a307" +checksum = "bdbd1f579714e3c809ebd822c81ef148b1ceaeb3d535352afc73fd0c4c6a0017" dependencies = [ - "bitflags 2.4.2", - "libloading 0.8.0", + "bitflags 2.6.0", + "libloading", "winapi", ] @@ -896,12 +795,6 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fb4b71acc1405be2431a93892a79a0d82ed5ba6885649ddbdfc62caa4d67b1c" -[[package]] -name = "discard" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" - [[package]] name = "dispatch" version = "0.2.0" @@ -914,7 +807,16 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330c60081dcc4c72131f8eb70510f1ac07223e5d4163db481a04a0befcffa412" dependencies = [ - "libloading 0.8.0", + "libloading", +] + +[[package]] +name = "document-features" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb6969eaabd2421f8a2775cfd2471a2b634372b4a25d41e3bd647b79912850a0" +dependencies = [ + "litrs", ] [[package]] @@ -1303,58 +1205,20 @@ dependencies = [ [[package]] name = "glutin_wgl_sys" -version = "0.5.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" +checksum = "0a4e1951bbd9434a81aa496fe59ccc2235af3820d27b85f9314e279609211e2c" dependencies = [ "gl_generator", ] -[[package]] -name = "glyph_brush" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3676f482c536a985fca36ce320a5e5b8fafd7b260806742af1963b71c5dc38c" -dependencies = [ - "glyph_brush_draw_cache", - "glyph_brush_layout", - "ordered-float", - "rustc-hash", - "twox-hash", -] - -[[package]] -name = "glyph_brush_draw_cache" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6010675390f6889e09a21e2c8b575b3ee25667ea8237a8d59423f73cb8c28610" -dependencies = [ - "ab_glyph", - "crossbeam-channel", - "crossbeam-deque", - "linked-hash-map", - "rayon", - "rustc-hash", -] - -[[package]] -name = "glyph_brush_layout" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc32c2334f00ca5ac3695c5009ae35da21da8c62d255b5b96d56e2597a637a38" -dependencies = [ - "ab_glyph", - "approx 0.5.1", - "xi-unicode", -] - [[package]] name = "gpu-alloc" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fbcd2dba93594b227a1f57ee09b8b9da8892c34d55aa332e034a228d0fe6a171" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "gpu-alloc-types", ] @@ -1364,40 +1228,40 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "98ff03b468aa837d70984d55f5d3f846f6ec31fe34bbb97c4f85219caeee1ca4" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", ] [[package]] name = "gpu-allocator" -version = "0.25.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f56f6318968d03c18e1bcf4857ff88c61157e9da8e47c5f29055d60e1228884" +checksum = "fdd4240fc91d3433d5e5b0fc5b67672d771850dc19bbee03c1381e19322803d7" dependencies = [ "log", "presser", "thiserror", "winapi", - "windows 0.51.1", + "windows", ] [[package]] name = "gpu-descriptor" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b0c02e1ba0bdb14e965058ca34e09c020f8e507a760df1121728e0aef68d57a" +checksum = "9c08c1f623a8d0b722b8b99f821eb0ba672a1618f0d3b16ddbee1cedd2dd8557" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", "gpu-descriptor-types", - "hashbrown 0.12.3", + "hashbrown 0.14.2", ] [[package]] name = "gpu-descriptor-types" -version = "0.1.1" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "363e3677e55ad168fef68cf9de3a4a310b53124c5e784c53a1d70e92d23f2126" +checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" dependencies = [ - "bitflags 1.3.2", + "bitflags 2.6.0", ] [[package]] @@ -1433,15 +1297,16 @@ name = "hashbrown" version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" -dependencies = [ - "ahash 0.7.6", -] [[package]] name = "hashbrown" version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93e7192158dbcda357bdec5fb5788eebf8bbac027f3f33e719d29135ae84156" +dependencies = [ + "ahash 0.8.7", + "allocator-api2", +] [[package]] name = "hassle-rs" @@ -1449,10 +1314,10 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af2a7e73e1f34c48da31fb668a907f250794837e08faa144fd24f0b8b741e890" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "com", "libc", - "libloading 0.8.0", + "libloading", "thiserror", "widestring", "winapi", @@ -1491,12 +1356,6 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" -[[package]] -name = "hound" -version = "3.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62adaabb884c94955b19907d60019f4e145d091c75345379e70d1ee696f7854f" - [[package]] name = "http" version = "0.2.8" @@ -1704,35 +1563,12 @@ dependencies = [ "windows-sys 0.42.0", ] -[[package]] -name = "itertools" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4217ad341ebadf8d8e724e264f13e593e0648f5b3e94b3896a5df283be015ecc" -[[package]] -name = "jni" -version = "0.19.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6df18c2e3db7e453d3c6ac5b3e9d5182664d28788126d39b91f2d1e22b017ec" -dependencies = [ - "cesu8", - "combine", - "jni-sys", - "log", - "thiserror", - "walkdir", -] - [[package]] name = "jni" version = "0.21.1" @@ -1789,7 +1625,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.8.0", + "libloading", "pkg-config", ] @@ -1814,12 +1650,6 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -[[package]] -name = "lazycell" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" - [[package]] name = "leb128" version = "0.2.5" @@ -1838,16 +1668,6 @@ version = "0.2.152" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13e3bf6590cbc649f4d1a3eefc9d5d6eb746f5200ffb04e5e142700b8faa56e7" -[[package]] -name = "libloading" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efbc0f03f9a775e9f6aed295c6a1ba2253c5757a9e03d55c6caa46a681abcddd" -dependencies = [ - "cfg-if", - "winapi", -] - [[package]] name = "libloading" version = "0.8.0" @@ -1867,12 +1687,6 @@ dependencies = [ "cc", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "linux-raw-sys" version = "0.1.4" @@ -1885,6 +1699,12 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +[[package]] +name = "litrs" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4ce301924b7887e9d637144fdade93f9dfff9b60981d4ac161db09720d39aa5" + [[package]] name = "lock_api" version = "0.4.9" @@ -1905,15 +1725,6 @@ dependencies = [ "value-bag", ] -[[package]] -name = "mach" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b823e83b2affd8f40a9ee8c29dbc56404c1e34cd2710921f2801e2cf29527afa" -dependencies = [ - "libc", -] - [[package]] name = "malloc_buf" version = "0.0.6" @@ -1967,11 +1778,11 @@ dependencies = [ [[package]] name = "metal" -version = "0.27.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" +checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "block", "core-graphics-types", "foreign-types 0.5.0", @@ -2054,7 +1865,7 @@ version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f50357e1167a3ab92d6b3c7f4bf5f7fd13fde3f4b28bf0d5ea07b5100fdb6c0" dependencies = [ - "bit-set", + "bit-set 0.5.3", "bitflags 1.3.2", "indexmap 1.9.3", "log", @@ -2068,34 +1879,18 @@ dependencies = [ [[package]] name = "naga" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c3d4269bcb7d50121097702fde1afb75f4ea8083aeb7a55688dcf289a853271" -dependencies = [ - "bit-set", - "bitflags 1.3.2", - "indexmap 1.9.3", - "log", - "num-traits", - "pp-rs", - "rustc-hash", - "spirv 0.2.0+1.5.4", - "thiserror", -] - -[[package]] -name = "naga" -version = "0.19.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8878eb410fc90853da3908aebfe61d73d26d4437ef850b70050461f939509899" +checksum = "09eeccb9b50f4f7839b214aa3e08be467159506a986c18e0702170ccf720a453" dependencies = [ - "bit-set", - "bitflags 2.4.2", + "arrayvec", + "bit-set 0.6.0", + "bitflags 2.6.0", + "cfg_aliases", "codespan-reporting", "hexf-parse", "indexmap 2.1.0", "log", - "num-traits", "petgraph", "rustc-hash", "spirv 0.3.0+sdk-1.3.268.0", @@ -2131,44 +1926,17 @@ dependencies = [ "tempfile", ] -[[package]] -name = "ndk" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2032c77e030ddee34a6787a64166008da93f6a352b629261d0fee232b8742dd4" -dependencies = [ - "bitflags 1.3.2", - "jni-sys", - "ndk-sys 0.3.0", - "num_enum 0.5.11", - "thiserror", -] - -[[package]] -name = "ndk" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "451422b7e4718271c8b5b3aadf5adedba43dc76312454b387e98fae0fc951aa0" -dependencies = [ - "bitflags 1.3.2", - "jni-sys", - "ndk-sys 0.4.1+23.1.7779620", - "num_enum 0.5.11", - "raw-window-handle 0.5.2", - "thiserror", -] - [[package]] name = "ndk" version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2076a31b7010b17a38c01907c45b945e8f11495ee4dd588309718901b1f7a5b7" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "jni-sys", "log", - "ndk-sys 0.5.0+25.2.9519653", - "num_enum 0.7.2", + "ndk-sys", + "num_enum", "raw-window-handle 0.5.2", "raw-window-handle 0.6.0", "thiserror", @@ -2180,24 +1948,6 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" -[[package]] -name = "ndk-sys" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e5a6ae77c8ee183dcbbba6150e2e6b9f3f4196a7666c02a715a95692ec1fa97" -dependencies = [ - "jni-sys", -] - -[[package]] -name = "ndk-sys" -version = "0.4.1+23.1.7779620" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3cf2aae958bd232cac5069850591667ad422d263686d75b52a065f9badeee5a3" -dependencies = [ - "jni-sys", -] - [[package]] name = "ndk-sys" version = "0.5.0+25.2.9519653" @@ -2207,19 +1957,6 @@ dependencies = [ "jni-sys", ] -[[package]] -name = "nix" -version = "0.23.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f3790c00a0150112de0f4cd161e3d7fc4b2d8a5542ffc35f099a2562aecb35c" -dependencies = [ - "bitflags 1.3.2", - "cc", - "cfg-if", - "libc", - "memoffset 0.6.5", -] - [[package]] name = "nix" version = "0.26.4" @@ -2242,17 +1979,6 @@ dependencies = [ "minimal-lexical", ] -[[package]] -name = "num-derive" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.102", -] - [[package]] name = "num-integer" version = "0.1.45" @@ -2293,34 +2019,13 @@ dependencies = [ "libc", ] -[[package]] -name = "num_enum" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f646caf906c20226733ed5b1374287eb97e3c2a5c227ce668c1f2ce20ae57c9" -dependencies = [ - "num_enum_derive 0.5.11", -] - [[package]] name = "num_enum" version = "0.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02339744ee7253741199f897151b38e72257d13802d4ee837285cc2990a90845" dependencies = [ - "num_enum_derive 0.7.2", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcbff9bc912032c62bf65ef1d5aea88983b420f4f839db1e9b0c281a25c9c799" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.102", + "num_enum_derive", ] [[package]] @@ -2342,7 +2047,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" dependencies = [ "malloc_buf", - "objc_exception", ] [[package]] @@ -2367,38 +2071,6 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d079845b37af429bfe5dfa76e6d087d788031045b25cfc6fd898486fd9847666" -[[package]] -name = "objc_exception" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad970fb455818ad6cba4c122ad012fae53ae8b4795f86378bce65e4f6bab2ca4" -dependencies = [ - "cc", -] - -[[package]] -name = "oboe" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f63c358b4fa0fbcfefd7c8be5cfc39c08ce2389f5325687e7762a48d30a5c1" -dependencies = [ - "jni 0.19.0", - "ndk 0.6.0", - "ndk-context", - "num-derive", - "num-traits", - "oboe-sys", -] - -[[package]] -name = "oboe-sys" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3370abb7372ed744232c12954d920d1a40f1c4686de9e79e800021ef492294bd" -dependencies = [ - "cc", -] - [[package]] name = "once_cell" version = "1.19.0" @@ -2411,7 +2083,7 @@ version = "0.10.60" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "79a4c6c3a2b158f7f8f2a2fc5a969fa3a068df6fc9dbb4a43845436e3af7c800" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "cfg-if", "foreign-types 0.3.2", "libc", @@ -2458,15 +2130,6 @@ dependencies = [ "redox_syscall 0.3.5", ] -[[package]] -name = "ordered-float" -version = "4.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a76df7075c7d4d01fdcb46c912dd17fba5b60c78ea480b475f2b6ab6f666584e" -dependencies = [ - "num-traits", -] - [[package]] name = "owned_ttf_parser" version = "0.19.0" @@ -2642,35 +2305,6 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22686f4785f02a4fcc856d3b3bb19bf6c8160d103f7a99cc258bddd0251dc7f2" -[[package]] -name = "pong" -version = "0.1.0" -dependencies = [ - "anyhow", - "bytemuck", - "cfg-if", - "cgmath", - "console_error_panic_hook", - "console_log", - "env_logger", - "fs_extra", - "getrandom", - "glob", - "instant", - "log", - "naga 0.11.1", - "pollster", - "rand", - "rayon", - "rodio", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "wgpu", - "wgpu_glyph", - "winit", -] - [[package]] name = "pp-rs" version = "0.2.1" @@ -2680,12 +2314,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - [[package]] name = "presser" version = "0.3.1" @@ -2736,36 +2364,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - [[package]] name = "range-alloc" version = "0.1.2" @@ -2869,9 +2467,9 @@ dependencies = [ [[package]] name = "renderdoc-sys" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "216080ab382b992234dda86873c18d4c48358f5cfcb70fd693d7f6f2131b628b" +checksum = "19b30a45b0cd0bcca8037f3d0dc3421eaf95327a17cad11964fb8179b4fc4832" [[package]] name = "reqwest" @@ -2910,16 +2508,6 @@ dependencies = [ "winreg", ] -[[package]] -name = "rodio" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb10b653d5ec0e9411a2e7d46e2c7f4046fd87d35b9955bd73ba4108d69072b5" -dependencies = [ - "cpal", - "hound", -] - [[package]] name = "roxmltree" version = "0.14.1" @@ -2948,15 +2536,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver", -] - [[package]] name = "rustix" version = "0.36.16" @@ -2977,7 +2556,7 @@ version = "0.38.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "322394588aaf33c24007e8bb3238ee3e4c5c09c084ab32bc73890b99ff326bca" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "errno", "libc", "linux-raw-sys 0.4.13", @@ -3069,21 +2648,6 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "serde" version = "1.0.145" @@ -3127,21 +2691,6 @@ dependencies = [ "serde", ] -[[package]] -name = "sha1" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" -dependencies = [ - "sha1_smol", -] - -[[package]] -name = "sha1_smol" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" - [[package]] name = "shaderc" version = "0.8.0" @@ -3172,12 +2721,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shlex" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" - [[package]] name = "slab" version = "0.4.9" @@ -3208,7 +2751,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60e3d9941fa3bacf7c2bf4b065304faa14164151254cd16ce1b1bc8fc381600f" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "calloop", "calloop-wayland-source", "cursor-icon", @@ -3284,7 +2827,7 @@ version = "0.3.0+sdk-1.3.268.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "eda41003dc44290527a59b13432d4a0379379fa074b70174882adfbdfd917844" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", ] [[package]] @@ -3299,55 +2842,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -dependencies = [ - "discard", - "rustc_version", - "stdweb-derive", - "stdweb-internal-macros", - "stdweb-internal-runtime", - "wasm-bindgen", -] - -[[package]] -name = "stdweb-derive" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn 1.0.102", -] - -[[package]] -name = "stdweb-internal-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" -dependencies = [ - "base-x", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "serde_json", - "sha1", - "syn 1.0.102", -] - -[[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" - [[package]] name = "strict-num" version = "0.1.1" @@ -3401,18 +2895,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d54378c645627613241d077a3a79db965db602882668f9136ac42af9ecb730ad" +checksum = "c0342370b38b6a11b6cc11d6a805569958d54cfa061a29969c3b5ce2ea405724" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.56" +version = "1.0.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa0faa943b50f3db30a20aa7e265dbc66076993efed8463e8de414e5d06d3471" +checksum = "a4558b58466b9ad7ca0f102865eccc95938dca1a74a856f2b57b6629050da261" dependencies = [ "proc-macro2", "quote", @@ -3989,17 +3483,6 @@ dependencies = [ "winit", ] -[[package]] -name = "twox-hash" -version = "1.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" -dependencies = [ - "cfg-if", - "rand", - "static_assertions", -] - [[package]] name = "unicode-bidi" version = "0.3.8" @@ -4197,9 +3680,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.40" +version = "0.4.42" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bde2032aeb86bdfaecc8b261eef3cba735cc426c1f3a3416d1e0791be95fc461" +checksum = "76bc14366121efc8dbb487ab05bcc9d346b3b5ec0eaa76e46594cabbe51762c0" dependencies = [ "cfg-if", "js-sys", @@ -4315,7 +3798,7 @@ checksum = "19152ddd73f45f024ed4534d9ca2594e0ef252c1847695255dae47f34df9fbe4" dependencies = [ "cc", "downcast-rs", - "nix 0.26.4", + "nix", "scoped-tls", "smallvec", "wayland-sys", @@ -4327,8 +3810,8 @@ version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ca7d52347346f5473bf2f56705f360e8440873052e575e55890c4fa57843ed3" dependencies = [ - "bitflags 2.4.2", - "nix 0.26.4", + "bitflags 2.6.0", + "nix", "wayland-backend", "wayland-scanner", ] @@ -4339,7 +3822,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "625c5029dbd43d25e6aa9615e88b829a5cad13b2819c4ae129fdbb7c31ab4c7e" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "cursor-icon", "wayland-backend", ] @@ -4350,7 +3833,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a44aa20ae986659d6c77d64d808a046996a932aa763913864dc40c359ef7ad5b" dependencies = [ - "nix 0.26.4", + "nix", "wayland-client", "xcursor", ] @@ -4361,7 +3844,7 @@ version = "0.31.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e253d7107ba913923dc253967f35e8561a3c65f914543e46843c88ddd729e21c" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-scanner", @@ -4373,7 +3856,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23803551115ff9ea9bce586860c5c5a971e360825a0309264102a9495a5ff479" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -4386,7 +3869,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ad1f61b76b6c2d8742e10f9ba5c3737f6530b4c243132c2a2ccc8aa96fe25cd6" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "wayland-backend", "wayland-client", "wayland-protocols", @@ -4453,16 +3936,16 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.19.3" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4b1213b52478a7631d6e387543ed8f642bc02c578ef4e3b49aca2a29a7df0cb" +checksum = "c87e07e87a179614940ad845397e03201847453a37b43a31a3b54eee2e6e32ce" dependencies = [ "arrayvec", - "cfg-if", "cfg_aliases", + "document-features", "js-sys", "log", - "naga 0.19.0", + "naga 22.0.0", "parking_lot 0.12.1", "profiling", "raw-window-handle 0.6.0", @@ -4478,18 +3961,19 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.19.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b15e451d4060ada0d99a64df44e4d590213496da7c4f245572d51071e8e30ed" +checksum = "e0f191908a21968991463fcf3b42cb6c9648c0fb7fa301b8fc733bc21a9ed9bd" dependencies = [ "arrayvec", - "bit-vec", - "bitflags 2.4.2", + "bit-vec 0.7.0", + "bitflags 2.6.0", + "bytemuck", "cfg_aliases", - "codespan-reporting", + "document-features", "indexmap 2.1.0", "log", - "naga 0.19.0", + "naga 22.0.0", "once_cell", "parking_lot 0.12.1", "profiling", @@ -4497,22 +3981,21 @@ dependencies = [ "rustc-hash", "smallvec", "thiserror", - "web-sys", "wgpu-hal", "wgpu-types", ] [[package]] name = "wgpu-hal" -version = "0.19.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11f259ceb56727fb097da108d92f8a5cbdb5b74a77f9e396bd43626f67299d61" +checksum = "f6bbf4b4de8b2a83c0401d9e5ae0080a2792055f25859a02bf9be97952bbed4f" dependencies = [ "android_system_properties", "arrayvec", "ash", - "bit-set", - "bitflags 2.4.2", + "bit-set 0.6.0", + "bitflags 2.6.0", "block", "cfg_aliases", "core-graphics-types", @@ -4526,10 +4009,11 @@ dependencies = [ "js-sys", "khronos-egl", "libc", - "libloading 0.8.0", + "libloading", "log", "metal", - "naga 0.19.0", + "naga 22.0.0", + "ndk-sys", "objc", "once_cell", "parking_lot 0.12.1", @@ -4561,26 +4045,15 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.19.0" +version = "22.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "895fcbeb772bfb049eb80b2d6e47f6c9af235284e9703c96fc0218a42ffd5af2" +checksum = "bc9d91f0e2c4b51434dfa6db77846f2793149d8e73f800fa2e41f52b8eac3c5d" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "js-sys", "web-sys", ] -[[package]] -name = "wgpu_glyph" -version = "0.22.0" -source = "git+https://github.com/hecrj/wgpu_glyph.git#5d78e604dffe97aa2ec8dd65a45d19699a29bbcf" -dependencies = [ - "bytemuck", - "glyph_brush", - "log", - "wgpu", -] - [[package]] name = "widestring" version = "1.0.2" @@ -4629,19 +4102,6 @@ dependencies = [ "wgpu", ] -[[package]] -name = "windows" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57b543186b344cc61c85b5aab0d2e3adf4e0f99bc076eff9aa5927bcc0b8a647" -dependencies = [ - "windows_aarch64_msvc 0.37.0", - "windows_i686_gnu 0.37.0", - "windows_i686_msvc 0.37.0", - "windows_x86_64_gnu 0.37.0", - "windows_x86_64_msvc 0.37.0", -] - [[package]] name = "windows" version = "0.51.1" @@ -4785,12 +4245,6 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" -[[package]] -name = "windows_aarch64_msvc" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2623277cb2d1c216ba3b578c0f3cf9cdebeddb6e66b1b218bb33596ea7769c3a" - [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -4815,12 +4269,6 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" -[[package]] -name = "windows_i686_gnu" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3925fd0b0b804730d44d4b6278c50f9699703ec49bcd628020f46f4ba07d9e1" - [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -4845,12 +4293,6 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" -[[package]] -name = "windows_i686_msvc" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce907ac74fe331b524c1298683efbf598bb031bc84d5e274db2083696d07c57c" - [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -4875,12 +4317,6 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" -[[package]] -name = "windows_x86_64_gnu" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2babfba0828f2e6b32457d5341427dcbb577ceef556273229959ac23a10af33d" - [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -4923,12 +4359,6 @@ version = "0.36.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" -[[package]] -name = "windows_x86_64_msvc" -version = "0.37.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4dd6dc7df2d84cf7b33822ed5b86318fb1781948e9663bacd047fc9dd52259d" - [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -4956,7 +4386,7 @@ dependencies = [ "ahash 0.8.7", "android-activity", "atomic-waker", - "bitflags 2.4.2", + "bitflags 2.6.0", "bytemuck", "calloop", "cfg_aliases", @@ -4968,8 +4398,8 @@ dependencies = [ "libc", "log", "memmap2", - "ndk 0.8.0", - "ndk-sys 0.5.0+25.2.9519653", + "ndk", + "ndk-sys", "objc2", "once_cell", "orbclient", @@ -5025,7 +4455,7 @@ dependencies = [ "as-raw-xcb-connection", "gethostname", "libc", - "libloading 0.8.0", + "libloading", "once_cell", "rustix 0.38.30", "x11rb-protocol", @@ -5046,19 +4476,13 @@ dependencies = [ "nom", ] -[[package]] -name = "xi-unicode" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" - [[package]] name = "xkbcommon-dl" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6924668544c48c0133152e7eec86d644a056ca3d09275eb8d5cdb9855f9d8699" dependencies = [ - "bitflags 2.4.2", + "bitflags 2.6.0", "dlib", "log", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index afbc30ab5..23f226cbe 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,5 +16,5 @@ members = [ ] exclude = [ "code/showcase/imgui-demo", - #"code/showcase/pong", + "code/showcase/pong", ] \ No newline at end of file diff --git a/code/beginner/tutorial1-window/Cargo.toml b/code/beginner/tutorial1-window/Cargo.toml index ada466844..c0546b7c7 100644 --- a/code/beginner/tutorial1-window/Cargo.toml +++ b/code/beginner/tutorial1-window/Cargo.toml @@ -16,13 +16,13 @@ cfg-if = "1" winit = { version = "0.29", features = ["rwh_05"] } env_logger = "0.10" log = "0.4" -wgpu = "0.19" +wgpu = "22.0" pollster = "0.3" [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1.6" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4.30" web-sys = { version = "0.3.69", features = [ diff --git a/code/beginner/tutorial2-surface/Cargo.toml b/code/beginner/tutorial2-surface/Cargo.toml index 03059fb5b..3cb033fee 100644 --- a/code/beginner/tutorial2-surface/Cargo.toml +++ b/code/beginner/tutorial2-surface/Cargo.toml @@ -12,13 +12,13 @@ cfg-if = "1" winit = { version = "0.29", features = ["rwh_05"] } env_logger = "0.10" log = "0.4" -wgpu = "0.19.3" +wgpu = "22.0" pollster = "0.3" [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1.6" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/beginner/tutorial2-surface/src/challenge.rs b/code/beginner/tutorial2-surface/src/challenge.rs index 5cbb1b1e5..75453ad66 100644 --- a/code/beginner/tutorial2-surface/src/challenge.rs +++ b/code/beginner/tutorial2-surface/src/challenge.rs @@ -62,6 +62,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) diff --git a/code/beginner/tutorial2-surface/src/lib.rs b/code/beginner/tutorial2-surface/src/lib.rs index 5d7639a7c..4bae44697 100644 --- a/code/beginner/tutorial2-surface/src/lib.rs +++ b/code/beginner/tutorial2-surface/src/lib.rs @@ -59,6 +59,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, // Some(&std::path::Path::new("trace")), // Trace path None, diff --git a/code/beginner/tutorial3-pipeline/Cargo.toml b/code/beginner/tutorial3-pipeline/Cargo.toml index dcbccb024..0d28072c0 100644 --- a/code/beginner/tutorial3-pipeline/Cargo.toml +++ b/code/beginner/tutorial3-pipeline/Cargo.toml @@ -12,13 +12,13 @@ cfg-if = "1" winit = { version = "0.29", features = ["rwh_05"] } env_logger = "0.10" log = "0.4" -wgpu = "0.19" +wgpu = "22.0" pollster = "0.3" [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1.6" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/beginner/tutorial3-pipeline/src/challenge.rs b/code/beginner/tutorial3-pipeline/src/challenge.rs index cc186bc38..3b577b367 100644 --- a/code/beginner/tutorial3-pipeline/src/challenge.rs +++ b/code/beginner/tutorial3-pipeline/src/challenge.rs @@ -56,6 +56,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) @@ -102,6 +103,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -114,6 +116,7 @@ impl<'a> State<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -137,6 +140,8 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); let shader = device.create_shader_module(wgpu::ShaderModuleDescriptor { @@ -152,6 +157,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -161,6 +167,7 @@ impl<'a> State<'a> { blend: Some(wgpu::BlendState::REPLACE), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -180,6 +187,7 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + cache: None, }); let use_color = true; diff --git a/code/beginner/tutorial3-pipeline/src/lib.rs b/code/beginner/tutorial3-pipeline/src/lib.rs index 1eefa721b..aee0de022 100644 --- a/code/beginner/tutorial3-pipeline/src/lib.rs +++ b/code/beginner/tutorial3-pipeline/src/lib.rs @@ -58,6 +58,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) @@ -104,6 +105,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -116,6 +118,7 @@ impl<'a> State<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -139,6 +142,8 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); Self { diff --git a/code/beginner/tutorial4-buffer/Cargo.toml b/code/beginner/tutorial4-buffer/Cargo.toml index c326bac2c..4a9c206f9 100644 --- a/code/beginner/tutorial4-buffer/Cargo.toml +++ b/code/beginner/tutorial4-buffer/Cargo.toml @@ -11,17 +11,17 @@ crate-type = ["cdylib", "rlib"] [dependencies] cfg-if = "1" winit = { version = "0.29", features = ["rwh_05"] } -wgpu = "0.19" +wgpu = "22.0" env_logger = "0.10" log = "0.4" pollster = "0.3" # NEW! -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/beginner/tutorial4-buffer/src/challenge.rs b/code/beginner/tutorial4-buffer/src/challenge.rs index 09bd0feaf..fa7c1b988 100644 --- a/code/beginner/tutorial4-buffer/src/challenge.rs +++ b/code/beginner/tutorial4-buffer/src/challenge.rs @@ -123,6 +123,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) @@ -169,6 +170,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[Vertex::desc()], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -181,6 +183,7 @@ impl<'a> State<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -204,6 +207,8 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { diff --git a/code/beginner/tutorial4-buffer/src/lib.rs b/code/beginner/tutorial4-buffer/src/lib.rs index 59c0d2d73..c3b78272a 100644 --- a/code/beginner/tutorial4-buffer/src/lib.rs +++ b/code/beginner/tutorial4-buffer/src/lib.rs @@ -119,6 +119,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) @@ -165,6 +166,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[Vertex::desc()], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -177,6 +179,7 @@ impl<'a> State<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -200,6 +203,8 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { diff --git a/code/beginner/tutorial5-textures/Cargo.toml b/code/beginner/tutorial5-textures/Cargo.toml index 0e214c738..82f277e7e 100644 --- a/code/beginner/tutorial5-textures/Cargo.toml +++ b/code/beginner/tutorial5-textures/Cargo.toml @@ -10,11 +10,11 @@ crate-type = ["cdylib", "rlib"] [dependencies] cfg-if = "1" anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } env_logger = "0.10" log = "0.4" pollster = "0.3" -wgpu = "0.19" +wgpu = "22.0" winit = { version = "0.29", features = ["rwh_05"] } [dependencies.image] @@ -25,7 +25,7 @@ features = ["png", "jpeg"] [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/beginner/tutorial5-textures/src/challenge.rs b/code/beginner/tutorial5-textures/src/challenge.rs index 98c039efb..6fbce3e16 100644 --- a/code/beginner/tutorial5-textures/src/challenge.rs +++ b/code/beginner/tutorial5-textures/src/challenge.rs @@ -124,6 +124,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) @@ -232,6 +233,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[Vertex::desc()], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -244,6 +246,7 @@ impl<'a> State<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -267,6 +270,8 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { diff --git a/code/beginner/tutorial5-textures/src/lib.rs b/code/beginner/tutorial5-textures/src/lib.rs index c2ab41b64..20c777404 100644 --- a/code/beginner/tutorial5-textures/src/lib.rs +++ b/code/beginner/tutorial5-textures/src/lib.rs @@ -120,6 +120,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) @@ -208,6 +209,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[Vertex::desc()], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -220,6 +222,7 @@ impl<'a> State<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -243,6 +246,8 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { diff --git a/code/beginner/tutorial5-textures/src/texture.rs b/code/beginner/tutorial5-textures/src/texture.rs index ff38f20ca..351f02cd7 100644 --- a/code/beginner/tutorial5-textures/src/texture.rs +++ b/code/beginner/tutorial5-textures/src/texture.rs @@ -2,6 +2,7 @@ use anyhow::*; use image::GenericImageView; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/code/beginner/tutorial6-uniforms/Cargo.toml b/code/beginner/tutorial6-uniforms/Cargo.toml index fcc9f95a2..9cb20643a 100644 --- a/code/beginner/tutorial6-uniforms/Cargo.toml +++ b/code/beginner/tutorial6-uniforms/Cargo.toml @@ -10,12 +10,12 @@ crate-type = ["cdylib", "rlib"] [dependencies] cfg-if = "1" anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = "0.18" env_logger = "0.10" log = "0.4" pollster = "0.3" -wgpu = "0.19" +wgpu = "22.0" winit = { version = "0.29", features = ["rwh_05"] } [dependencies.image] @@ -26,7 +26,7 @@ features = ["png", "jpeg"] [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/beginner/tutorial6-uniforms/src/challenge.rs b/code/beginner/tutorial6-uniforms/src/challenge.rs index e1401f9ee..35c7f8976 100644 --- a/code/beginner/tutorial6-uniforms/src/challenge.rs +++ b/code/beginner/tutorial6-uniforms/src/challenge.rs @@ -270,6 +270,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) @@ -403,6 +404,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[Vertex::desc()], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -415,6 +417,7 @@ impl<'a> State<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -438,6 +441,8 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { diff --git a/code/beginner/tutorial6-uniforms/src/lib.rs b/code/beginner/tutorial6-uniforms/src/lib.rs index 246d2a2c0..5a68a33a9 100644 --- a/code/beginner/tutorial6-uniforms/src/lib.rs +++ b/code/beginner/tutorial6-uniforms/src/lib.rs @@ -270,6 +270,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) @@ -402,6 +403,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[Vertex::desc()], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -414,6 +416,7 @@ impl<'a> State<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -437,6 +440,8 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { diff --git a/code/beginner/tutorial6-uniforms/src/texture.rs b/code/beginner/tutorial6-uniforms/src/texture.rs index ff38f20ca..351f02cd7 100644 --- a/code/beginner/tutorial6-uniforms/src/texture.rs +++ b/code/beginner/tutorial6-uniforms/src/texture.rs @@ -2,6 +2,7 @@ use anyhow::*; use image::GenericImageView; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/code/beginner/tutorial7-instancing/Cargo.toml b/code/beginner/tutorial7-instancing/Cargo.toml index 353ee75c9..8e754e297 100644 --- a/code/beginner/tutorial7-instancing/Cargo.toml +++ b/code/beginner/tutorial7-instancing/Cargo.toml @@ -10,12 +10,12 @@ crate-type = ["cdylib", "rlib"] [dependencies] cfg-if = "1" anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = "0.18" env_logger = "0.10" log = "0.4" pollster = "0.3" -wgpu = "0.19" +wgpu = "22.0" winit = { version = "0.29", features = ["rwh_05"] } [dependencies.image] @@ -26,7 +26,7 @@ features = ["png", "jpeg"] [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/beginner/tutorial7-instancing/src/challenge.rs b/code/beginner/tutorial7-instancing/src/challenge.rs index 95911edf0..5ca023f0f 100644 --- a/code/beginner/tutorial7-instancing/src/challenge.rs +++ b/code/beginner/tutorial7-instancing/src/challenge.rs @@ -324,6 +324,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) @@ -488,6 +489,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[Vertex::desc(), InstanceRaw::desc()], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -500,6 +502,7 @@ impl<'a> State<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -523,6 +526,8 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { diff --git a/code/beginner/tutorial7-instancing/src/lib.rs b/code/beginner/tutorial7-instancing/src/lib.rs index 76053099e..b89f55ba9 100644 --- a/code/beginner/tutorial7-instancing/src/lib.rs +++ b/code/beginner/tutorial7-instancing/src/lib.rs @@ -331,6 +331,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) @@ -495,6 +496,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[Vertex::desc(), InstanceRaw::desc()], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -507,6 +509,7 @@ impl<'a> State<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -530,6 +533,8 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { diff --git a/code/beginner/tutorial7-instancing/src/texture.rs b/code/beginner/tutorial7-instancing/src/texture.rs index ff38f20ca..351f02cd7 100644 --- a/code/beginner/tutorial7-instancing/src/texture.rs +++ b/code/beginner/tutorial7-instancing/src/texture.rs @@ -2,6 +2,7 @@ use anyhow::*; use image::GenericImageView; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/code/beginner/tutorial8-depth/Cargo.toml b/code/beginner/tutorial8-depth/Cargo.toml index 300425de4..8ab2f5a8f 100644 --- a/code/beginner/tutorial8-depth/Cargo.toml +++ b/code/beginner/tutorial8-depth/Cargo.toml @@ -10,12 +10,12 @@ crate-type = ["cdylib", "rlib"] [dependencies] cfg-if = "1" anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" -wgpu = "0.19" +wgpu = "22.0" winit = { version = "0.29", features = ["rwh_05"] } [dependencies.image] @@ -26,7 +26,7 @@ features = ["png", "jpeg"] [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/beginner/tutorial8-depth/src/challenge.rs b/code/beginner/tutorial8-depth/src/challenge.rs index b8bd12290..cc8afa628 100644 --- a/code/beginner/tutorial8-depth/src/challenge.rs +++ b/code/beginner/tutorial8-depth/src/challenge.rs @@ -369,6 +369,7 @@ impl DepthPass { module: &shader, entry_point: "vs_main", buffers: &[Vertex::desc()], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -381,6 +382,7 @@ impl DepthPass { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -404,6 +406,8 @@ impl DepthPass { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); Self { @@ -523,6 +527,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) @@ -687,6 +692,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[Vertex::desc(), InstanceRaw::desc()], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -699,6 +705,7 @@ impl<'a> State<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -732,6 +739,8 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { diff --git a/code/beginner/tutorial8-depth/src/lib.rs b/code/beginner/tutorial8-depth/src/lib.rs index 24264dfa4..7743e0752 100644 --- a/code/beginner/tutorial8-depth/src/lib.rs +++ b/code/beginner/tutorial8-depth/src/lib.rs @@ -341,6 +341,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) @@ -508,6 +509,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[Vertex::desc(), InstanceRaw::desc()], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -520,6 +522,7 @@ impl<'a> State<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -549,6 +552,8 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); let vertex_buffer = device.create_buffer_init(&wgpu::util::BufferInitDescriptor { diff --git a/code/beginner/tutorial8-depth/src/texture.rs b/code/beginner/tutorial8-depth/src/texture.rs index 29ca95611..57d3e21ff 100644 --- a/code/beginner/tutorial8-depth/src/texture.rs +++ b/code/beginner/tutorial8-depth/src/texture.rs @@ -2,6 +2,7 @@ use anyhow::*; use image::GenericImageView; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/code/beginner/tutorial9-models/Cargo.toml b/code/beginner/tutorial9-models/Cargo.toml index 9449a1f6c..5067c46f1 100644 --- a/code/beginner/tutorial9-models/Cargo.toml +++ b/code/beginner/tutorial9-models/Cargo.toml @@ -9,14 +9,14 @@ crate-type = ["cdylib", "rlib"] [dependencies] anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cfg-if = "1" cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" tobj = { version = "3.2", features = ["async"]} -wgpu = "0.19" +wgpu = "22.0" winit = { version = "0.29", features = ["rwh_05"] } [dependencies.image] @@ -28,7 +28,7 @@ features = ["png", "jpeg"] reqwest = { version = "0.11" } console_error_panic_hook = "0.1" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/beginner/tutorial9-models/src/lib.rs b/code/beginner/tutorial9-models/src/lib.rs index 513436e1c..32eab1828 100644 --- a/code/beginner/tutorial9-models/src/lib.rs +++ b/code/beginner/tutorial9-models/src/lib.rs @@ -283,6 +283,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, // Some(&std::path::Path::new("trace")), // Trace path None, // Trace path @@ -437,6 +438,7 @@ impl<'a> State<'a> { module: &shader, entry_point: "vs_main", buffers: &[model::ModelVertex::desc(), InstanceRaw::desc()], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -449,6 +451,7 @@ impl<'a> State<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -478,6 +481,8 @@ impl<'a> State<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); Self { diff --git a/code/beginner/tutorial9-models/src/model.rs b/code/beginner/tutorial9-models/src/model.rs index 5eb37a1a3..8032fbf86 100644 --- a/code/beginner/tutorial9-models/src/model.rs +++ b/code/beginner/tutorial9-models/src/model.rs @@ -42,12 +42,15 @@ impl Vertex for ModelVertex { } pub struct Material { + #[allow(unused)] pub name: String, + #[allow(unused)] pub diffuse_texture: texture::Texture, pub bind_group: wgpu::BindGroup, } pub struct Mesh { + #[allow(unused)] pub name: String, pub vertex_buffer: wgpu::Buffer, pub index_buffer: wgpu::Buffer, @@ -61,6 +64,7 @@ pub struct Model { } pub trait DrawModel<'a> { + #[allow(unused)] fn draw_mesh( &mut self, mesh: &'a Mesh, @@ -75,6 +79,7 @@ pub trait DrawModel<'a> { camera_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model(&mut self, model: &'a Model, camera_bind_group: &'a wgpu::BindGroup); fn draw_model_instanced( &mut self, diff --git a/code/beginner/tutorial9-models/src/texture.rs b/code/beginner/tutorial9-models/src/texture.rs index f5b7a7846..11c549295 100644 --- a/code/beginner/tutorial9-models/src/texture.rs +++ b/code/beginner/tutorial9-models/src/texture.rs @@ -2,6 +2,7 @@ use anyhow::*; use image::GenericImageView; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/code/intermediate/tutorial10-lighting/Cargo.toml b/code/intermediate/tutorial10-lighting/Cargo.toml index 0bb894fc1..3dcf40df8 100644 --- a/code/intermediate/tutorial10-lighting/Cargo.toml +++ b/code/intermediate/tutorial10-lighting/Cargo.toml @@ -10,13 +10,13 @@ crate-type = ["cdylib", "rlib"] [dependencies] cfg-if = "1" anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" tobj = { version = "3.2", features = ["async"]} -wgpu = { version = "0.19"} +wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } [dependencies.image] @@ -28,7 +28,7 @@ features = ["png", "jpeg"] reqwest = { version = "0.11" } console_error_panic_hook = "0.1" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/intermediate/tutorial10-lighting/src/lib.rs b/code/intermediate/tutorial10-lighting/src/lib.rs index 0f0e8bc19..a256419da 100644 --- a/code/intermediate/tutorial10-lighting/src/lib.rs +++ b/code/intermediate/tutorial10-lighting/src/lib.rs @@ -297,6 +297,7 @@ fn create_render_pipeline( module: &shader, entry_point: "vs_main", buffers: vertex_layouts, + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -309,6 +310,7 @@ fn create_render_pipeline( }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -337,6 +339,7 @@ fn create_render_pipeline( // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + cache: None, }) } @@ -376,6 +379,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, ) diff --git a/code/intermediate/tutorial10-lighting/src/model.rs b/code/intermediate/tutorial10-lighting/src/model.rs index dddda3811..0cc310bb3 100644 --- a/code/intermediate/tutorial10-lighting/src/model.rs +++ b/code/intermediate/tutorial10-lighting/src/model.rs @@ -42,12 +42,15 @@ impl Vertex for ModelVertex { } pub struct Material { + #[allow(unused)] pub name: String, + #[allow(unused)] pub diffuse_texture: texture::Texture, pub bind_group: wgpu::BindGroup, } pub struct Mesh { + #[allow(unused)] pub name: String, pub vertex_buffer: wgpu::Buffer, pub index_buffer: wgpu::Buffer, @@ -61,6 +64,7 @@ pub struct Model { } pub trait DrawModel<'a> { + #[allow(unused)] fn draw_mesh( &mut self, mesh: &'a Mesh, @@ -77,6 +81,7 @@ pub trait DrawModel<'a> { light_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model( &mut self, model: &'a Model, @@ -152,6 +157,7 @@ where } pub trait DrawLight<'a> { + #[allow(unused)] fn draw_light_mesh( &mut self, mesh: &'a Mesh, diff --git a/code/intermediate/tutorial10-lighting/src/texture.rs b/code/intermediate/tutorial10-lighting/src/texture.rs index f5b7a7846..11c549295 100644 --- a/code/intermediate/tutorial10-lighting/src/texture.rs +++ b/code/intermediate/tutorial10-lighting/src/texture.rs @@ -2,6 +2,7 @@ use anyhow::*; use image::GenericImageView; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/code/intermediate/tutorial11-normals/Cargo.toml b/code/intermediate/tutorial11-normals/Cargo.toml index 842df50d5..5f93e5ffd 100644 --- a/code/intermediate/tutorial11-normals/Cargo.toml +++ b/code/intermediate/tutorial11-normals/Cargo.toml @@ -10,13 +10,13 @@ crate-type = ["cdylib", "rlib"] [dependencies] cfg-if = "1" anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" tobj = { version = "3.2", features = ["async"]} -wgpu = { version = "0.19"} +wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } [dependencies.image] @@ -28,7 +28,7 @@ features = ["png", "jpeg"] reqwest = { version = "0.11" } console_error_panic_hook = "0.1" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/intermediate/tutorial11-normals/src/lib.rs b/code/intermediate/tutorial11-normals/src/lib.rs index 8a646cbfe..68b67bfa4 100644 --- a/code/intermediate/tutorial11-normals/src/lib.rs +++ b/code/intermediate/tutorial11-normals/src/lib.rs @@ -297,6 +297,7 @@ fn create_render_pipeline( module: &shader, entry_point: "vs_main", buffers: vertex_layouts, + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -309,6 +310,7 @@ fn create_render_pipeline( }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -337,6 +339,7 @@ fn create_render_pipeline( // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + cache: None, }) } @@ -376,6 +379,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) diff --git a/code/intermediate/tutorial11-normals/src/model.rs b/code/intermediate/tutorial11-normals/src/model.rs index 4074e2dd7..7ab4294eb 100644 --- a/code/intermediate/tutorial11-normals/src/model.rs +++ b/code/intermediate/tutorial11-normals/src/model.rs @@ -55,8 +55,11 @@ impl Vertex for ModelVertex { } pub struct Material { + #[allow(unused)] pub name: String, + #[allow(unused)] pub diffuse_texture: texture::Texture, + #[allow(unused)] pub normal_texture: texture::Texture, pub bind_group: wgpu::BindGroup, } @@ -103,6 +106,7 @@ impl Material { } pub struct Mesh { + #[allow(unused)] pub name: String, pub vertex_buffer: wgpu::Buffer, pub index_buffer: wgpu::Buffer, @@ -116,6 +120,7 @@ pub struct Model { } pub trait DrawModel<'a> { + #[allow(unused)] fn draw_mesh( &mut self, mesh: &'a Mesh, @@ -132,6 +137,7 @@ pub trait DrawModel<'a> { light_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model( &mut self, model: &'a Model, @@ -145,6 +151,7 @@ pub trait DrawModel<'a> { camera_bind_group: &'a wgpu::BindGroup, light_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model_instanced_with_material( &mut self, model: &'a Model, @@ -234,6 +241,7 @@ where } pub trait DrawLight<'a> { + #[allow(unused)] fn draw_light_mesh( &mut self, mesh: &'a Mesh, diff --git a/code/intermediate/tutorial11-normals/src/texture.rs b/code/intermediate/tutorial11-normals/src/texture.rs index 18158716d..0e6d958ab 100644 --- a/code/intermediate/tutorial11-normals/src/texture.rs +++ b/code/intermediate/tutorial11-normals/src/texture.rs @@ -2,6 +2,7 @@ use anyhow::*; use image::GenericImageView; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/code/intermediate/tutorial12-camera/Cargo.toml b/code/intermediate/tutorial12-camera/Cargo.toml index 3d99f7612..209d2787a 100644 --- a/code/intermediate/tutorial12-camera/Cargo.toml +++ b/code/intermediate/tutorial12-camera/Cargo.toml @@ -10,13 +10,13 @@ crate-type = ["cdylib", "rlib"] [dependencies] cfg-if = "1" anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" tobj = { version = "3.2", features = ["async"]} -wgpu = { version = "0.19"} +wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } instant = "0.1" @@ -29,7 +29,7 @@ features = ["png", "jpeg"] reqwest = { version = "0.11" } console_error_panic_hook = "0.1" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/intermediate/tutorial12-camera/src/lib.rs b/code/intermediate/tutorial12-camera/src/lib.rs index d02638dfd..f46502f93 100644 --- a/code/intermediate/tutorial12-camera/src/lib.rs +++ b/code/intermediate/tutorial12-camera/src/lib.rs @@ -177,6 +177,7 @@ fn create_render_pipeline( module: &shader, entry_point: "vs_main", buffers: vertex_layouts, + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -189,6 +190,7 @@ fn create_render_pipeline( }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -217,6 +219,7 @@ fn create_render_pipeline( // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + cache: None, }) } @@ -256,6 +259,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) diff --git a/code/intermediate/tutorial12-camera/src/model.rs b/code/intermediate/tutorial12-camera/src/model.rs index e3ec0e61c..b62892c0e 100644 --- a/code/intermediate/tutorial12-camera/src/model.rs +++ b/code/intermediate/tutorial12-camera/src/model.rs @@ -55,8 +55,11 @@ impl Vertex for ModelVertex { } pub struct Material { + #[allow(unused)] pub name: String, + #[allow(unused)] pub diffuse_texture: texture::Texture, + #[allow(unused)] pub normal_texture: texture::Texture, pub bind_group: wgpu::BindGroup, } @@ -102,6 +105,7 @@ impl Material { } pub struct Mesh { + #[allow(unused)] pub name: String, pub vertex_buffer: wgpu::Buffer, pub index_buffer: wgpu::Buffer, @@ -115,6 +119,7 @@ pub struct Model { } pub trait DrawModel<'a> { + #[allow(unused)] fn draw_mesh( &mut self, mesh: &'a Mesh, @@ -131,6 +136,7 @@ pub trait DrawModel<'a> { light_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model( &mut self, model: &'a Model, @@ -144,6 +150,7 @@ pub trait DrawModel<'a> { camera_bind_group: &'a wgpu::BindGroup, light_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model_instanced_with_material( &mut self, model: &'a Model, @@ -233,6 +240,7 @@ where } pub trait DrawLight<'a> { + #[allow(unused)] fn draw_light_mesh( &mut self, mesh: &'a Mesh, diff --git a/code/intermediate/tutorial12-camera/src/texture.rs b/code/intermediate/tutorial12-camera/src/texture.rs index 5790af271..c72736adb 100644 --- a/code/intermediate/tutorial12-camera/src/texture.rs +++ b/code/intermediate/tutorial12-camera/src/texture.rs @@ -2,6 +2,7 @@ use anyhow::*; use image::GenericImageView; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/code/intermediate/tutorial13-hdr/Cargo.toml b/code/intermediate/tutorial13-hdr/Cargo.toml index 38225e0c1..cd979f4c8 100644 --- a/code/intermediate/tutorial13-hdr/Cargo.toml +++ b/code/intermediate/tutorial13-hdr/Cargo.toml @@ -10,13 +10,13 @@ crate-type = ["cdylib", "rlib"] [dependencies] cfg-if = "1" anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" tobj = { version = "3.2", features = ["async"]} -wgpu = { version = "0.19"} +wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } instant = "0.1" diff --git a/code/intermediate/tutorial13-hdr/src/lib.rs b/code/intermediate/tutorial13-hdr/src/lib.rs index c128c8fd7..12ba257c1 100644 --- a/code/intermediate/tutorial13-hdr/src/lib.rs +++ b/code/intermediate/tutorial13-hdr/src/lib.rs @@ -199,6 +199,7 @@ fn create_render_pipeline( module: &shader, entry_point: "vs_main", buffers: vertex_layouts, + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -208,6 +209,7 @@ fn create_render_pipeline( blend: None, write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology, // NEW! @@ -236,6 +238,7 @@ fn create_render_pipeline( // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + cache: None, }) } @@ -272,6 +275,7 @@ impl<'a> State<'a> { required_features: wgpu::Features::empty(), // UPDATED! required_limits: wgpu::Limits::downlevel_defaults(), + memory_hints: Default::default(), }, None, // Trace path ) diff --git a/code/intermediate/tutorial13-hdr/src/model.rs b/code/intermediate/tutorial13-hdr/src/model.rs index 60e9c93b7..2cd143d41 100644 --- a/code/intermediate/tutorial13-hdr/src/model.rs +++ b/code/intermediate/tutorial13-hdr/src/model.rs @@ -55,8 +55,11 @@ impl Vertex for ModelVertex { } pub struct Material { + #[allow(unused)] pub name: String, + #[allow(unused)] pub diffuse_texture: texture::Texture, + #[allow(unused)] pub normal_texture: texture::Texture, pub bind_group: wgpu::BindGroup, } @@ -102,6 +105,7 @@ impl Material { } pub struct Mesh { + #[allow(unused)] pub name: String, pub vertex_buffer: wgpu::Buffer, pub index_buffer: wgpu::Buffer, @@ -115,6 +119,7 @@ pub struct Model { } pub trait DrawModel<'a> { + #[allow(unused)] fn draw_mesh( &mut self, mesh: &'a Mesh, @@ -133,6 +138,7 @@ pub trait DrawModel<'a> { environment_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model( &mut self, model: &'a Model, @@ -148,6 +154,7 @@ pub trait DrawModel<'a> { light_bind_group: &'a wgpu::BindGroup, environment_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model_instanced_with_material( &mut self, model: &'a Model, @@ -259,6 +266,7 @@ where } pub trait DrawLight<'a> { + #[allow(unused)] fn draw_light_mesh( &mut self, mesh: &'a Mesh, diff --git a/code/intermediate/tutorial13-hdr/src/resources.rs b/code/intermediate/tutorial13-hdr/src/resources.rs index d0809c31f..c1223629f 100644 --- a/code/intermediate/tutorial13-hdr/src/resources.rs +++ b/code/intermediate/tutorial13-hdr/src/resources.rs @@ -267,6 +267,8 @@ impl HdrLoader { layout: Some(&pipeline_layout), module: &module, entry_point: "compute_equirect_to_cubemap", + compilation_options: Default::default(), + cache: None, }); Self { diff --git a/code/intermediate/tutorial13-hdr/src/texture.rs b/code/intermediate/tutorial13-hdr/src/texture.rs index 929aedb3b..09f9f4a95 100644 --- a/code/intermediate/tutorial13-hdr/src/texture.rs +++ b/code/intermediate/tutorial13-hdr/src/texture.rs @@ -2,6 +2,7 @@ use anyhow::*; use image::GenericImageView; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/code/intermediate/wip-terrain/Cargo.toml b/code/intermediate/wip-terrain/Cargo.toml index 4c8f0811d..6bbb35cd4 100644 --- a/code/intermediate/wip-terrain/Cargo.toml +++ b/code/intermediate/wip-terrain/Cargo.toml @@ -10,13 +10,13 @@ crate-type = ["cdylib", "rlib"] [dependencies] cfg-if = "1" anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = { version = "0.18", features = [ "swizzle" ] } env_logger = "0.10" pollster = "0.3" log = "0.4" tobj = { version = "3.2", features = ["async"]} -wgpu = { version = "0.19"} +wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } instant = "0.1" @@ -29,7 +29,7 @@ features = ["png", "jpeg"] reqwest = { version = "0.11" } console_error_panic_hook = "0.1" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/intermediate/wip-terrain/src/bindgroups.rs b/code/intermediate/wip-terrain/src/bindgroups.rs index e344bbfac..a8e6737f8 100644 --- a/code/intermediate/wip-terrain/src/bindgroups.rs +++ b/code/intermediate/wip-terrain/src/bindgroups.rs @@ -1,5 +1,6 @@ use std::marker::PhantomData; +#[allow(unused)] pub struct Binder { layout: wgpu::BindGroupLayout, _marker: PhantomData, diff --git a/code/intermediate/wip-terrain/src/lib.rs b/code/intermediate/wip-terrain/src/lib.rs index bbff2868f..d8a6d11eb 100644 --- a/code/intermediate/wip-terrain/src/lib.rs +++ b/code/intermediate/wip-terrain/src/lib.rs @@ -178,6 +178,7 @@ fn create_render_pipeline( module: &shader, entry_point: "vs_main", buffers: vertex_layouts, + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -190,6 +191,7 @@ fn create_render_pipeline( }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -218,6 +220,7 @@ fn create_render_pipeline( // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + cache: None, }) } @@ -257,6 +260,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) diff --git a/code/intermediate/wip-terrain/src/model.rs b/code/intermediate/wip-terrain/src/model.rs index 15e343d65..a8c14b271 100644 --- a/code/intermediate/wip-terrain/src/model.rs +++ b/code/intermediate/wip-terrain/src/model.rs @@ -55,8 +55,11 @@ impl Vertex for ModelVertex { } pub struct Material { + #[allow(unused)] pub name: String, + #[allow(unused)] pub diffuse_texture: texture::Texture, + #[allow(unused)] pub normal_texture: texture::Texture, pub bind_group: wgpu::BindGroup, } @@ -102,6 +105,7 @@ impl Material { } pub struct Mesh { + #[allow(unused)] pub name: String, pub vertex_buffer: wgpu::Buffer, pub index_buffer: wgpu::Buffer, @@ -116,6 +120,7 @@ pub struct Model { } pub trait DrawModel<'a> { + #[allow(unused)] fn draw_mesh( &mut self, mesh: &'a Mesh, @@ -132,6 +137,7 @@ pub trait DrawModel<'a> { light_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model( &mut self, model: &'a Model, @@ -145,6 +151,7 @@ pub trait DrawModel<'a> { camera_bind_group: &'a wgpu::BindGroup, light_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model_instanced_with_material( &mut self, model: &'a Model, @@ -234,6 +241,7 @@ where } pub trait DrawLight<'a> { + #[allow(unused)] fn draw_light_mesh( &mut self, mesh: &'a Mesh, diff --git a/code/intermediate/wip-terrain/src/terrain.rs b/code/intermediate/wip-terrain/src/terrain.rs index ea8b83973..fe0cbaddf 100644 --- a/code/intermediate/wip-terrain/src/terrain.rs +++ b/code/intermediate/wip-terrain/src/terrain.rs @@ -12,7 +12,9 @@ struct ChunkData { pub struct Terrain { chunks: Vec, + #[allow(unused)] chunk_size: cgmath::Vector2, + #[allow(unused)] min_max_height: cgmath::Vector2, } @@ -127,6 +129,8 @@ impl TerrainPipeline { layout: Some(&pipeline_layout), module: &shader, entry_point: "gen_terrain_compute", + compilation_options: Default::default(), + cache: None, }); let render_pipeline_layout = @@ -291,6 +295,7 @@ impl GenerateChunk for TerrainPipeline { #[repr(C)] #[derive(Debug, Clone, Copy, bytemuck::Pod, bytemuck::Zeroable)] +#[allow(unused)] struct GenData { chunk_size: [u32; 2], chunk_corner: [i32; 2], @@ -302,6 +307,7 @@ struct GenData { } impl GenData { + #[allow(unused)] pub fn new( texture_size: u32, start_index: u32, diff --git a/code/intermediate/wip-terrain/src/texture.rs b/code/intermediate/wip-terrain/src/texture.rs index 5b5097930..4368d4d90 100644 --- a/code/intermediate/wip-terrain/src/texture.rs +++ b/code/intermediate/wip-terrain/src/texture.rs @@ -3,6 +3,7 @@ use image::GenericImageView; use wgpu::AddressMode; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/code/showcase/compute/Cargo.toml b/code/showcase/compute/Cargo.toml index aade00124..b1ad630a9 100644 --- a/code/showcase/compute/Cargo.toml +++ b/code/showcase/compute/Cargo.toml @@ -14,7 +14,7 @@ image = "0.24" log = "0.4" rayon = "1.4" tobj = "2.0" -wgpu = "0.19" +wgpu = "22.0" winit = { version = "0.29", features = ["rwh_05"] } [build-dependencies] diff --git a/code/showcase/compute/src/main.rs b/code/showcase/compute/src/main.rs index cb9069f52..0199401f5 100644 --- a/code/showcase/compute/src/main.rs +++ b/code/showcase/compute/src/main.rs @@ -195,6 +195,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) diff --git a/code/showcase/compute/src/model.rs b/code/showcase/compute/src/model.rs index 2c0fbc35b..947c0506c 100644 --- a/code/showcase/compute/src/model.rs +++ b/code/showcase/compute/src/model.rs @@ -65,8 +65,11 @@ impl Vertex for ModelVertex { } pub struct Material { + #[allow(unused)] pub name: String, + #[allow(unused)] pub diffuse_texture: texture::Texture, + #[allow(unused)] pub normal_texture: texture::Texture, pub bind_group: wgpu::BindGroup, } @@ -112,6 +115,7 @@ impl Material { } pub struct Mesh { + #[allow(unused)] pub name: String, pub vertex_buffer: wgpu::Buffer, pub index_buffer: wgpu::Buffer, @@ -389,6 +393,7 @@ impl ModelLoader { } pub trait DrawModel<'a> { + #[allow(unused)] fn draw_mesh( &mut self, mesh: &'a Mesh, @@ -405,6 +410,7 @@ pub trait DrawModel<'a> { light_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model( &mut self, model: &'a Model, @@ -418,6 +424,7 @@ pub trait DrawModel<'a> { camera_bind_group: &'a wgpu::BindGroup, light_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model_instanced_with_material( &mut self, model: &'a Model, @@ -507,6 +514,7 @@ where } pub trait DrawLight<'a> { + #[allow(unused)] fn draw_light_mesh( &mut self, mesh: &'a Mesh, diff --git a/code/showcase/compute/src/pipeline.rs b/code/showcase/compute/src/pipeline.rs index a55df984e..047183b57 100644 --- a/code/showcase/compute/src/pipeline.rs +++ b/code/showcase/compute/src/pipeline.rs @@ -55,6 +55,7 @@ pub fn create_render_pipeline( module: &vs_module, entry_point: "main", buffers: vertex_layouts, + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &fs_module, @@ -64,6 +65,7 @@ pub fn create_render_pipeline( blend: None, write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -90,6 +92,7 @@ pub fn create_render_pipeline( // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + cache: None, }) } @@ -109,6 +112,8 @@ pub fn create_compute_pipeline( layout: Some(&layout), module: &device.create_shader_module(shader_src), entry_point: "main", + cache: None, + compilation_options: Default::default(), }); pipeline } diff --git a/code/showcase/compute/src/texture.rs b/code/showcase/compute/src/texture.rs index bfd5802bf..e4714949d 100644 --- a/code/showcase/compute/src/texture.rs +++ b/code/showcase/compute/src/texture.rs @@ -3,6 +3,7 @@ use image::GenericImageView; use std::path::Path; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/code/showcase/framework/Cargo.toml b/code/showcase/framework/Cargo.toml index c27902f13..f9b62f3dd 100644 --- a/code/showcase/framework/Cargo.toml +++ b/code/showcase/framework/Cargo.toml @@ -7,14 +7,14 @@ edition = "2018" [dependencies] anyhow = "1.0" thiserror = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = "0.18" env_logger = "0.10" pollster = "0.3" image = "0.24.2" log = "0.4" tobj = "2.0" -wgpu = "0.19" +wgpu = "22.0" wgpu-subscriber = "0.1" winit = { version = "0.29", features = ["rwh_05"] } diff --git a/code/showcase/framework/src/lib.rs b/code/showcase/framework/src/lib.rs index 673613f47..4a8aa8202 100644 --- a/code/showcase/framework/src/lib.rs +++ b/code/showcase/framework/src/lib.rs @@ -63,6 +63,7 @@ impl<'a> Display<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, ) diff --git a/code/showcase/framework/src/pipeline.rs b/code/showcase/framework/src/pipeline.rs index a278c5880..b259e769c 100644 --- a/code/showcase/framework/src/pipeline.rs +++ b/code/showcase/framework/src/pipeline.rs @@ -218,11 +218,13 @@ impl<'a> RenderPipelineBuilder<'a> { module: &vs, entry_point: "main", buffers: &self.vertex_buffers, + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &fs, entry_point: "main", targets: &self.color_states, + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: self.primitive_topology, @@ -239,6 +241,7 @@ impl<'a> RenderPipelineBuilder<'a> { alpha_to_coverage_enabled: self.alpha_to_coverage_enabled, }, multiview: self.multiview, + cache: None, }); Ok(pipeline) } diff --git a/code/showcase/framework/src/shader_canvas.rs b/code/showcase/framework/src/shader_canvas.rs index 898b93862..2752e4601 100644 --- a/code/showcase/framework/src/shader_canvas.rs +++ b/code/showcase/framework/src/shader_canvas.rs @@ -211,6 +211,7 @@ impl<'a> ShaderCanvasBuilder<'a> { entry_point: "main", module: &vert_module, buffers: &[], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { entry_point: "main", @@ -223,6 +224,7 @@ impl<'a> ShaderCanvasBuilder<'a> { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -246,6 +248,8 @@ impl<'a> ShaderCanvasBuilder<'a> { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + // Useful for optimizing shader compilation on Android + cache: None, }); Ok(ShaderCanvas { diff --git a/code/showcase/gifs/Cargo.toml b/code/showcase/gifs/Cargo.toml index 431947cdd..6d2fef174 100644 --- a/code/showcase/gifs/Cargo.toml +++ b/code/showcase/gifs/Cargo.toml @@ -7,14 +7,14 @@ edition = "2018" [dependencies] anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = "0.18" env_logger = "0.10" pollster = "0.3" image = "0.24.2" log = "0.4" tobj = "3.1" -wgpu = "0.19" +wgpu = "22.0" winit = { version = "0.29", features = ["rwh_05"] } gif = "0.11.4" futures-intrusive = "0.4" diff --git a/code/showcase/gifs/src/main.rs b/code/showcase/gifs/src/main.rs index b2bbbad12..8aa73b1fd 100644 --- a/code/showcase/gifs/src/main.rs +++ b/code/showcase/gifs/src/main.rs @@ -24,6 +24,7 @@ async fn run() { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) @@ -199,6 +200,7 @@ fn create_render_pipeline( module: &shader, entry_point: "vs_main", buffers: &[], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -208,6 +210,7 @@ fn create_render_pipeline( blend: Some(wgpu::BlendState::REPLACE), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -230,6 +233,7 @@ fn create_render_pipeline( // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + cache: None, }); render_pipeline diff --git a/code/showcase/imgui-demo/Cargo.toml b/code/showcase/imgui-demo/Cargo.toml index 214061827..d92e16912 100644 --- a/code/showcase/imgui-demo/Cargo.toml +++ b/code/showcase/imgui-demo/Cargo.toml @@ -8,9 +8,9 @@ edition = "2018" [dependencies] anyhow = "1.0" -wgpu = "0.19" +wgpu = "22.0" pollster = "0.3" imgui = "0.7" -imgui-wgpu = "0.19" +imgui-wgpu = "22.0" imgui-winit-support = "0.7" framework = { path = "../framework" } \ No newline at end of file diff --git a/code/showcase/mouse-picking/Cargo.toml b/code/showcase/mouse-picking/Cargo.toml index 8a22f68fa..989f434d8 100644 --- a/code/showcase/mouse-picking/Cargo.toml +++ b/code/showcase/mouse-picking/Cargo.toml @@ -10,13 +10,13 @@ crate-type = ["cdylib", "rlib"] [dependencies] cfg-if = "1" anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" tobj = { version = "3.2", features = ["async"]} -wgpu = { version = "0.19"} +wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } instant = "0.1" @@ -29,7 +29,7 @@ features = ["png", "jpeg"] reqwest = { version = "0.11" } console_error_panic_hook = "0.1" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/showcase/mouse-picking/src/lib.rs b/code/showcase/mouse-picking/src/lib.rs index 0f6b4d53e..0d641b1fe 100644 --- a/code/showcase/mouse-picking/src/lib.rs +++ b/code/showcase/mouse-picking/src/lib.rs @@ -182,6 +182,7 @@ fn create_render_pipeline( module: &shader, entry_point: "vs_main", buffers: vertex_layouts, + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -194,6 +195,7 @@ fn create_render_pipeline( }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -222,6 +224,7 @@ fn create_render_pipeline( // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + cache: None, }) } @@ -261,6 +264,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) diff --git a/code/showcase/mouse-picking/src/math.rs b/code/showcase/mouse-picking/src/math.rs index 12d367665..33520a5b1 100644 --- a/code/showcase/mouse-picking/src/math.rs +++ b/code/showcase/mouse-picking/src/math.rs @@ -1,9 +1,5 @@ use cgmath::InnerSpace; -fn vmul(a: cgmath::Vector3, b: cgmath::Vector3) -> cgmath::Vector3 { - cgmath::Vector3::new(a.x * b.x, a.y * b.y, a.z * b.z) -} - pub struct BoundingBox { pub min: cgmath::Vector3, pub max: cgmath::Vector3, diff --git a/code/showcase/mouse-picking/src/model.rs b/code/showcase/mouse-picking/src/model.rs index 41f9af728..8953ead4c 100644 --- a/code/showcase/mouse-picking/src/model.rs +++ b/code/showcase/mouse-picking/src/model.rs @@ -55,8 +55,11 @@ impl Vertex for ModelVertex { } pub struct Material { + #[allow(unused)] pub name: String, + #[allow(unused)] pub diffuse_texture: texture::Texture, + #[allow(unused)] pub normal_texture: texture::Texture, pub bind_group: wgpu::BindGroup, } @@ -102,6 +105,7 @@ impl Material { } pub struct Mesh { + #[allow(unused)] pub name: String, pub vertex_buffer: wgpu::Buffer, pub index_buffer: wgpu::Buffer, @@ -119,6 +123,7 @@ pub struct Model { } pub trait DrawModel<'a> { + #[allow(unused)] fn draw_mesh( &mut self, mesh: &'a Mesh, @@ -135,6 +140,7 @@ pub trait DrawModel<'a> { light_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model( &mut self, model: &'a Model, @@ -148,6 +154,7 @@ pub trait DrawModel<'a> { camera_bind_group: &'a wgpu::BindGroup, light_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model_instanced_with_material( &mut self, model: &'a Model, @@ -237,6 +244,7 @@ where } pub trait DrawLight<'a> { + #[allow(unused)] fn draw_light_mesh( &mut self, mesh: &'a Mesh, diff --git a/code/showcase/mouse-picking/src/texture.rs b/code/showcase/mouse-picking/src/texture.rs index 5790af271..c72736adb 100644 --- a/code/showcase/mouse-picking/src/texture.rs +++ b/code/showcase/mouse-picking/src/texture.rs @@ -2,6 +2,7 @@ use anyhow::*; use image::GenericImageView; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/code/showcase/pong/Cargo.toml b/code/showcase/pong/Cargo.toml index 4d1e78b1d..0be793e0e 100644 --- a/code/showcase/pong/Cargo.toml +++ b/code/showcase/pong/Cargo.toml @@ -12,10 +12,10 @@ cfg-if = "1" env_logger = "0.10" winit = { version = "0.29", features = ["rwh_05"] } anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = "0.18" pollster = "0.3" -wgpu = { version = "0.19", features = ["spirv"]} +wgpu = { version = "22.0", features = ["spirv"]} wgpu_glyph = { version = "0.22", git = "https://github.com/hecrj/wgpu_glyph.git" } rand = "0.8" rodio = { version = "0.16", default-features = false, features = ["wav"] } @@ -34,7 +34,7 @@ web-sys = { version = "0.3", features = [ "Window", "Element", ]} -wgpu = { version = "0.19", features = ["spirv", "webgl"]} +wgpu = { version = "22.0", features = ["spirv", "webgl"]} [build-dependencies] anyhow = "1.0" diff --git a/code/showcase/pong/src/render/mod.rs b/code/showcase/pong/src/render/mod.rs index 0b2b0ad0a..3f96ff39c 100644 --- a/code/showcase/pong/src/render/mod.rs +++ b/code/showcase/pong/src/render/mod.rs @@ -276,6 +276,7 @@ fn create_render_pipeline( module: &vs_module, entry_point: "main", buffers: &vertex_layouts, + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &fs_module, @@ -288,6 +289,7 @@ fn create_render_pipeline( }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -310,5 +312,6 @@ fn create_render_pipeline( // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + cache: None, }) } diff --git a/code/showcase/pong/src/state.rs b/code/showcase/pong/src/state.rs index 1744a9b5b..4820b6f56 100644 --- a/code/showcase/pong/src/state.rs +++ b/code/showcase/pong/src/state.rs @@ -87,6 +87,7 @@ pub enum Event { ButtonPressed, FocusChanged, BallBounce(cgmath::Vector2), + #[allow(unused)] Score(u32), Resize(f32, f32), } diff --git a/code/showcase/snow/Cargo.toml b/code/showcase/snow/Cargo.toml index 14fd02a14..d2d9eab94 100644 --- a/code/showcase/snow/Cargo.toml +++ b/code/showcase/snow/Cargo.toml @@ -11,5 +11,5 @@ bytemuck = { version = "1.13.1", features = ["derive"] } framework = { version = "0.1", path = "../framework"} glam = { version = "0.24.1", features = ["bytemuck"] } pollster = "0.3.0" -wgpu = "0.19" +wgpu = "22.0" winit = { version = "0.29", features = ["rwh_05"] } diff --git a/code/showcase/snow/src/camera.rs b/code/showcase/snow/src/camera.rs index 77c5cb7c0..841bcfa5a 100644 --- a/code/showcase/snow/src/camera.rs +++ b/code/showcase/snow/src/camera.rs @@ -126,6 +126,7 @@ impl CameraController { self.rotate_vertical = mouse_dy as f32; } + #[allow(unused)] pub fn process_scroll(&mut self, delta: &MouseScrollDelta) { self.scroll = match delta { // I'm assuming a line is about 100 pixels diff --git a/code/showcase/snow/src/main.rs b/code/showcase/snow/src/main.rs index ae4ece984..73a36129c 100644 --- a/code/showcase/snow/src/main.rs +++ b/code/showcase/snow/src/main.rs @@ -153,6 +153,8 @@ impl framework::Demo for Snow { layout: Some(&move_pipeline_layout), module: &shader, entry_point: "move_particles", + compilation_options: Default::default(), + cache: None, }); let camera = Camera::new(glam::vec3(0.0, 0.0, 0.0), 0.0, 0.0); @@ -221,6 +223,7 @@ impl framework::Demo for Snow { module: &shader, entry_point: "vs_main", buffers: &[PARTICLE_LAYOUT], + compilation_options: Default::default(), }, primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::PointList, @@ -236,8 +239,11 @@ impl framework::Demo for Snow { blend: Some(wgpu::BlendState::REPLACE), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), + }), multiview: None, + cache: None, }); Ok(Self { diff --git a/code/showcase/threading/Cargo.toml b/code/showcase/threading/Cargo.toml index 4c7b47cb3..54117e1b1 100644 --- a/code/showcase/threading/Cargo.toml +++ b/code/showcase/threading/Cargo.toml @@ -10,14 +10,14 @@ crate-type = ["cdylib", "rlib"] [dependencies] cfg-if = "1" anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = "0.18" env_logger = "0.10" pollster = "0.3" log = "0.4" rayon = "1.4" # NEW! tobj = { version = "3.2", features = ["async"]} -wgpu = { version = "0.19"} +wgpu = { version = "22.0"} winit = { version = "0.29", features = ["rwh_05"] } instant = "0.1" async-std = "1" @@ -31,7 +31,7 @@ features = ["png", "jpeg"] reqwest = { version = "0.11" } console_error_panic_hook = "0.1" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/code/showcase/threading/src/lib.rs b/code/showcase/threading/src/lib.rs index da5de2719..e13850805 100644 --- a/code/showcase/threading/src/lib.rs +++ b/code/showcase/threading/src/lib.rs @@ -176,6 +176,7 @@ fn create_render_pipeline( module: &shader, entry_point: "vs_main", buffers: vertex_layouts, + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -188,6 +189,7 @@ fn create_render_pipeline( }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -216,6 +218,7 @@ fn create_render_pipeline( // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + cache: None, }) } @@ -255,6 +258,7 @@ impl<'a> State<'a> { } else { wgpu::Limits::default() }, + memory_hints: Default::default(), }, None, // Trace path ) diff --git a/code/showcase/threading/src/model.rs b/code/showcase/threading/src/model.rs index e3ec0e61c..b62892c0e 100644 --- a/code/showcase/threading/src/model.rs +++ b/code/showcase/threading/src/model.rs @@ -55,8 +55,11 @@ impl Vertex for ModelVertex { } pub struct Material { + #[allow(unused)] pub name: String, + #[allow(unused)] pub diffuse_texture: texture::Texture, + #[allow(unused)] pub normal_texture: texture::Texture, pub bind_group: wgpu::BindGroup, } @@ -102,6 +105,7 @@ impl Material { } pub struct Mesh { + #[allow(unused)] pub name: String, pub vertex_buffer: wgpu::Buffer, pub index_buffer: wgpu::Buffer, @@ -115,6 +119,7 @@ pub struct Model { } pub trait DrawModel<'a> { + #[allow(unused)] fn draw_mesh( &mut self, mesh: &'a Mesh, @@ -131,6 +136,7 @@ pub trait DrawModel<'a> { light_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model( &mut self, model: &'a Model, @@ -144,6 +150,7 @@ pub trait DrawModel<'a> { camera_bind_group: &'a wgpu::BindGroup, light_bind_group: &'a wgpu::BindGroup, ); + #[allow(unused)] fn draw_model_instanced_with_material( &mut self, model: &'a Model, @@ -233,6 +240,7 @@ where } pub trait DrawLight<'a> { + #[allow(unused)] fn draw_light_mesh( &mut self, mesh: &'a Mesh, diff --git a/code/showcase/threading/src/texture.rs b/code/showcase/threading/src/texture.rs index 5790af271..c72736adb 100644 --- a/code/showcase/threading/src/texture.rs +++ b/code/showcase/threading/src/texture.rs @@ -2,6 +2,7 @@ use anyhow::*; use image::GenericImageView; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/code/showcase/windowless/Cargo.toml b/code/showcase/windowless/Cargo.toml index 4492cfb2e..07d85353b 100644 --- a/code/showcase/windowless/Cargo.toml +++ b/code/showcase/windowless/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" [dependencies] image = "0.24" shaderc = "0.8" -wgpu = { version = "0.19", features = ["spirv"] } +wgpu = { version = "22.0", features = ["spirv"] } pollster = "0.3" futures-intrusive = "0.4" diff --git a/code/showcase/windowless/src/main.rs b/code/showcase/windowless/src/main.rs index a2a4dd2b9..af0a9b7f2 100644 --- a/code/showcase/windowless/src/main.rs +++ b/code/showcase/windowless/src/main.rs @@ -93,6 +93,7 @@ async fn run() { module: &vs_module, entry_point: "main", buffers: &[], + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &fs_module, @@ -105,6 +106,7 @@ async fn run() { }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, @@ -127,6 +129,7 @@ async fn run() { // If the pipeline will be used with a multiview render pass, this // indicates how many array layers the attachments will have. multiview: None, + cache: None, }); let mut encoder = diff --git a/code/wasm-builder/src/main.rs b/code/wasm-builder/src/main.rs index 24a87bf70..c2ac647c0 100644 --- a/code/wasm-builder/src/main.rs +++ b/code/wasm-builder/src/main.rs @@ -1,6 +1,6 @@ use std::{ path::PathBuf, - process::{Command, ExitStatus}, + process::Command, }; use anyhow::bail; diff --git a/docs/README.md b/docs/README.md index e01e92705..95bda8541 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,11 +1,13 @@ # Introduction ## What is wgpu? + [Wgpu](https://github.com/gfx-rs/wgpu) is a Rust implementation of the [WebGPU API spec](https://gpuweb.github.io/gpuweb/). WebGPU is a specification published by the GPU for the Web Community Group. It aims to allow web code access to GPU functions in a safe and reliable manner. It does this by mimicking the Vulkan API, and translating that down to whatever API the host hardware is using (ie. DirectX, Metal, Vulkan). Wgpu is still in development, so some of this doc is subject to change. ## Why Rust? + Wgpu actually has C bindings to allow you to write C/C++ code with it, as well as use other languages that interface with C. That being said, wgpu is written in Rust, and it has some convenient Rust bindings that don't have to jump through any hoops. On top of that, I've been enjoying writing in Rust. You should be fairly familiar with Rust before using this tutorial as I won't go into much detail on Rust syntax. If you're not super comfortable with Rust you can review the [Rust tutorial](https://www.rust-lang.org/learn). You should also be familiar with [Cargo](https://doc.rust-lang.org/cargo/). @@ -22,23 +24,41 @@ I'm using this project to learn wgpu myself, so I might miss some important deta * [中文版: 增加了与 App 的集成与调试系列章节](https://jinleili.github.io/learn-wgpu-zh/) -## Special thanks to these patrons! - -- David Laban -- Lennart -- Ian Gowen -- Aron Granberg -- Bernard Llanos -- Jan Šipr -- Zeh Fernando -- Youngsuk Kim -- オリトイツキ -- Andrea Postal -- Julius Liu -- Feng Liang -- Mattia Samiolo -- Joris Willems -- Jani Turkia -- papyDoctor -- Filip +## Special thanks to these patrons +* David Laban +* yutani +* Gunstein Vatnar +* Lennart +* Paul E Hansen +* Eliot Bolduc +* Ian Gowen +* Ben Anderson +* Aron Granberg +* Ken K +* Bernard Llanos +* Danny McGee +* Thunk +* Zeh Fernando +* Craft Links +* Felix +* Youngsuk Kim +* Tema +* オリトイツキ +* Andrea Postal +* Davide Prati +* 大典 加藤 +* charlesk +* Julius Liu +* Feng Liang +* dadofboi +* Mattia Samiolo +* Jani Turkia +* papyDoctor +* Filip +* Alexander Kabirov +* Nico Arbogast +* Dude +* Georeth Zhow +* Lions Heart +* Ryan diff --git a/docs/beginner/tutorial1-window/README.md b/docs/beginner/tutorial1-window/README.md index 4d2003c25..f10a718f4 100644 --- a/docs/beginner/tutorial1-window/README.md +++ b/docs/beginner/tutorial1-window/README.md @@ -13,9 +13,19 @@ For the beginner stuff, we're going to keep things very simple. We'll add things winit = { version = "0.29", features = ["rwh_05"] } env_logger = "0.10" log = "0.4" -wgpu = "0.19.3" +wgpu = "22.0" ``` +
+ +Note that we are using version `0.29` of winit. This is not the most recent version. +The reason for this is version `0.30` and beyond include breaking changes that will +require a lot of code changes. I've created a local branch to mess around with it, but +there's a work around on the [tracking issue](https://github.com/sotrh/learn-wgpu/issues/549) +if you absolutely need the latest version of winit. + +
+ ## Using Rust's new resolver As of version 0.10, wgpu requires Cargo's [newest feature resolver](https://doc.rust-lang.org/cargo/reference/resolver.html#feature-resolver-version-2), which is the default in the 2021 edition (any new project started with Rust version 1.56.0 or newer). However, if you are still using the 2018 edition, you must include `resolver = "2"` in either the `[package]` section of `Cargo.toml` if you are working on a single crate or the `[workspace]` section of the root `Cargo.toml` in a workspace. @@ -117,7 +127,7 @@ cfg-if = "1" [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1.6" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4.30" web-sys = { version = "0.3", features = [ diff --git a/docs/beginner/tutorial2-surface/README.md b/docs/beginner/tutorial2-surface/README.md index ffed883c4..041381b5b 100644 --- a/docs/beginner/tutorial2-surface/README.md +++ b/docs/beginner/tutorial2-surface/README.md @@ -287,13 +287,13 @@ cfg-if = "1" winit = { version = "0.29", features = ["rwh_05"] } env_logger = "0.10" log = "0.4" -wgpu = "0.19" +wgpu = "22.0" pollster = "0.3" [target.'cfg(target_arch = "wasm32")'.dependencies] console_error_panic_hook = "0.1.6" console_log = "1.0" -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/docs/beginner/tutorial3-pipeline/README.md b/docs/beginner/tutorial3-pipeline/README.md index 6c4747a65..7ff49ddd7 100644 --- a/docs/beginner/tutorial3-pipeline/README.md +++ b/docs/beginner/tutorial3-pipeline/README.md @@ -1,12 +1,15 @@ # The Pipeline ## What's a pipeline? + If you're familiar with OpenGL, you may remember using shader programs. You can think of a pipeline as a more robust version of that. A pipeline describes all the actions the GPU will perform when acting on a set of data. In this section, we will be creating a `RenderPipeline` specifically. ## Wait, shaders? + Shaders are mini-programs that you send to the GPU to perform operations on your data. There are three main types of shaders: vertex, fragment, and compute. There are others, such as geometry shaders or tesselation shaders, but they're not supported by WebGL. They should be avoided in general ([see discussions](https://community.khronos.org/t/does-the-use-of-geometric-shaders-significantly-reduce-performance/106326)). For now, we're just going to use vertex and fragment shaders. ## Vertex, fragment... what are those? + A vertex is a point in 3D space (can also be 2D). These vertices are then bundled in groups of 2s to form lines and/or 3s to form triangles. Vertices Graphic @@ -41,6 +44,7 @@ The WGSL spec and its inclusion in WGPU are still in development. If you run int ## Writing the shaders + In the same folder as `main.rs`, create a file `shader.wgsl`. Write the following code in `shader.wgsl`. ```wgsl @@ -152,6 +156,7 @@ fn vs_main( ## How do we use the shaders? + This is the part where we finally make the thing in the title: the pipeline. First, let's modify `State` to include the following. ```rust @@ -186,7 +191,6 @@ let shader = device.create_shader_module(wgpu::include_wgsl!("shader.wgsl")); - One more thing, we need to create a `PipelineLayout`. We'll get more into this after we cover `Buffer`s. ```rust @@ -224,6 +228,7 @@ let render_pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescrip ``` Several things to note here: + 1. Here you can specify which function inside the shader should be the `entry_point`. These are the functions we marked with `@vertex` and `@fragment` 2. The `buffers` field tells `wgpu` what type of vertices we want to pass to the vertex shader. We're specifying the vertices in the vertex shader itself, so we'll leave this empty. We'll put something there in the next tutorial. 3. The `fragment` is technically optional, so you have to wrap it in `Some()`. We need it if we want to store color data to the `surface`. @@ -258,15 +263,18 @@ The `primitive` field describes how to interpret our vertices when converting th alpha_to_coverage_enabled: false, // 4. }, multiview: None, // 5. + cache: None, // 6. }); ``` The rest of the method is pretty simple: + 1. We're not using a depth/stencil buffer currently, so we leave `depth_stencil` as `None`. *This will change later*. 2. `count` determines how many samples the pipeline will use. Multisampling is a complex topic, so we won't get into it here. 3. `mask` specifies which samples should be active. In this case, we are using all of them. 4. `alpha_to_coverage_enabled` has to do with anti-aliasing. We're not covering anti-aliasing here, so we'll leave this as false now. 5. `multiview` indicates how many array layers the render attachments can have. We won't be rendering to array textures, so we can set this to `None`. +6. `cache` allows wgpu to cache shader compilation data. Only really useful for Android build targets. @@ -284,6 +292,7 @@ Self { render_pipeline, } ``` + ## Using a pipeline If you run your program now, it'll take a little longer to start, but it will still show the blue screen we got in the last section. That's because we created the `render_pipeline`, but we still need to modify the code in `render()` to actually use it. @@ -325,6 +334,7 @@ If you run your program now, it'll take a little longer to start, but it will st ``` We didn't change much, but let's talk about what we did change. + 1. We renamed `_render_pass` to `render_pass` and made it mutable. 2. We set the pipeline on the `render_pass` using the one we just created. 3. We tell `wgpu` to draw *something* with three vertices and one instance. This is where `@builtin(vertex_index)` comes from. @@ -333,10 +343,9 @@ With all that you should be seeing a lovely brown triangle. ![Said lovely brown triangle](./tutorial3-pipeline-triangle.png) - ## Challenge -Create a second pipeline that uses the triangle's position data to create a color that it then sends to the fragment shader. Have the app swap between these when you press the spacebar. *Hint: you'll need to modify* `VertexOutput` +Create a second pipeline that uses the triangle's position data to create a color that it then sends to the fragment shader. Have the app swap between these when you press the spacebar. *Hint: you'll need to modify* `VertexOutput` diff --git a/docs/beginner/tutorial4-buffer/README.md b/docs/beginner/tutorial4-buffer/README.md index b89c2a125..8cb6d14f4 100644 --- a/docs/beginner/tutorial4-buffer/README.md +++ b/docs/beginner/tutorial4-buffer/README.md @@ -76,7 +76,7 @@ use wgpu::util::DeviceExt; You'll note that we're using [bytemuck](https://docs.rs/bytemuck/latest/bytemuck/) to cast our `VERTICES` as a `&[u8]`. The `create_buffer_init()` method expects a `&[u8]`, and `bytemuck::cast_slice` does that for us. Add the following to your `Cargo.toml`. ```toml -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } ``` We're also going to need to implement two traits to get `bytemuck` to work. These are [bytemuck::Pod](https://docs.rs/bytemuck/latest/bytemuck/trait.Pod.html) and [bytemuck::Zeroable](https://docs.rs/bytemuck/latest/bytemuck/trait.Zeroable.html). `Pod` indicates that our `Vertex` is "Plain Old Data", and thus can be interpreted as a `&[u8]`. `Zeroable` indicates that we can use `std::mem::zeroed()`. We can modify our `Vertex` struct to derive these methods. diff --git a/docs/beginner/tutorial5-textures/README.md b/docs/beginner/tutorial5-textures/README.md index 4432f7d22..86e02730b 100644 --- a/docs/beginner/tutorial5-textures/README.md +++ b/docs/beginner/tutorial5-textures/README.md @@ -450,8 +450,8 @@ winit = { version = "0.29", features = ["rwh_05"] } env_logger = "0.10" log = "0.4" pollster = "0.3" -wgpu = "0.19" -bytemuck = { version = "1.12", features = [ "derive" ] } +wgpu = "22.0" +bytemuck = { version = "1.16", features = [ "derive" ] } anyhow = "1.0" # NEW! ``` @@ -462,6 +462,7 @@ use image::GenericImageView; use anyhow::*; pub struct Texture { + #[allow(unused)] pub texture: wgpu::Texture, pub view: wgpu::TextureView, pub sampler: wgpu::Sampler, diff --git a/docs/intermediate/tutorial10-lighting/README.md b/docs/intermediate/tutorial10-lighting/README.md index a660cea7d..72c8be919 100644 --- a/docs/intermediate/tutorial10-lighting/README.md +++ b/docs/intermediate/tutorial10-lighting/README.md @@ -142,6 +142,7 @@ fn create_render_pipeline( module: &shader, entry_point: "vs_main", buffers: vertex_layouts, + compilation_options: Default::default(), }, fragment: Some(wgpu::FragmentState { module: &shader, @@ -154,6 +155,7 @@ fn create_render_pipeline( }), write_mask: wgpu::ColorWrites::ALL, })], + compilation_options: Default::default(), }), primitive: wgpu::PrimitiveState { topology: wgpu::PrimitiveTopology::TriangleList, diff --git a/docs/intermediate/tutorial13-hdr/readme.md b/docs/intermediate/tutorial13-hdr/readme.md index 45cf08b7b..28421a887 100644 --- a/docs/intermediate/tutorial13-hdr/readme.md +++ b/docs/intermediate/tutorial13-hdr/readme.md @@ -492,7 +492,7 @@ You may have noted that we have switched from `downlevel_webgl2_defaults()` to ` Consequently, we are going to remove the WebGL feature from `Cargo.toml`. This line in particular: ```toml -wgpu = { version = "0.19", features = ["webgl"]} +wgpu = { version = "22.0", features = ["webgl"]} ``` @@ -548,6 +548,8 @@ impl HdrLoader { layout: Some(&pipeline_layout), module: &module, entry_point: "compute_equirect_to_cubemap", + compilation_options: Default::default(), + cache: None, }); Self { diff --git a/docs/news/0.16/readme.md b/docs/news/0.16/readme.md index abba4d84d..4c7b24f01 100644 --- a/docs/news/0.16/readme.md +++ b/docs/news/0.16/readme.md @@ -29,7 +29,7 @@ In other news WebGPU has been added to Chrome 113 and up! Currently the Linux ve reqwest = { version = "0.11" } console_error_panic_hook = "0.1" console_log = "1.0" -# wgpu = { version = "0.19", features = ["webgl"]} +# wgpu = { version = "22.0", features = ["webgl"]} wasm-bindgen = "0.2" wasm-bindgen-futures = "0.4" web-sys = { version = "0.3", features = [ diff --git a/docs/news/22.0/readme.md b/docs/news/22.0/readme.md new file mode 100644 index 000000000..88bc18921 --- /dev/null +++ b/docs/news/22.0/readme.md @@ -0,0 +1,17 @@ +# First Major Version! (22.0) + +Theres only a few things here. First all the shader related config +structs now have a `compilation_options` field. For now I'm just leaving +it as `Default::default()`, but if you have specific compilation +needs it's there for you. + +The next thing is `RenderPipelineDescriptor` and `ComputePipelineDescriptor` +now have a `cache` field. This allows you to supply a cache to use during +shader compilation. This is only really useful for Android devices as most +desktop hardware/drivers provide caching. I've left it as `None` for now. + +`DeviceDescriptor` now has a `memory_hint` field. You can use this to ask +the gpu to prioritize performance, memory usage, or allow you to request +a custom memory block size. These are just hints though and the hardware +has the final say in how to do things. I've left this as `Default::default()` +for now. diff --git a/docs/showcase/imgui-demo/README.md b/docs/showcase/imgui-demo/README.md index 12b67c73a..6ce93d86d 100644 --- a/docs/showcase/imgui-demo/README.md +++ b/docs/showcase/imgui-demo/README.md @@ -14,7 +14,7 @@ This is not an in-depth guide on how to use Imgui. But here are some of the basi ```toml imgui = "0.7" -imgui-wgpu = "0.19" +imgui-wgpu = "22.0" imgui-winit-support = "0.7" ``` diff --git a/docs/showcase/pong/README.md b/docs/showcase/pong/README.md index 6acaadb62..c5473229f 100644 --- a/docs/showcase/pong/README.md +++ b/docs/showcase/pong/README.md @@ -2,6 +2,15 @@ ![A screenshot of pong](./pong.png) +
+ +This example is not working as of `wgpu = "22.0"`. If the crate updates to +the latest version I'll switch it over, but given that the crate maintainer +is directing users to use [glypon](https://github.com/grovesNL/glyphon?tab=readme-ov-file) +I'm considering either switching to using that, or writing my own text code. + +
+ Practically the "Hello World!" of games. Pong has been remade thousands of times. I know Pong. You know Pong. We all know Pong. That being said, this time I wanted to put in a little more effort than most people do. This showcase has a basic menu system, sounds, and different game states. The architecture is not the best as I prescribed to the "get things done" mentality. If I were to redo this project, I'd change a lot of things. Regardless, let's get into the postmortem. @@ -265,10 +274,10 @@ cfg-if = "1" env_logger = "0.10" winit = { version = "0.29", features = ["rwh_05"] } anyhow = "1.0" -bytemuck = { version = "1.12", features = [ "derive" ] } +bytemuck = { version = "1.16", features = [ "derive" ] } cgmath = "0.18" pollster = "0.3" -wgpu = { version = "0.19", features = ["spirv"]} +wgpu = { version = "22.0", features = ["spirv"]} wgpu_glyph = "0.19" rand = "0.8" rodio = { version = "0.15", default-features = false, features = ["wav"] } @@ -287,7 +296,7 @@ web-sys = { version = "0.3", features = [ "Window", "Element", ]} -wgpu = { version = "0.19", features = ["spirv", "webgl"]} +wgpu = { version = "22.0", features = ["spirv", "webgl"]} [build-dependencies] anyhow = "1.0" @@ -387,6 +396,6 @@ Everything else works the same. A fun project to work on. It was overly architected, and kinda hard to make changes, but a good experience nonetheless. -Try the code down below! (Controls currently require a keyboard.) + \ No newline at end of file diff --git a/docs/showcase/windowless/README.md b/docs/showcase/windowless/README.md index 8f937d753..0141ff3a2 100644 --- a/docs/showcase/windowless/README.md +++ b/docs/showcase/windowless/README.md @@ -100,7 +100,7 @@ Update dependencies to support SPIR-V module. [dependencies] image = "0.23" shaderc = "0.7" -wgpu = { version = "0.19", features = ["spirv"] } +wgpu = { version = "22.0", features = ["spirv"] } pollster = "0.3" ``` diff --git a/wasm-targets.json b/wasm-targets.json index dd720410f..287d70e81 100644 --- a/wasm-targets.json +++ b/wasm-targets.json @@ -50,9 +50,5 @@ { "package": "tutorial13-hdr", "out": "docs/.vuepress/components/wasm/tutorial13_hdr" - }, - { - "package": "pong", - "out": "docs/.vuepress/components/wasm/pong" } ] \ No newline at end of file