From 7cc67f5678bb529075d43cbaa335f828647a4f6e Mon Sep 17 00:00:00 2001 From: Ben Hansen Date: Fri, 8 Oct 2021 18:40:29 -0600 Subject: [PATCH 1/3] migrated to 0.11 --- Cargo.lock | 629 ++---------------- Cargo.toml | 2 +- code/beginner/tutorial1-window/Cargo.toml | 2 +- code/beginner/tutorial2-surface/Cargo.toml | 4 +- .../tutorial2-surface/src/challenge.rs | 4 +- code/beginner/tutorial2-surface/src/main.rs | 4 +- code/beginner/tutorial3-pipeline/Cargo.toml | 2 +- .../tutorial3-pipeline/src/challenge.rs | 4 +- code/beginner/tutorial3-pipeline/src/main.rs | 4 +- code/beginner/tutorial4-buffer/Cargo.toml | 2 +- .../tutorial4-buffer/src/challenge.rs | 4 +- code/beginner/tutorial4-buffer/src/main.rs | 4 +- code/beginner/tutorial5-textures/Cargo.toml | 2 +- .../tutorial5-textures/src/challenge.rs | 4 +- code/beginner/tutorial5-textures/src/main.rs | 4 +- code/beginner/tutorial6-uniforms/Cargo.toml | 2 +- .../tutorial6-uniforms/src/challenge.rs | 4 +- code/beginner/tutorial6-uniforms/src/main.rs | 4 +- code/beginner/tutorial7-instancing/Cargo.toml | 2 +- .../tutorial7-instancing/src/challenge.rs | 4 +- .../beginner/tutorial7-instancing/src/main.rs | 4 +- code/beginner/tutorial8-depth/Cargo.toml | 2 +- .../beginner/tutorial8-depth/src/challenge.rs | 4 +- code/beginner/tutorial8-depth/src/main.rs | 4 +- code/beginner/tutorial9-models/Cargo.toml | 2 +- code/beginner/tutorial9-models/src/main.rs | 4 +- .../tutorial10-lighting/Cargo.toml | 2 +- .../tutorial10-lighting/src/main.rs | 4 +- .../tutorial11-normals/Cargo.toml | 2 +- .../tutorial11-normals/src/main.rs | 4 +- .../intermediate/tutorial12-camera/Cargo.toml | 2 +- .../tutorial12-camera/src/main.rs | 4 +- .../tutorial13-threading/Cargo.toml | 2 +- .../tutorial13-threading/src/main.rs | 4 +- code/showcase/compute/Cargo.toml | 4 +- code/showcase/compute/src/light.frag.wgsl | 8 +- code/showcase/compute/src/light.vert.wgsl | 24 +- code/showcase/compute/src/main.rs | 7 +- .../showcase/compute/src/model_load.comp.wgsl | 258 +++---- code/showcase/compute/src/shader.frag.wgsl | 114 ++-- code/showcase/compute/src/shader.vert.wgsl | 108 +-- code/showcase/framework/Cargo.toml | 2 +- code/showcase/framework/src/lib.rs | 1 + code/showcase/gifs/Cargo.toml | 2 +- code/showcase/imgui-demo/Cargo.toml | 2 +- code/showcase/imgui-demo/src/main.rs | 2 +- code/showcase/pong/Cargo.toml | 2 +- code/showcase/pong/src/render/mod.rs | 3 +- code/showcase/windowless/Cargo.toml | 2 +- code/showcase/windowless/src/main.rs | 1 + docs/beginner/tutorial1-window/README.md | 2 +- docs/beginner/tutorial2-surface/README.md | 18 +- docs/beginner/tutorial5-textures/README.md | 2 +- docs/news/README.md | 2 +- docs/showcase/imgui-demo/README.md | 2 +- docs/showcase/windowless/README.md | 2 +- 56 files changed, 404 insertions(+), 899 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 2c2358f2..767ecb4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,16 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ab_glyph" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af0ac006645f86f20f6c6fa4dcaef920bf803df819123626f9440e35835e7d80" -dependencies = [ - "ab_glyph_rasterizer", - "owned_ttf_parser 0.12.1", -] - [[package]] name = "ab_glyph_rasterizer" version = "0.1.4" @@ -60,28 +50,6 @@ dependencies = [ name = "alignment" version = "0.1.0" -[[package]] -name = "alsa" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75c4da790adcb2ce5e758c064b4f3ec17a30349f9961d3e5e6c9688b052a9e18" -dependencies = [ - "alsa-sys", - "bitflags", - "libc", - "nix 0.20.0", -] - -[[package]] -name = "alsa-sys" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" -dependencies = [ - "libc", - "pkg-config", -] - [[package]] name = "andrew" version = "0.3.1" @@ -119,15 +87,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "approx" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "072df7202e63b127ab55acfe16ce97013d5b97bf160489336d3f1840fd78e99e" -dependencies = [ - "num-traits", -] - [[package]] name = "arrayvec" version = "0.7.1" @@ -169,25 +128,6 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" -[[package]] -name = "bindgen" -version = "0.56.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2da379dbebc0b76ef63ca68d8fc6e71c0f13e59432e0987e508c1820e6ab5239" -dependencies = [ - "bitflags", - "cexpr", - "clang-sys", - "lazy_static", - "lazycell", - "peeking_take_while", - "proc-macro2", - "quote", - "regex", - "rustc-hash", - "shlex", -] - [[package]] name = "bit-set" version = "0.5.2" @@ -209,6 +149,16 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags_serde_shim" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25c3d626f0280ec39b33a6fc5c6c1067432b4c41e94aee40ded197a6649bf025" +dependencies = [ + "bitflags", + "serde", +] + [[package]] name = "block" version = "0.1.6" @@ -247,12 +197,6 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" -[[package]] -name = "bytes" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" - [[package]] name = "calloop" version = "0.6.5" @@ -268,24 +212,6 @@ name = "cc" version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" -dependencies = [ - "jobserver", -] - -[[package]] -name = "cesu8" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" - -[[package]] -name = "cexpr" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" -dependencies = [ - "nom 5.1.2", -] [[package]] name = "cfg-if" @@ -311,7 +237,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", ] @@ -327,23 +253,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "clang-sys" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10612c0ec0e0a1ff0e97980647cb058a6e7aedb913d01d009c406b8b7d0b26ee" -dependencies = [ - "glob", - "libc", - "libloading 0.7.0", -] - -[[package]] -name = "claxon" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bfbf56724aa9eca8afa4fcfadeb479e722935bb2a0900c2d37e0cc477af0688" - [[package]] name = "cmake" version = "0.1.45" @@ -400,16 +309,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" -[[package]] -name = "combine" -version = "4.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a909e4d93292cd8e9c42e189f61681eff9d67b6541f96b8a1a737f23737bd001" -dependencies = [ - "bytes", - "memchr", -] - [[package]] name = "compute" version = "0.1.0" @@ -518,50 +417,6 @@ dependencies = [ "objc", ] -[[package]] -name = "coreaudio-rs" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11894b20ebfe1ff903cbdc52259693389eea03b94918a2def2c30c3bf227ad88" -dependencies = [ - "bitflags", - "coreaudio-sys", -] - -[[package]] -name = "coreaudio-sys" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b7e3347be6a09b46aba228d6608386739fb70beff4f61e07422da87b0bb31fa" -dependencies = [ - "bindgen", -] - -[[package]] -name = "cpal" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98f45f0a21f617cd2c788889ef710b63f075c949259593ea09c826f1e47a2418" -dependencies = [ - "alsa", - "core-foundation-sys 0.8.2", - "coreaudio-rs", - "jni", - "js-sys", - "lazy_static", - "libc", - "mach", - "ndk 0.3.0", - "ndk-glue 0.3.0", - "nix 0.20.0", - "oboe", - "parking_lot", - "stdweb", - "thiserror", - "web-sys", - "winapi", -] - [[package]] name = "crc32fast" version = "1.2.1" @@ -889,45 +744,6 @@ dependencies = [ "web-sys", ] -[[package]] -name = "glyph_brush" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e3f00b8574a76fb6c50890c48da03946ca50e4372a2778737922666a2238221" -dependencies = [ - "glyph_brush_draw_cache", - "glyph_brush_layout", - "log", - "ordered-float", - "rustc-hash", - "twox-hash", -] - -[[package]] -name = "glyph_brush_draw_cache" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac2c82074cafb68b9e459c50c655f7eedcb92d6ee7166813802934bc6fc29fa3" -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.0", - "xi-unicode", -] - [[package]] name = "gpu-alloc" version = "0.5.1" @@ -992,10 +808,10 @@ dependencies = [ ] [[package]] -name = "hound" -version = "3.4.0" +name = "hexf-parse" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" +checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" [[package]] name = "humantime" @@ -1036,6 +852,7 @@ checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5" dependencies = [ "autocfg", "hashbrown 0.11.2", + "serde", ] [[package]] @@ -1051,6 +868,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d" dependencies = [ "cfg-if 1.0.0", + "js-sys", + "wasm-bindgen", + "web-sys", ] [[package]] @@ -1059,35 +879,12 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" -[[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-sys" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" -[[package]] -name = "jobserver" -version = "0.1.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" -dependencies = [ - "libc", -] - [[package]] name = "jpeg-decoder" version = "0.1.22" @@ -1122,23 +919,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 = "lewton" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "777b48df9aaab155475a83a7df3070395ea1ac6902f5cd062b8f2b028075c030" -dependencies = [ - "byteorder", - "ogg", - "tinyvec", -] - [[package]] name = "libc" version = "0.2.102" @@ -1165,12 +945,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "linked-hash-map" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" - [[package]] name = "lock_api" version = "0.4.5" @@ -1195,15 +969,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" -[[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" @@ -1272,26 +1037,6 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c835948974f68e0bd58636fc6c5b1fbff7b297e3046f11b3b3c18bbac012c6d" -[[package]] -name = "minimp3" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "985438f75febf74c392071a975a29641b420dd84431135a6e6db721de4b74372" -dependencies = [ - "minimp3-sys", - "slice-deque", - "thiserror", -] - -[[package]] -name = "minimp3-sys" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e21c73734c69dc95696c9ed8926a2b393171d98b3f5f5935686a26a487ab9b90" -dependencies = [ - "cc", -] - [[package]] name = "miniz_oxide" version = "0.3.7" @@ -1347,19 +1092,20 @@ dependencies = [ [[package]] name = "naga" -version = "0.6.3" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c5859e55c51da10b98e7a73068e0a0c5da7bbcae4fc38f86043d0c6d1b917cf" +checksum = "032288733590c094012e5f1dec15848be90015bb9b3fd16743d84ea582c4154a" dependencies = [ "bit-set", "bitflags", "codespan-reporting", "fxhash", + "hexf-parse", + "indexmap", "log", "num-traits", "petgraph", "pp-rs", - "rose_tree", "serde", "spirv", "thiserror", @@ -1377,19 +1123,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "ndk" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d64d6af06fde0e527b1ba5c7b79a6cc89cfc46325b0b2887dffe8f70197e0c3c" -dependencies = [ - "bitflags", - "jni-sys", - "ndk-sys", - "num_enum", - "thiserror", -] - [[package]] name = "ndk-glue" version = "0.3.0" @@ -1399,21 +1132,7 @@ dependencies = [ "lazy_static", "libc", "log", - "ndk 0.3.0", - "ndk-macro", - "ndk-sys", -] - -[[package]] -name = "ndk-glue" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e9e94628f24e7a3cb5b96a2dc5683acd9230bf11991c2a1677b87695138420" -dependencies = [ - "lazy_static", - "libc", - "log", - "ndk 0.4.0", + "ndk", "ndk-macro", "ndk-sys", ] @@ -1461,16 +1180,6 @@ dependencies = [ "libc", ] -[[package]] -name = "nom" -version = "5.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" -dependencies = [ - "memchr", - "version_check", -] - [[package]] name = "nom" version = "7.0.0" @@ -1491,17 +1200,6 @@ dependencies = [ "winapi", ] -[[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", -] - [[package]] name = "num-integer" version = "0.1.44" @@ -1594,69 +1292,19 @@ dependencies = [ "cc", ] -[[package]] -name = "oboe" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e15e22bc67e047fe342a32ecba55f555e3be6166b04dd157cd0f803dfa9f48e1" -dependencies = [ - "jni", - "ndk 0.4.0", - "ndk-glue 0.4.0", - "num-derive", - "num-traits", - "oboe-sys", -] - -[[package]] -name = "oboe-sys" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "338142ae5ab0aaedc8275aa8f67f460e43ae0fca76a695a742d56da0a269eadc" -dependencies = [ - "cc", -] - -[[package]] -name = "ogg" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6951b4e8bf21c8193da321bcce9c9dd2e13c858fe078bf9054a288b419ae5d6e" -dependencies = [ - "byteorder", -] - [[package]] name = "once_cell" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" -[[package]] -name = "ordered-float" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97c9d06878b3a851e8026ef94bf7fef9ba93062cd412601da4d9cf369b1cc62d" -dependencies = [ - "num-traits", -] - [[package]] name = "owned_ttf_parser" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" dependencies = [ - "ttf-parser 0.6.2", -] - -[[package]] -name = "owned_ttf_parser" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60ac8dda2e5cc09bf6480e3b3feff9783db251710c922ae9369a429c51efdeb0" -dependencies = [ - "ttf-parser 0.12.3", + "ttf-parser", ] [[package]] @@ -1684,12 +1332,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "peeking_take_while" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" - [[package]] name = "percent-encoding" version = "2.1.0" @@ -1736,24 +1378,6 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb20dcc30536a1508e75d47dd0e399bb2fe7354dcf35cda9127f2bf1ed92e30e" -[[package]] -name = "pong" -version = "0.1.0" -dependencies = [ - "anyhow", - "bytemuck", - "cgmath", - "fs_extra", - "glob", - "pollster", - "rand", - "rodio", - "shaderc", - "wgpu", - "wgpu_glyph", - "winit", -] - [[package]] name = "pp-rs" version = "0.2.1" @@ -1763,12 +1387,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "ppv-lite86" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857" - [[package]] name = "proc-macro-crate" version = "0.1.5" @@ -1812,46 +1430,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", - "rand_hc", -] - -[[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.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rand_hc" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" -dependencies = [ - "rand_core", -] - [[package]] name = "range-alloc" version = "0.1.2" @@ -1939,19 +1517,6 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" -[[package]] -name = "rodio" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d98f5e557b61525057e2bc142c8cd7f0e70d75dc32852309bec440e6e046bf9" -dependencies = [ - "claxon", - "cpal", - "hound", - "lewton", - "minimp3", -] - [[package]] name = "ron" version = "0.6.5" @@ -1963,21 +1528,6 @@ dependencies = [ "serde", ] -[[package]] -name = "rose_tree" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcd16c61e9205949fa4f8a22096705b4c2f8b8025b2ff67ff6c86afd854039ae" -dependencies = [ - "petgraph", -] - -[[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - [[package]] name = "rusttype" version = "0.9.2" @@ -1985,7 +1535,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" dependencies = [ "ab_glyph_rasterizer", - "owned_ttf_parser 0.6.0", + "owned_ttf_parser", ] [[package]] @@ -2081,23 +1631,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "shlex" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" - -[[package]] -name = "slice-deque" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31ef6ee280cdefba6d2d0b4b78a84a1c1a3f3a4cec98c2d4231c8bc225de0f25" -dependencies = [ - "libc", - "mach", - "winapi", -] - [[package]] name = "slotmap" version = "1.0.6" @@ -2142,18 +1675,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "stdweb" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" - [[package]] name = "strsim" version = "0.9.3" @@ -2231,21 +1752,6 @@ dependencies = [ "weezl", ] -[[package]] -name = "tinyvec" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5241dd6f21443a3606b432718b166d3cedc962fd4b8bea54a8bc7f514ebda986" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" - [[package]] name = "tobj" version = "2.0.4" @@ -2339,12 +1845,6 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" -[[package]] -name = "ttf-parser" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ae2f58a822f08abdaf668897e96a5656fe72f5a9ce66422423e8849384872e6" - [[package]] name = "tutorial1-window" version = "0.1.0" @@ -2431,25 +1931,6 @@ dependencies = [ "winit", ] -[[package]] -name = "tutorial14-text" -version = "0.1.0" -dependencies = [ - "anyhow", - "bytemuck", - "cgmath", - "env_logger", - "fs_extra", - "glob", - "image", - "log", - "pollster", - "rayon", - "tobj 3.2.0", - "wgpu", - "winit", -] - [[package]] name = "tutorial2-surface" version = "0.1.0" @@ -2582,17 +2063,6 @@ dependencies = [ "winit", ] -[[package]] -name = "twox-hash" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f559b464de2e2bdabcac6a210d12e9b5a5973c251e102c44c585c71d51bd78e" -dependencies = [ - "cfg-if 1.0.0", - "rand", - "static_assertions", -] - [[package]] name = "unicode-width" version = "0.1.9" @@ -2769,9 +2239,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.51" +version = "0.3.55" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e828417b379f3df7111d3a2a9e5753706cae29c41f7c4029ee9fd77f3e09e582" +checksum = "38eb105f1c59d9eaa6b5cdc92b859d85b926e82cb2e0945cd0c9259faa6fe9fb" dependencies = [ "js-sys", "wasm-bindgen", @@ -2785,9 +2255,9 @@ checksum = "d8b77fdfd5a253be4ab714e4ffa3c49caf146b4de743e97510c0656cf90f1e8e" [[package]] name = "wgpu" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d92a4fe73b1e7d7ef99938dacd49258cbf1ad87cdb5bf6efa20c27447442b45" +checksum = "d1577ecc4f6992b9e965878ac594efb24eed2bdf089c11f45b3d1c5f216e2e30" dependencies = [ "arrayvec", "js-sys", @@ -2807,9 +2277,9 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.10.3" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f1b4d918c970526cbc83b72ccb72dbefd38aec45f07b2310de4ffcd7f4bd8c5" +checksum = "45af76ba5545b61a6904f26cdcf4287329144ae9e12f0c23ec4c9be982d675a6" dependencies = [ "arrayvec", "bitflags", @@ -2831,9 +2301,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.10.7" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27cd894b17bff1958ee93da1cc991fd64bf99667746d4bd2a7403855f4d37fe2" +checksum = "a412af0f34ad8065d2bb56183df11ccf68aec87d4ca674d7fd2387e7705eb7a6" dependencies = [ "arrayvec", "ash", @@ -2848,6 +2318,7 @@ dependencies = [ "gpu-alloc", "gpu-descriptor", "inplace_it", + "js-sys", "khronos-egl", "libloading 0.7.0", "log", @@ -2855,10 +2326,13 @@ dependencies = [ "naga", "objc", "parking_lot", + "profiling", "range-alloc", "raw-window-handle", "renderdoc-sys", "thiserror", + "wasm-bindgen", + "web-sys", "wgpu-types", "winapi", ] @@ -2878,26 +2352,15 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25feb2fbf24ab3219a9f10890ceb8e1ef02b13314ed89d64a9ae99dcad883e18" +checksum = "e15e44ba88ec415466e18e91881319e7c9e96cb905dc623305168aea65b85ccc" dependencies = [ "bitflags", + "bitflags_serde_shim", "serde", ] -[[package]] -name = "wgpu_glyph" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf11aebbcf20806535bee127367bcb393c83d77c60c4f7917184d839716cf41" -dependencies = [ - "bytemuck", - "glyph_brush", - "log", - "wgpu", -] - [[package]] name = "winapi" version = "0.3.9" @@ -2960,8 +2423,8 @@ dependencies = [ "log", "mio", "mio-misc", - "ndk 0.3.0", - "ndk-glue 0.3.0", + "ndk", + "ndk-glue", "ndk-sys", "objc", "parking_lot", @@ -2992,7 +2455,7 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" dependencies = [ - "nom 7.0.0", + "nom", ] [[package]] @@ -3001,12 +2464,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" -[[package]] -name = "xi-unicode" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" - [[package]] name = "xml-rs" version = "0.8.4" diff --git a/Cargo.toml b/Cargo.toml index 3ad6d7e8..6a082246 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,5 +12,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 5cefb005..8436b2e9 100644 --- a/code/beginner/tutorial1-window/Cargo.toml +++ b/code/beginner/tutorial1-window/Cargo.toml @@ -17,5 +17,5 @@ winit = "0.25" cgmath = "0.18" env_logger = "0.9" log = "0.4" -wgpu = "0.10" +wgpu = "0.11" pollster = "0.2" diff --git a/code/beginner/tutorial2-surface/Cargo.toml b/code/beginner/tutorial2-surface/Cargo.toml index 9da2acd2..4442cfb0 100644 --- a/code/beginner/tutorial2-surface/Cargo.toml +++ b/code/beginner/tutorial2-surface/Cargo.toml @@ -12,8 +12,8 @@ winit = "0.25" cgmath = "0.18" env_logger = "0.9" log = "0.4" -wgpu = "0.10" -# wgpu = { version = "0.10", features=["trace"]} +wgpu = "0.11" +# wgpu = { version = "0.11", features=["trace"]} # wgpu = { git = "https://github.com/gfx-rs/wgpu/"} # wgpu = { git = "https://github.com/gfx-rs/wgpu/", features=["trace"]} pollster = "0.2" diff --git a/code/beginner/tutorial2-surface/src/challenge.rs b/code/beginner/tutorial2-surface/src/challenge.rs index 585f0bfd..eeaea751 100644 --- a/code/beginner/tutorial2-surface/src/challenge.rs +++ b/code/beginner/tutorial2-surface/src/challenge.rs @@ -31,6 +31,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -97,7 +98,7 @@ impl State { fn update(&mut self) {} fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -124,6 +125,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial2-surface/src/main.rs b/code/beginner/tutorial2-surface/src/main.rs index ff0b5980..a6ea8abd 100644 --- a/code/beginner/tutorial2-surface/src/main.rs +++ b/code/beginner/tutorial2-surface/src/main.rs @@ -26,6 +26,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -78,7 +79,7 @@ impl State { fn update(&mut self) {} fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -110,6 +111,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial3-pipeline/Cargo.toml b/code/beginner/tutorial3-pipeline/Cargo.toml index 11b4fdd6..2a673121 100644 --- a/code/beginner/tutorial3-pipeline/Cargo.toml +++ b/code/beginner/tutorial3-pipeline/Cargo.toml @@ -10,7 +10,7 @@ winit = "0.25" cgmath = "0.18" env_logger = "0.9" log = "0.4" -wgpu = "0.10" +wgpu = "0.11" pollster = "0.2" # NEW! diff --git a/code/beginner/tutorial3-pipeline/src/challenge.rs b/code/beginner/tutorial3-pipeline/src/challenge.rs index aa014ae7..34790864 100644 --- a/code/beginner/tutorial3-pipeline/src/challenge.rs +++ b/code/beginner/tutorial3-pipeline/src/challenge.rs @@ -29,6 +29,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -190,7 +191,7 @@ impl State { fn update(&mut self) {} fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -229,6 +230,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial3-pipeline/src/main.rs b/code/beginner/tutorial3-pipeline/src/main.rs index 43a8bc87..498de0e3 100644 --- a/code/beginner/tutorial3-pipeline/src/main.rs +++ b/code/beginner/tutorial3-pipeline/src/main.rs @@ -28,6 +28,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -132,7 +133,7 @@ impl State { fn update(&mut self) {} fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -167,6 +168,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial4-buffer/Cargo.toml b/code/beginner/tutorial4-buffer/Cargo.toml index 27a7f653..9c928195 100644 --- a/code/beginner/tutorial4-buffer/Cargo.toml +++ b/code/beginner/tutorial4-buffer/Cargo.toml @@ -9,7 +9,7 @@ edition = "2018" image = "0.23" cgmath = "0.18" winit = "0.25" -wgpu = "0.10" +wgpu = "0.11" env_logger = "0.9" log = "0.4" pollster = "0.2" diff --git a/code/beginner/tutorial4-buffer/src/challenge.rs b/code/beginner/tutorial4-buffer/src/challenge.rs index a4e420bc..4b38584a 100644 --- a/code/beginner/tutorial4-buffer/src/challenge.rs +++ b/code/beginner/tutorial4-buffer/src/challenge.rs @@ -92,6 +92,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -261,7 +262,7 @@ impl State { fn update(&mut self) {} fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -309,6 +310,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial4-buffer/src/main.rs b/code/beginner/tutorial4-buffer/src/main.rs index 81ce6c49..22b22254 100644 --- a/code/beginner/tutorial4-buffer/src/main.rs +++ b/code/beginner/tutorial4-buffer/src/main.rs @@ -85,6 +85,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -204,7 +205,7 @@ impl State { fn update(&mut self) {} fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -241,6 +242,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial5-textures/Cargo.toml b/code/beginner/tutorial5-textures/Cargo.toml index bd97c515..d9574123 100644 --- a/code/beginner/tutorial5-textures/Cargo.toml +++ b/code/beginner/tutorial5-textures/Cargo.toml @@ -14,7 +14,7 @@ env_logger = "0.9" log = "0.4" pollster = "0.2" image = "0.23" -wgpu = "0.10" +wgpu = "0.11" winit = "0.25" [build-dependencies] diff --git a/code/beginner/tutorial5-textures/src/challenge.rs b/code/beginner/tutorial5-textures/src/challenge.rs index e5250750..f134124a 100644 --- a/code/beginner/tutorial5-textures/src/challenge.rs +++ b/code/beginner/tutorial5-textures/src/challenge.rs @@ -94,6 +94,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -295,7 +296,7 @@ impl State { fn update(&mut self) {} fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -339,6 +340,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial5-textures/src/main.rs b/code/beginner/tutorial5-textures/src/main.rs index 09769344..ed116c40 100644 --- a/code/beginner/tutorial5-textures/src/main.rs +++ b/code/beginner/tutorial5-textures/src/main.rs @@ -91,6 +91,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -256,7 +257,7 @@ impl State { fn update(&mut self) {} fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -294,6 +295,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial6-uniforms/Cargo.toml b/code/beginner/tutorial6-uniforms/Cargo.toml index 05a3f032..33b608e5 100644 --- a/code/beginner/tutorial6-uniforms/Cargo.toml +++ b/code/beginner/tutorial6-uniforms/Cargo.toml @@ -12,7 +12,7 @@ env_logger = "0.9" log = "0.4" pollster = "0.2" image = "0.23" -wgpu = "0.10" +wgpu = "0.11" winit = "0.25" [build-dependencies] diff --git a/code/beginner/tutorial6-uniforms/src/challenge.rs b/code/beginner/tutorial6-uniforms/src/challenge.rs index b3daa292..f9459615 100644 --- a/code/beginner/tutorial6-uniforms/src/challenge.rs +++ b/code/beginner/tutorial6-uniforms/src/challenge.rs @@ -256,6 +256,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -483,7 +484,7 @@ impl State { } fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -522,6 +523,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial6-uniforms/src/main.rs b/code/beginner/tutorial6-uniforms/src/main.rs index 19995251..16e9cf3f 100644 --- a/code/beginner/tutorial6-uniforms/src/main.rs +++ b/code/beginner/tutorial6-uniforms/src/main.rs @@ -241,6 +241,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -464,7 +465,7 @@ impl State { } fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -503,6 +504,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial7-instancing/Cargo.toml b/code/beginner/tutorial7-instancing/Cargo.toml index 260bd44d..d5e12371 100644 --- a/code/beginner/tutorial7-instancing/Cargo.toml +++ b/code/beginner/tutorial7-instancing/Cargo.toml @@ -12,7 +12,7 @@ env_logger = "0.9" log = "0.4" pollster = "0.2" image = "0.23" -wgpu = "0.10" +wgpu = "0.11" winit = "0.25" [build-dependencies] diff --git a/code/beginner/tutorial7-instancing/src/challenge.rs b/code/beginner/tutorial7-instancing/src/challenge.rs index 6dd2a072..917bc059 100644 --- a/code/beginner/tutorial7-instancing/src/challenge.rs +++ b/code/beginner/tutorial7-instancing/src/challenge.rs @@ -338,6 +338,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -611,7 +612,7 @@ impl State { } fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -651,6 +652,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial7-instancing/src/main.rs b/code/beginner/tutorial7-instancing/src/main.rs index 3657dabc..1a6c38b6 100644 --- a/code/beginner/tutorial7-instancing/src/main.rs +++ b/code/beginner/tutorial7-instancing/src/main.rs @@ -302,6 +302,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -560,7 +561,7 @@ impl State { } fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -601,6 +602,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial8-depth/Cargo.toml b/code/beginner/tutorial8-depth/Cargo.toml index 00e883ce..80a5349a 100644 --- a/code/beginner/tutorial8-depth/Cargo.toml +++ b/code/beginner/tutorial8-depth/Cargo.toml @@ -12,7 +12,7 @@ env_logger = "0.9" pollster = "0.2" image = "0.23" log = "0.4" -wgpu = "0.10" +wgpu = "0.11" winit = "0.25" [build-dependencies] diff --git a/code/beginner/tutorial8-depth/src/challenge.rs b/code/beginner/tutorial8-depth/src/challenge.rs index afe47e06..c6bef2ed 100644 --- a/code/beginner/tutorial8-depth/src/challenge.rs +++ b/code/beginner/tutorial8-depth/src/challenge.rs @@ -499,6 +499,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -770,7 +771,7 @@ impl State { } fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -819,6 +820,7 @@ impl State { self.depth_pass.render(&view, &mut encoder); self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial8-depth/src/main.rs b/code/beginner/tutorial8-depth/src/main.rs index c4598733..8bc63b72 100644 --- a/code/beginner/tutorial8-depth/src/main.rs +++ b/code/beginner/tutorial8-depth/src/main.rs @@ -312,6 +312,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -581,7 +582,7 @@ impl State { } fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -628,6 +629,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/beginner/tutorial9-models/Cargo.toml b/code/beginner/tutorial9-models/Cargo.toml index 7aa8e33f..26385cc2 100644 --- a/code/beginner/tutorial9-models/Cargo.toml +++ b/code/beginner/tutorial9-models/Cargo.toml @@ -13,7 +13,7 @@ pollster = "0.2" image = "0.23" log = "0.4" tobj = "3.0" -wgpu = "0.10" +wgpu = "0.11" winit = "0.25" [build-dependencies] diff --git a/code/beginner/tutorial9-models/src/main.rs b/code/beginner/tutorial9-models/src/main.rs index 50f21466..dc0271ee 100644 --- a/code/beginner/tutorial9-models/src/main.rs +++ b/code/beginner/tutorial9-models/src/main.rs @@ -250,6 +250,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -491,7 +492,7 @@ impl State { } fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -538,6 +539,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/intermediate/tutorial10-lighting/Cargo.toml b/code/intermediate/tutorial10-lighting/Cargo.toml index 8380cb60..5eded700 100644 --- a/code/intermediate/tutorial10-lighting/Cargo.toml +++ b/code/intermediate/tutorial10-lighting/Cargo.toml @@ -13,7 +13,7 @@ pollster = "0.2" image = "0.23" log = "0.4" tobj = "3.0" -wgpu = "0.10" +wgpu = "0.11" winit = "0.25" [build-dependencies] diff --git a/code/intermediate/tutorial10-lighting/src/main.rs b/code/intermediate/tutorial10-lighting/src/main.rs index 202f8507..df8d0e25 100644 --- a/code/intermediate/tutorial10-lighting/src/main.rs +++ b/code/intermediate/tutorial10-lighting/src/main.rs @@ -341,6 +341,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -623,7 +624,7 @@ impl State { } fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -677,6 +678,7 @@ impl State { } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/intermediate/tutorial11-normals/Cargo.toml b/code/intermediate/tutorial11-normals/Cargo.toml index 3b8b7dfa..7c5bb344 100644 --- a/code/intermediate/tutorial11-normals/Cargo.toml +++ b/code/intermediate/tutorial11-normals/Cargo.toml @@ -13,7 +13,7 @@ pollster = "0.2" image = "0.23" log = "0.4" tobj = "3.0" -wgpu = "0.10" +wgpu = "0.11" winit = "0.25" [build-dependencies] diff --git a/code/intermediate/tutorial11-normals/src/main.rs b/code/intermediate/tutorial11-normals/src/main.rs index 36146949..f3d14d6c 100644 --- a/code/intermediate/tutorial11-normals/src/main.rs +++ b/code/intermediate/tutorial11-normals/src/main.rs @@ -342,6 +342,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -676,7 +677,7 @@ impl State { } fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -730,6 +731,7 @@ impl State { ); } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/intermediate/tutorial12-camera/Cargo.toml b/code/intermediate/tutorial12-camera/Cargo.toml index a7aaa6e8..d169b1e9 100644 --- a/code/intermediate/tutorial12-camera/Cargo.toml +++ b/code/intermediate/tutorial12-camera/Cargo.toml @@ -13,7 +13,7 @@ pollster = "0.2" image = "0.23" log = "0.4" tobj = "3.0" -wgpu = "0.10" +wgpu = "0.11" winit = "0.25" [build-dependencies] diff --git a/code/intermediate/tutorial12-camera/src/main.rs b/code/intermediate/tutorial12-camera/src/main.rs index ecc1452a..05d313a8 100644 --- a/code/intermediate/tutorial12-camera/src/main.rs +++ b/code/intermediate/tutorial12-camera/src/main.rs @@ -222,6 +222,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -583,7 +584,7 @@ impl State { } fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -637,6 +638,7 @@ impl State { ); } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/intermediate/tutorial13-threading/Cargo.toml b/code/intermediate/tutorial13-threading/Cargo.toml index 1f6904f3..3ea0290f 100644 --- a/code/intermediate/tutorial13-threading/Cargo.toml +++ b/code/intermediate/tutorial13-threading/Cargo.toml @@ -14,7 +14,7 @@ image = "0.23" log = "0.4" rayon = "1.4" # NEW! tobj = "3.0" -wgpu = "0.10" +wgpu = "0.11" winit = "0.25" [build-dependencies] diff --git a/code/intermediate/tutorial13-threading/src/main.rs b/code/intermediate/tutorial13-threading/src/main.rs index d58e47c0..ba5ac016 100644 --- a/code/intermediate/tutorial13-threading/src/main.rs +++ b/code/intermediate/tutorial13-threading/src/main.rs @@ -221,6 +221,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -578,7 +579,7 @@ impl State { } fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -632,6 +633,7 @@ impl State { ); } self.queue.submit(iter::once(encoder.finish())); + output.present(); Ok(()) } diff --git a/code/showcase/compute/Cargo.toml b/code/showcase/compute/Cargo.toml index a08ec248..56e14cbd 100644 --- a/code/showcase/compute/Cargo.toml +++ b/code/showcase/compute/Cargo.toml @@ -14,7 +14,7 @@ image = "0.23" log = "0.4" rayon = "1.4" tobj = "2.0" -wgpu = { version = "0.10", features = ["trace", "spirv"] } +wgpu = { version = "0.11", features = ["trace", "spirv"] } winit = "0.25" [build-dependencies] @@ -22,4 +22,4 @@ anyhow = "1.0" fs_extra = "1.2" glob = "0.3" rayon = "1.4" -naga = { version = "0.6", features = ["glsl-in", "spv-out", "wgsl-out"]} \ No newline at end of file +naga = { version = "0.7", features = ["glsl-in", "spv-out", "wgsl-out"]} \ No newline at end of file diff --git a/code/showcase/compute/src/light.frag.wgsl b/code/showcase/compute/src/light.frag.wgsl index 9f7281a4..d81bb28b 100644 --- a/code/showcase/compute/src/light.frag.wgsl +++ b/code/showcase/compute/src/light.frag.wgsl @@ -6,8 +6,8 @@ var v_color1: vec3; var f_color: vec4; fn main1() { - let _e2: vec3 = v_color1; - f_color = vec4(_e2, 1.0); + let e2: vec3 = v_color1; + f_color = vec4(e2, 1.0); return; } @@ -15,6 +15,6 @@ fn main1() { fn main([[location(0)]] v_color: vec3) -> FragmentOutput { v_color1 = v_color; main1(); - let _e7: vec4 = f_color; - return FragmentOutput(_e7); + let e7: vec4 = f_color; + return FragmentOutput(e7); } diff --git a/code/showcase/compute/src/light.vert.wgsl b/code/showcase/compute/src/light.vert.wgsl index a319998a..77c6c687 100644 --- a/code/showcase/compute/src/light.vert.wgsl +++ b/code/showcase/compute/src/light.vert.wgsl @@ -27,15 +27,15 @@ var gl_Position: vec4; fn main1() { var v_position: vec3; - let _e11: vec3 = a_position1; - let _e12: f32 = scale; - let _e14: vec3 = global1.u_position; - v_position = ((_e11 * _e12) + _e14); - let _e18: mat4x4 = global.u_view_proj; - let _e19: vec3 = v_position; - gl_Position = (_e18 * vec4(_e19, f32(1))); - let _e24: vec3 = global1.u_color; - v_color = _e24; + let e11: vec3 = a_position1; + let e12: f32 = scale; + let e14: vec3 = global1.u_position; + v_position = ((e11 * e12) + e14); + let e18: mat4x4 = global.u_view_proj; + let e19: vec3 = v_position; + gl_Position = (e18 * vec4(e19, f32(1))); + let e24: vec3 = global1.u_color; + v_color = e24; return; } @@ -43,7 +43,7 @@ fn main1() { fn main([[location(0)]] a_position: vec3) -> VertexOutput { a_position1 = a_position; main1(); - let _e18: vec3 = v_color; - let _e20: vec4 = gl_Position; - return VertexOutput(_e18, _e20); + let e18: vec3 = v_color; + let e20: vec4 = gl_Position; + return VertexOutput(e18, e20); } diff --git a/code/showcase/compute/src/main.rs b/code/showcase/compute/src/main.rs index 1ab035d0..98d37878 100644 --- a/code/showcase/compute/src/main.rs +++ b/code/showcase/compute/src/main.rs @@ -168,6 +168,7 @@ impl State { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -534,11 +535,10 @@ impl State { } fn render(&mut self) { - let frame = self.surface.get_current_frame(); + let frame = self.surface.get_current_texture(); match frame { - Ok(frame) => { - let output = frame.output; + Ok(output) => { let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); @@ -591,6 +591,7 @@ impl State { ); } self.queue.submit(iter::once(encoder.finish())); + output.present(); } Err(e) => { eprintln!("{:?}", e); diff --git a/code/showcase/compute/src/model_load.comp.wgsl b/code/showcase/compute/src/model_load.comp.wgsl index 4e0b681d..7a094553 100644 --- a/code/showcase/compute/src/model_load.comp.wgsl +++ b/code/showcase/compute/src/model_load.comp.wgsl @@ -52,29 +52,29 @@ fn getPos(v: ModelVertex) -> vec3 { var v1: ModelVertex; v1 = v; - let _e12: ModelVertex = v1; - let _e14: ModelVertex = v1; - let _e16: ModelVertex = v1; - return vec3(_e12.x, _e14.y, _e16.z); + let e12: ModelVertex = v1; + let e14: ModelVertex = v1; + let e16: ModelVertex = v1; + return vec3(e12.x, e14.y, e16.z); } fn getUV(v2: ModelVertex) -> vec2 { var v3: ModelVertex; v3 = v2; - let _e12: ModelVertex = v3; - let _e14: ModelVertex = v3; - return vec2(_e12.uv, _e14.uw); + let e12: ModelVertex = v3; + let e14: ModelVertex = v3; + return vec2(e12.uv, e14.uw); } fn getNormal(v4: ModelVertex) -> vec3 { var v5: ModelVertex; v5 = v4; - let _e12: ModelVertex = v5; - let _e14: ModelVertex = v5; - let _e16: ModelVertex = v5; - return vec3(_e12.nx, _e14.ny, _e16.nz); + let e12: ModelVertex = v5; + let e14: ModelVertex = v5; + let e16: ModelVertex = v5; + return vec3(e12.nx, e14.ny, e16.nz); } fn calcTangentBitangent(vertexIndex: u32) -> ModelVertex { @@ -103,144 +103,144 @@ fn calcTangentBitangent(vertexIndex: u32) -> ModelVertex { var r: f32; vertexIndex1 = vertexIndex; - let _e12: u32 = vertexIndex1; - let _e14: ModelVertex = global.srcVertices[_e12]; - v6 = _e14; + let e12: u32 = vertexIndex1; + let e14: ModelVertex = global.srcVertices[e12]; + v6 = e14; loop { - let _e30: u32 = i; - let _e31: u32 = global3.numIndices; - if (!((_e30 < _e31))) { + let e30: u32 = i; + let e31: u32 = global3.numIndices; + if (!((e30 < e31))) { break; } { - let _e38: u32 = i; - let _e40: u32 = global2.indices[_e38]; - index0_ = _e40; - let _e42: u32 = i; - let _e47: u32 = global2.indices[(_e42 + u32(1))]; - index1_ = _e47; - let _e49: u32 = i; - let _e54: u32 = global2.indices[(_e49 + u32(2))]; - index2_ = _e54; - let _e56: u32 = index0_; - let _e57: u32 = vertexIndex1; - let _e59: u32 = index1_; - let _e60: u32 = vertexIndex1; - let _e63: u32 = index2_; - let _e64: u32 = vertexIndex1; - if ((((_e56 == _e57) || (_e59 == _e60)) || (_e63 == _e64))) { + let e38: u32 = i; + let e40: u32 = global2.indices[e38]; + index0_ = e40; + let e42: u32 = i; + let e47: u32 = global2.indices[(e42 + u32(1))]; + index1_ = e47; + let e49: u32 = i; + let e54: u32 = global2.indices[(e49 + u32(2))]; + index2_ = e54; + let e56: u32 = index0_; + let e57: u32 = vertexIndex1; + let e59: u32 = index1_; + let e60: u32 = vertexIndex1; + let e63: u32 = index2_; + let e64: u32 = vertexIndex1; + if ((((e56 == e57) || (e59 == e60)) || (e63 == e64))) { { - let _e67: u32 = index0_; - let _e69: ModelVertex = global.srcVertices[_e67]; - v0_ = _e69; - let _e71: u32 = index1_; - let _e73: ModelVertex = global.srcVertices[_e71]; - v1_ = _e73; - let _e75: u32 = index2_; - let _e77: ModelVertex = global.srcVertices[_e75]; - v2_ = _e77; - let _e80: ModelVertex = v0_; - let _e81: vec3 = getPos(_e80); - pos0_ = _e81; - let _e84: ModelVertex = v1_; - let _e85: vec3 = getPos(_e84); - pos1_ = _e85; - let _e88: ModelVertex = v2_; - let _e89: vec3 = getPos(_e88); - pos2_ = _e89; - let _e92: ModelVertex = v0_; - let _e93: vec2 = getUV(_e92); - uv0_ = _e93; - let _e96: ModelVertex = v1_; - let _e97: vec2 = getUV(_e96); - uv1_ = _e97; - let _e100: ModelVertex = v2_; - let _e101: vec2 = getUV(_e100); - uv2_ = _e101; - let _e103: vec3 = pos1_; - let _e104: vec3 = pos0_; - delta_pos1_ = (_e103 - _e104); - let _e107: vec3 = pos2_; - let _e108: vec3 = pos0_; - delta_pos2_ = (_e107 - _e108); - let _e111: vec2 = uv1_; - let _e112: vec2 = uv0_; - delta_uv1_ = (_e111 - _e112); - let _e115: vec2 = uv2_; - let _e116: vec2 = uv0_; - delta_uv2_ = (_e115 - _e116); - let _e120: vec2 = delta_uv1_; - let _e122: vec2 = delta_uv2_; - let _e125: vec2 = delta_uv1_; - let _e127: vec2 = delta_uv2_; - r = (1.0 / ((_e120.x * _e122.y) - (_e125.y * _e127.x))); - let _e133: vec3 = tangent; - let _e134: vec3 = delta_pos1_; - let _e135: vec2 = delta_uv2_; - let _e138: vec3 = delta_pos2_; - let _e139: vec2 = delta_uv1_; - let _e143: f32 = r; - tangent = (_e133 + (((_e134 * _e135.y) - (_e138 * _e139.y)) * _e143)); - let _e146: vec3 = bitangent; - let _e147: vec3 = delta_pos2_; - let _e148: vec2 = delta_uv1_; - let _e151: vec3 = delta_pos1_; - let _e152: vec2 = delta_uv2_; - let _e156: f32 = r; - bitangent = (_e146 + (((_e147 * _e148.x) - (_e151 * _e152.x)) * _e156)); - let _e159: u32 = trianglesIncluded; - trianglesIncluded = (_e159 + u32(1)); + let e67: u32 = index0_; + let e69: ModelVertex = global.srcVertices[e67]; + v0_ = e69; + let e71: u32 = index1_; + let e73: ModelVertex = global.srcVertices[e71]; + v1_ = e73; + let e75: u32 = index2_; + let e77: ModelVertex = global.srcVertices[e75]; + v2_ = e77; + let e80: ModelVertex = v0_; + let e81: vec3 = getPos(e80); + pos0_ = e81; + let e84: ModelVertex = v1_; + let e85: vec3 = getPos(e84); + pos1_ = e85; + let e88: ModelVertex = v2_; + let e89: vec3 = getPos(e88); + pos2_ = e89; + let e92: ModelVertex = v0_; + let e93: vec2 = getUV(e92); + uv0_ = e93; + let e96: ModelVertex = v1_; + let e97: vec2 = getUV(e96); + uv1_ = e97; + let e100: ModelVertex = v2_; + let e101: vec2 = getUV(e100); + uv2_ = e101; + let e103: vec3 = pos1_; + let e104: vec3 = pos0_; + delta_pos1_ = (e103 - e104); + let e107: vec3 = pos2_; + let e108: vec3 = pos0_; + delta_pos2_ = (e107 - e108); + let e111: vec2 = uv1_; + let e112: vec2 = uv0_; + delta_uv1_ = (e111 - e112); + let e115: vec2 = uv2_; + let e116: vec2 = uv0_; + delta_uv2_ = (e115 - e116); + let e120: vec2 = delta_uv1_; + let e122: vec2 = delta_uv2_; + let e125: vec2 = delta_uv1_; + let e127: vec2 = delta_uv2_; + r = (1.0 / ((e120.x * e122.y) - (e125.y * e127.x))); + let e133: vec3 = tangent; + let e134: vec3 = delta_pos1_; + let e135: vec2 = delta_uv2_; + let e138: vec3 = delta_pos2_; + let e139: vec2 = delta_uv1_; + let e143: f32 = r; + tangent = (e133 + (((e134 * e135.y) - (e138 * e139.y)) * e143)); + let e146: vec3 = bitangent; + let e147: vec3 = delta_pos2_; + let e148: vec2 = delta_uv1_; + let e151: vec3 = delta_pos1_; + let e152: vec2 = delta_uv2_; + let e156: f32 = r; + bitangent = (e146 + (((e147 * e148.x) - (e151 * e152.x)) * e156)); + let e159: u32 = trianglesIncluded; + trianglesIncluded = (e159 + u32(1)); } } } continuing { - let _e34: u32 = i; - i = (_e34 + u32(3)); + let e34: u32 = i; + i = (e34 + u32(3)); } } - let _e163: u32 = trianglesIncluded; - if ((_e163 > u32(0))) { + let e163: u32 = trianglesIncluded; + if ((e163 > u32(0))) { { - let _e167: vec3 = tangent; - let _e168: u32 = trianglesIncluded; - tangent = (_e167 / vec3(f32(_e168))); - let _e172: vec3 = bitangent; - let _e173: u32 = trianglesIncluded; - bitangent = (_e172 / vec3(f32(_e173))); - let _e178: vec3 = tangent; - tangent = normalize(_e178); - let _e181: vec3 = bitangent; - bitangent = normalize(_e181); + let e167: vec3 = tangent; + let e168: u32 = trianglesIncluded; + tangent = (e167 / vec3(f32(e168))); + let e172: vec3 = bitangent; + let e173: u32 = trianglesIncluded; + bitangent = (e172 / vec3(f32(e173))); + let e178: vec3 = tangent; + tangent = normalize(e178); + let e181: vec3 = bitangent; + bitangent = normalize(e181); } } - let _e184: vec3 = tangent; - v6.tx = _e184.x; - let _e187: vec3 = tangent; - v6.ty = _e187.y; - let _e190: vec3 = tangent; - v6.tz = _e190.z; - let _e193: vec3 = bitangent; - v6.bx = _e193.x; - let _e196: vec3 = bitangent; - v6.by = _e196.y; - let _e199: vec3 = bitangent; - v6.bz = _e199.z; - let _e201: ModelVertex = v6; - return _e201; + let e184: vec3 = tangent; + v6.tx = e184.x; + let e187: vec3 = tangent; + v6.ty = e187.y; + let e190: vec3 = tangent; + v6.tz = e190.z; + let e193: vec3 = bitangent; + v6.bx = e193.x; + let e196: vec3 = bitangent; + v6.by = e196.y; + let e199: vec3 = bitangent; + v6.bz = e199.z; + let e201: ModelVertex = v6; + return e201; } fn main1() { var vertexIndex2: u32; var result: ModelVertex; - let _e11: vec3 = gl_GlobalInvocationID; - vertexIndex2 = _e11.x; - let _e15: u32 = vertexIndex2; - let _e16: ModelVertex = calcTangentBitangent(_e15); - result = _e16; - let _e18: u32 = vertexIndex2; - let _e20: ModelVertex = result; - global1.dstVertices[_e18] = _e20; + let e11: vec3 = gl_GlobalInvocationID; + vertexIndex2 = e11.x; + let e15: u32 = vertexIndex2; + let e16: ModelVertex = calcTangentBitangent(e15); + result = e16; + let e18: u32 = vertexIndex2; + let e20: ModelVertex = result; + global1.dstVertices[e18] = e20; return; } diff --git a/code/showcase/compute/src/shader.frag.wgsl b/code/showcase/compute/src/shader.frag.wgsl index dfcbc242..dbb00d86 100644 --- a/code/showcase/compute/src/shader.frag.wgsl +++ b/code/showcase/compute/src/shader.frag.wgsl @@ -39,61 +39,61 @@ fn main1() { var specular_color: vec3; var result: vec3; - let _e14: vec2 = v_tex_coords1; - let _e15: vec4 = textureSample(t_diffuse, s_diffuse, _e14); - object_color = _e15; - let _e18: vec2 = v_tex_coords1; - let _e19: vec4 = textureSample(t_normal, s_normal, _e18); - object_normal = _e19; - let _e23: vec3 = global.light_color; - let _e24: f32 = ambient_strength; - ambient_color = (_e23 * _e24); - let _e27: vec4 = object_normal; - let _e34: vec4 = object_normal; - normal = normalize(((_e34.xyz * 2.0) - vec3(1.0))); - let _e43: vec3 = v_light_position1; - let _e44: vec3 = v_position1; - let _e46: vec3 = v_light_position1; - let _e47: vec3 = v_position1; - light_dir = normalize((_e46 - _e47)); - let _e53: vec3 = normal; - let _e54: vec3 = light_dir; - let _e59: vec3 = normal; - let _e60: vec3 = light_dir; - diffuse_strength = max(dot(_e59, _e60), 0.0); - let _e65: vec3 = global.light_color; - let _e66: f32 = diffuse_strength; - diffuse_color = (_e65 * _e66); - let _e69: vec3 = v_view_position1; - let _e70: vec3 = v_position1; - let _e72: vec3 = v_view_position1; - let _e73: vec3 = v_position1; - view_dir = normalize((_e72 - _e73)); - let _e77: vec3 = view_dir; - let _e78: vec3 = light_dir; - let _e80: vec3 = view_dir; - let _e81: vec3 = light_dir; - half_dir = normalize((_e80 + _e81)); - let _e87: vec3 = normal; - let _e88: vec3 = half_dir; - let _e93: vec3 = normal; - let _e94: vec3 = half_dir; - let _e101: vec3 = normal; - let _e102: vec3 = half_dir; - let _e107: vec3 = normal; - let _e108: vec3 = half_dir; - specular_strength = pow(max(dot(_e107, _e108), 0.0), f32(32)); - let _e116: f32 = specular_strength; - let _e117: vec3 = global.light_color; - specular_color = (_e116 * _e117); - let _e120: vec3 = ambient_color; - let _e121: vec3 = diffuse_color; - let _e123: vec3 = specular_color; - let _e125: vec4 = object_color; - result = (((_e120 + _e121) + _e123) * _e125.xyz); - let _e129: vec3 = result; - let _e130: vec4 = object_color; - f_color = vec4(_e129, _e130.w); + let e14: vec2 = v_tex_coords1; + let e15: vec4 = textureSample(t_diffuse, s_diffuse, e14); + object_color = e15; + let e18: vec2 = v_tex_coords1; + let e19: vec4 = textureSample(t_normal, s_normal, e18); + object_normal = e19; + let e23: vec3 = global.light_color; + let e24: f32 = ambient_strength; + ambient_color = (e23 * e24); + let e27: vec4 = object_normal; + let e34: vec4 = object_normal; + normal = normalize(((e34.xyz * 2.0) - vec3(1.0))); + let e43: vec3 = v_light_position1; + let e44: vec3 = v_position1; + let e46: vec3 = v_light_position1; + let e47: vec3 = v_position1; + light_dir = normalize((e46 - e47)); + let e53: vec3 = normal; + let e54: vec3 = light_dir; + let e59: vec3 = normal; + let e60: vec3 = light_dir; + diffuse_strength = max(dot(e59, e60), 0.0); + let e65: vec3 = global.light_color; + let e66: f32 = diffuse_strength; + diffuse_color = (e65 * e66); + let e69: vec3 = v_view_position1; + let e70: vec3 = v_position1; + let e72: vec3 = v_view_position1; + let e73: vec3 = v_position1; + view_dir = normalize((e72 - e73)); + let e77: vec3 = view_dir; + let e78: vec3 = light_dir; + let e80: vec3 = view_dir; + let e81: vec3 = light_dir; + half_dir = normalize((e80 + e81)); + let e87: vec3 = normal; + let e88: vec3 = half_dir; + let e93: vec3 = normal; + let e94: vec3 = half_dir; + let e101: vec3 = normal; + let e102: vec3 = half_dir; + let e107: vec3 = normal; + let e108: vec3 = half_dir; + specular_strength = pow(max(dot(e107, e108), 0.0), f32(32)); + let e116: f32 = specular_strength; + let e117: vec3 = global.light_color; + specular_color = (e116 * e117); + let e120: vec3 = ambient_color; + let e121: vec3 = diffuse_color; + let e123: vec3 = specular_color; + let e125: vec4 = object_color; + result = (((e120 + e121) + e123) * e125.xyz); + let e129: vec3 = result; + let e130: vec4 = object_color; + f_color = vec4(e129, e130.w); return; } @@ -104,6 +104,6 @@ fn main([[location(0)]] v_tex_coords: vec2, [[location(1)]] v_position: vec v_light_position1 = v_light_position; v_view_position1 = v_view_position; main1(); - let _e31: vec4 = f_color; - return FragmentOutput(_e31); + let e31: vec4 = f_color; + return FragmentOutput(e31); } diff --git a/code/showcase/compute/src/shader.vert.wgsl b/code/showcase/compute/src/shader.vert.wgsl index 34a7c1d5..b7f17b8d 100644 --- a/code/showcase/compute/src/shader.vert.wgsl +++ b/code/showcase/compute/src/shader.vert.wgsl @@ -49,54 +49,54 @@ fn main1() { var tangent_matrix: mat3x3; var model_space: vec4; - let _e24: vec4 = model_matrix_0_1; - let _e25: vec4 = model_matrix_1_1; - let _e26: vec4 = model_matrix_2_1; - let _e27: vec4 = model_matrix_3_1; - model_matrix = mat4x4(vec4(_e24.x, _e24.y, _e24.z, _e24.w), vec4(_e25.x, _e25.y, _e25.z, _e25.w), vec4(_e26.x, _e26.y, _e26.z, _e26.w), vec4(_e27.x, _e27.y, _e27.z, _e27.w)); - let _e50: vec2 = a_tex_coords1; - v_tex_coords = _e50; - let _e51: vec3 = normal_matrix_0_1; - let _e52: vec3 = normal_matrix_1_1; - let _e53: vec3 = normal_matrix_2_1; - normal_matrix = mat3x3(vec3(_e51.x, _e51.y, _e51.z), vec3(_e52.x, _e52.y, _e52.z), vec3(_e53.x, _e53.y, _e53.z)); - let _e68: mat3x3 = normal_matrix; - let _e69: vec3 = a_normal1; - let _e71: mat3x3 = normal_matrix; - let _e72: vec3 = a_normal1; - normal = normalize((_e71 * _e72)); - let _e76: mat3x3 = normal_matrix; - let _e77: vec3 = a_tangent1; - let _e79: mat3x3 = normal_matrix; - let _e80: vec3 = a_tangent1; - tangent = normalize((_e79 * _e80)); - let _e84: mat3x3 = normal_matrix; - let _e85: vec3 = a_bitangent1; - let _e87: mat3x3 = normal_matrix; - let _e88: vec3 = a_bitangent1; - bitangent = normalize((_e87 * _e88)); - let _e92: vec3 = tangent; - let _e93: vec3 = bitangent; - let _e94: vec3 = normal; - let _e108: vec3 = tangent; - let _e109: vec3 = bitangent; - let _e110: vec3 = normal; - tangent_matrix = transpose(mat3x3(vec3(_e108.x, _e108.y, _e108.z), vec3(_e109.x, _e109.y, _e109.z), vec3(_e110.x, _e110.y, _e110.z))); - let _e126: mat4x4 = model_matrix; - let _e127: vec3 = a_position1; - model_space = (_e126 * vec4(_e127, 1.0)); - let _e132: mat3x3 = tangent_matrix; - let _e133: vec4 = model_space; - v_position = (_e132 * _e133.xyz); - let _e136: mat3x3 = tangent_matrix; - let _e137: vec3 = global1.light_position; - v_light_position = (_e136 * _e137); - let _e139: mat3x3 = tangent_matrix; - let _e140: vec3 = global.u_view_position; - v_view_position = (_e139 * _e140); - let _e143: mat4x4 = global.u_view_proj; - let _e144: vec4 = model_space; - gl_Position = (_e143 * _e144); + let e24: vec4 = model_matrix_0_1; + let e25: vec4 = model_matrix_1_1; + let e26: vec4 = model_matrix_2_1; + let e27: vec4 = model_matrix_3_1; + model_matrix = mat4x4(vec4(e24.x, e24.y, e24.z, e24.w), vec4(e25.x, e25.y, e25.z, e25.w), vec4(e26.x, e26.y, e26.z, e26.w), vec4(e27.x, e27.y, e27.z, e27.w)); + let e50: vec2 = a_tex_coords1; + v_tex_coords = e50; + let e51: vec3 = normal_matrix_0_1; + let e52: vec3 = normal_matrix_1_1; + let e53: vec3 = normal_matrix_2_1; + normal_matrix = mat3x3(vec3(e51.x, e51.y, e51.z), vec3(e52.x, e52.y, e52.z), vec3(e53.x, e53.y, e53.z)); + let e68: mat3x3 = normal_matrix; + let e69: vec3 = a_normal1; + let e71: mat3x3 = normal_matrix; + let e72: vec3 = a_normal1; + normal = normalize((e71 * e72)); + let e76: mat3x3 = normal_matrix; + let e77: vec3 = a_tangent1; + let e79: mat3x3 = normal_matrix; + let e80: vec3 = a_tangent1; + tangent = normalize((e79 * e80)); + let e84: mat3x3 = normal_matrix; + let e85: vec3 = a_bitangent1; + let e87: mat3x3 = normal_matrix; + let e88: vec3 = a_bitangent1; + bitangent = normalize((e87 * e88)); + let e92: vec3 = tangent; + let e93: vec3 = bitangent; + let e94: vec3 = normal; + let e108: vec3 = tangent; + let e109: vec3 = bitangent; + let e110: vec3 = normal; + tangent_matrix = transpose(mat3x3(vec3(e108.x, e108.y, e108.z), vec3(e109.x, e109.y, e109.z), vec3(e110.x, e110.y, e110.z))); + let e126: mat4x4 = model_matrix; + let e127: vec3 = a_position1; + model_space = (e126 * vec4(e127, 1.0)); + let e132: mat3x3 = tangent_matrix; + let e133: vec4 = model_space; + v_position = (e132 * e133.xyz); + let e136: mat3x3 = tangent_matrix; + let e137: vec3 = global1.light_position; + v_light_position = (e136 * e137); + let e139: mat3x3 = tangent_matrix; + let e140: vec3 = global.u_view_position; + v_view_position = (e139 * e140); + let e143: mat4x4 = global.u_view_proj; + let e144: vec4 = model_space; + gl_Position = (e143 * e144); return; } @@ -115,10 +115,10 @@ fn main([[location(0)]] a_position: vec3, [[location(1)]] a_tex_coords: vec normal_matrix_1_1 = normal_matrix_1_; normal_matrix_2_1 = normal_matrix_2_; main1(); - let _e65: vec2 = v_tex_coords; - let _e67: vec3 = v_position; - let _e69: vec3 = v_light_position; - let _e71: vec3 = v_view_position; - let _e73: vec4 = gl_Position; - return VertexOutput(_e65, _e67, _e69, _e71, _e73); + let e65: vec2 = v_tex_coords; + let e67: vec3 = v_position; + let e69: vec3 = v_light_position; + let e71: vec3 = v_view_position; + let e73: vec4 = gl_Position; + return VertexOutput(e65, e67, e69, e71, e73); } diff --git a/code/showcase/framework/Cargo.toml b/code/showcase/framework/Cargo.toml index 95cb99c1..7941f953 100644 --- a/code/showcase/framework/Cargo.toml +++ b/code/showcase/framework/Cargo.toml @@ -14,7 +14,7 @@ pollster = "0.2" image = "0.23" log = "0.4" tobj = "2.0" -wgpu = "0.10" +wgpu = "0.11" wgpu-subscriber = "0.1" winit = "0.25" diff --git a/code/showcase/framework/src/lib.rs b/code/showcase/framework/src/lib.rs index 50dae812..efc33877 100644 --- a/code/showcase/framework/src/lib.rs +++ b/code/showcase/framework/src/lib.rs @@ -40,6 +40,7 @@ impl Display { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); diff --git a/code/showcase/gifs/Cargo.toml b/code/showcase/gifs/Cargo.toml index 0847fb4b..1045385b 100644 --- a/code/showcase/gifs/Cargo.toml +++ b/code/showcase/gifs/Cargo.toml @@ -14,7 +14,7 @@ pollster = "0.2" image = "0.23" log = "0.4" tobj = "3.1" -wgpu = "0.10" +wgpu = "0.11" winit = "0.25" gif = "0.10.3" diff --git a/code/showcase/imgui-demo/Cargo.toml b/code/showcase/imgui-demo/Cargo.toml index ddd9c63b..c1b9b055 100644 --- a/code/showcase/imgui-demo/Cargo.toml +++ b/code/showcase/imgui-demo/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" [dependencies] anyhow = "1.0" -wgpu = "0.10" +wgpu = "0.11" pollster = "0.2" imgui = "0.7" imgui-wgpu = "0.17" diff --git a/code/showcase/imgui-demo/src/main.rs b/code/showcase/imgui-demo/src/main.rs index 933e3a9e..d21c87e4 100644 --- a/code/showcase/imgui-demo/src/main.rs +++ b/code/showcase/imgui-demo/src/main.rs @@ -88,7 +88,7 @@ impl framework::Demo for ImguiDemo { // Prepare to render let mut encoder = display.device.create_command_encoder(&Default::default()); - let output = match display.swap_chain.get_current_frame() { + let output = match display.swap_chain.get_current_texture() { Ok(frame) => frame, Err(e) => { eprintln!("Error getting frame: {:?}", e); diff --git a/code/showcase/pong/Cargo.toml b/code/showcase/pong/Cargo.toml index a6162fca..ab5de8b1 100644 --- a/code/showcase/pong/Cargo.toml +++ b/code/showcase/pong/Cargo.toml @@ -11,7 +11,7 @@ anyhow = "1.0" bytemuck = { version = "1.4", features = [ "derive" ] } cgmath = "0.18" pollster = "0.2" -wgpu = { version = "0.10", features = ["spirv"]} +wgpu = { version = "0.11", features = ["spirv"]} wgpu_glyph = "0.14" rand = "0.8" rodio = "0.14" diff --git a/code/showcase/pong/src/render/mod.rs b/code/showcase/pong/src/render/mod.rs index 323fb5d6..5769c4f9 100644 --- a/code/showcase/pong/src/render/mod.rs +++ b/code/showcase/pong/src/render/mod.rs @@ -45,6 +45,7 @@ impl Render { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }) .await .unwrap(); @@ -136,7 +137,7 @@ impl Render { 0 }; - match self.surface.get_current_frame() { + match self.surface.get_current_texture() { Ok(frame) => { let view = frame.output.texture.create_view(&Default::default()); let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { diff --git a/code/showcase/windowless/Cargo.toml b/code/showcase/windowless/Cargo.toml index de49875b..42ae2670 100644 --- a/code/showcase/windowless/Cargo.toml +++ b/code/showcase/windowless/Cargo.toml @@ -12,7 +12,7 @@ raw-window-handle = "0.3" winit = "0.25" shaderc = "0.7" cgmath = "0.18" -wgpu = "0.10" +wgpu = "0.11" pollster = "0.2" [[bin]] diff --git a/code/showcase/windowless/src/main.rs b/code/showcase/windowless/src/main.rs index c8b9f0c9..0c1d2a0a 100644 --- a/code/showcase/windowless/src/main.rs +++ b/code/showcase/windowless/src/main.rs @@ -6,6 +6,7 @@ async fn run() { .request_adapter(&wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: None, + force_fallback_adapter: false, }) .await .unwrap(); diff --git a/docs/beginner/tutorial1-window/README.md b/docs/beginner/tutorial1-window/README.md index d158e078..8a3a7030 100644 --- a/docs/beginner/tutorial1-window/README.md +++ b/docs/beginner/tutorial1-window/README.md @@ -13,7 +13,7 @@ winit = "0.25" cgmath = "0.18" env_logger = "0.9" log = "0.4" -wgpu = "0.10" +wgpu = "0.11" pollster = "0.2" ``` diff --git a/docs/beginner/tutorial2-surface/README.md b/docs/beginner/tutorial2-surface/README.md index 97f100f3..9eb4630a 100644 --- a/docs/beginner/tutorial2-surface/README.md +++ b/docs/beginner/tutorial2-surface/README.md @@ -58,6 +58,7 @@ impl State { &wgpu::RequestAdapterOptions { power_preference: wgpu::PowerPreference::default(), compatible_surface: Some(&surface), + force_fallback_adapter: false, }, ).await.unwrap(); ``` @@ -67,11 +68,15 @@ impl State { The `instance` is the first thing you create when using wgpu. Its main purpose is to create `Adapter`s and `Surface`s. -The `adapter` is a handle to our actual graphics card. You can use this get information about the graphics card such as its name and what backend the adapter uses. We use this to create our `Device` and `Queue` later. +The `adapter` is a handle to our actual graphics card. You can use this get information about the graphics card such as its name and what backend the adapter uses. We use this to create our `Device` and `Queue` later. Let's discuss the fields of `RequestAdapterOptions`. + +* `power_preference` has two variants: `LowPower`, and `HighPerformance`. This means will pick an adapter that favors battery life such as a integrated GPU when using `LowPower`. `HighPerformance` as will pick an adapter for more power hungry yet more performant GPU's such as your dedicated graphics card. WGPU will favor `LowPower` if there is no adapter for the `HighPerformance` option. +* The `compatible_surface` field tells wgpu to find an adapter that can present to the supplied surface. +* The `force_fallback_adapter` forces wgpu to pick an adapter that will work on all harware. This usually means that the rendering backend will use a "software" system, instead of hardware such as a GPU.
-The options I've passed to `request_adapter` aren't guaranteed to work for all devices, but will work for most of them. If you want to get all adapters for a particular backend you can use `enumerate_adapters`. This will give you an iterator that you can loop over to check if one of the adapters works for your needs. +The options I've passed to `request_adapter` aren't guaranteed to work for all devices, but will work for most of them. If wgpu can't find an adapter with the required permissions, `request_adapter` will return `None`. If you want to get all adapters for a particular backend you can use `enumerate_adapters`. This will give you an iterator that you can loop over to check if one of the adapters works for your needs. ```rust let adapter = instance @@ -90,6 +95,7 @@ For more fields you can use to refine your search [check out the docs](https://d
+ ### The Surface The `surface` is the part of the window that we draw to. We need it to draw directly to the screen. Our `window` needs to implement [raw-window-handle](https://crates.io/crates/raw-window-handle)'s `HasRawWindowHandle` trait to create a surface. Fortunately, winit's `Window` fits the bill. We also need it to request our `adapter`. @@ -282,10 +288,10 @@ Here's where the magic happens. First we need to get a frame to render to. // impl State fn render(&mut self) -> Result<(), wgpu::SurfaceError> { - let output = self.surface.get_current_frame()?.output; + let output = self.surface.get_current_texture()?; ``` -The `get_current_frame` function will wait for the `surface` to provide a new `SurfaceTexture` that we will render to. We'll store this in `output` for later. +The `get_current_texture` function will wait for the `surface` to provide a new `SurfaceTexture` that we will render to. We'll store this in `output` for later. ```rust let view = output.texture.create_view(&wgpu::TextureViewDescriptor::default()); @@ -324,8 +330,8 @@ Now we can actually get to clearing the screen (long time coming). We need to us }); } - // submit will accept anything that implements IntoIter self.queue.submit(std::iter::once(encoder.finish())); + output.present(); Ok(()) } @@ -404,7 +410,7 @@ wgpu::RenderPassColorAttachment { } ``` -The `RenderPassColorAttachment` has the `view` field which informs `wgpu` what texture to save the colors to. In this case we specify `frame.view` that we created using `surface.get_current_frame()`. This means that any colors we draw to this attachment will get drawn to the screen. +The `RenderPassColorAttachment` has the `view` field which informs `wgpu` what texture to save the colors to. In this case we specify `frame.view` that we created using `surface.get_current_texture()`. This means that any colors we draw to this attachment will get drawn to the screen. The `resolve_target` is the texture that will receive the resolved output. This will be the same as `view` unless multisampling is enabled. We don't need to specify this, so we leave it as `None`. diff --git a/docs/beginner/tutorial5-textures/README.md b/docs/beginner/tutorial5-textures/README.md index 1b2a9fc2..1f843070 100644 --- a/docs/beginner/tutorial5-textures/README.md +++ b/docs/beginner/tutorial5-textures/README.md @@ -433,7 +433,7 @@ winit = "0.25" env_logger = "0.9" log = "0.4" pollster = "0.2" -wgpu = "0.10" +wgpu = "0.11" bytemuck = { version = "1.4", features = [ "derive" ] } anyhow = "1.0" // NEW! ``` diff --git a/docs/news/README.md b/docs/news/README.md index 1ba8dd4e..49cb4b67 100644 --- a/docs/news/README.md +++ b/docs/news/README.md @@ -33,7 +33,7 @@ if new_size.width > 0 && new_size.height > 0 { Finally, getting a `SurfaceTexture` to draw to will use the surface directly. ```rust -let output = self.surface.get_current_frame()?.output; +let output = self.surface.get_current_texture()?; let view = output .texture .create_view(&wgpu::TextureViewDescriptor::default()); diff --git a/docs/showcase/imgui-demo/README.md b/docs/showcase/imgui-demo/README.md index 505c4973..2c7556ec 100644 --- a/docs/showcase/imgui-demo/README.md +++ b/docs/showcase/imgui-demo/README.md @@ -96,7 +96,7 @@ let ui = self.imgui.frame(); // Prepare to render let mut encoder = display.device.create_command_encoder(&Default::default()); -let output = match display.swap_chain.get_current_frame() { +let output = match display.swap_chain.get_current_texture() { Ok(frame) => frame, Err(e) => { eprintln!("Error getting frame: {:?}", e); diff --git a/docs/showcase/windowless/README.md b/docs/showcase/windowless/README.md index 11e06453..abf9770a 100644 --- a/docs/showcase/windowless/README.md +++ b/docs/showcase/windowless/README.md @@ -22,7 +22,7 @@ let (device, queue) = adapter ## A triangle without a window -Now we've talked about not needing to see what the gpu is doing, but we do need to see the results at some point. If we look back to talking about the [surface](/beginner/tutorial2-surface/#render) we see that we use `surface.get_current_frame()` to grab a texture to draw to. We'll skip that step by creating the texture ourselves. One thing to note here is we need to specify `wgpu::TextureFormat::Rgba8UnormSrgb` to `format` instead of `surface.get_preferred_format(&adapter)` since PNG uses RGBA, not BGRA. +Now we've talked about not needing to see what the gpu is doing, but we do need to see the results at some point. If we look back to talking about the [surface](/beginner/tutorial2-surface/#render) we see that we use `surface.get_current_texture()` to grab a texture to draw to. We'll skip that step by creating the texture ourselves. One thing to note here is we need to specify `wgpu::TextureFormat::Rgba8UnormSrgb` to `format` instead of `surface.get_preferred_format(&adapter)` since PNG uses RGBA, not BGRA. ```rust let texture_size = 256u32; From e0e52584a604ab2467f169a589179d2057f6d7e4 Mon Sep 17 00:00:00 2001 From: Ben Hansen Date: Fri, 15 Oct 2021 12:05:03 -0600 Subject: [PATCH 2/3] fixed pong for 0.11 --- Cargo.lock | 725 +++++++++++++++++--- Cargo.toml | 2 +- code/beginner/tutorial2-surface/Cargo.toml | 2 +- code/beginner/tutorial2-surface/src/main.rs | 4 +- code/showcase/pong/Cargo.toml | 2 +- code/showcase/pong/src/render/mod.rs | 3 +- docs/beginner/tutorial2-surface/README.md | 1 + 7 files changed, 654 insertions(+), 85 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 767ecb4b..cb862caa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,16 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "ab_glyph" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af0ac006645f86f20f6c6fa4dcaef920bf803df819123626f9440e35835e7d80" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser 0.12.1", +] + [[package]] name = "ab_glyph_rasterizer" version = "0.1.4" @@ -28,9 +38,9 @@ checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" [[package]] name = "ahash" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43bb833f0bf979d8475d38fbf09ed3b8a55e1885fe93ad3f93239fc6a4f17b98" +checksum = "991984e3fd003e7ba02eb724f87a0f997b78677c46c0e91f8424ad7394c9886a" dependencies = [ "getrandom", "once_cell", @@ -50,6 +60,28 @@ dependencies = [ name = "alignment" version = "0.1.0" +[[package]] +name = "alsa" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75c4da790adcb2ce5e758c064b4f3ec17a30349f9961d3e5e6c9688b052a9e18" +dependencies = [ + "alsa-sys", + "bitflags", + "libc", + "nix 0.20.0", +] + +[[package]] +name = "alsa-sys" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db8fee663d06c4e303404ef5f40488a53e062f89ba8bfed81f42325aafad1527" +dependencies = [ + "libc", + "pkg-config", +] + [[package]] name = "andrew" version = "0.3.1" @@ -87,6 +119,15 @@ dependencies = [ "num-traits", ] +[[package]] +name = "approx" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "072df7202e63b127ab55acfe16ce97013d5b97bf160489336d3f1840fd78e99e" +dependencies = [ + "num-traits", +] + [[package]] name = "arrayvec" version = "0.7.1" @@ -102,7 +143,7 @@ version = "0.33.3+1.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc4f1d82f164f838ae413296d1131aa6fa79b917d25bebaa7033d25620c09219" dependencies = [ - "libloading 0.7.0", + "libloading 0.7.1", ] [[package]] @@ -128,6 +169,25 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" +[[package]] +name = "bindgen" +version = "0.56.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2da379dbebc0b76ef63ca68d8fc6e71c0f13e59432e0987e508c1820e6ab5239" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", +] + [[package]] name = "bit-set" version = "0.5.2" @@ -197,6 +257,12 @@ version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +[[package]] +name = "bytes" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" + [[package]] name = "calloop" version = "0.6.5" @@ -209,9 +275,27 @@ dependencies = [ [[package]] name = "cc" -version = "1.0.70" +version = "1.0.71" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "79c2681d6594606957bbb8631c4b90a7fcaaa72cdb714743a437b156d6a7eedd" +dependencies = [ + "jobserver", +] + +[[package]] +name = "cesu8" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d26a6ce4b6a484fa3edb70f7efa6fc430fd2b87285fe8b84304fd0936faa0dc0" +checksum = "6d43a04d8753f35258c91f8ec639f792891f748a1edbd759cf1dcea3382ad83c" + +[[package]] +name = "cexpr" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" +dependencies = [ + "nom 5.1.2", +] [[package]] name = "cfg-if" @@ -237,7 +321,7 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a98d30140e3296250832bbaaff83b27dcd6fa3cc70fb6f1f3e5c9c0023b5317" dependencies = [ - "approx", + "approx 0.4.0", "num-traits", ] @@ -253,11 +337,28 @@ dependencies = [ "winapi", ] +[[package]] +name = "clang-sys" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10612c0ec0e0a1ff0e97980647cb058a6e7aedb913d01d009c406b8b7d0b26ee" +dependencies = [ + "glob", + "libc", + "libloading 0.7.1", +] + +[[package]] +name = "claxon" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bfbf56724aa9eca8afa4fcfadeb479e722935bb2a0900c2d37e0cc477af0688" + [[package]] name = "cmake" -version = "0.1.45" +version = "0.1.46" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eb6210b637171dfba4cda12e579ac6dc73f5165ad56133e5d72ef3131f320855" +checksum = "b7b858541263efe664aead4a5209a4ae5c5d2811167d4ed4ee0944503f8d2089" dependencies = [ "cc", ] @@ -271,7 +372,7 @@ dependencies = [ "bitflags", "block", "cocoa-foundation", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "core-graphics 0.22.2", "foreign-types", "libc", @@ -286,7 +387,7 @@ checksum = "7ade49b65d560ca58c403a479bb396592b155c0185eada742ee323d1d68d6318" dependencies = [ "bitflags", "block", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "core-graphics-types", "foreign-types", "libc", @@ -309,6 +410,16 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" +[[package]] +name = "combine" +version = "4.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a909e4d93292cd8e9c42e189f61681eff9d67b6541f96b8a1a737f23737bd001" +dependencies = [ + "bytes", + "memchr", +] + [[package]] name = "compute" version = "0.1.0" @@ -347,11 +458,11 @@ dependencies = [ [[package]] name = "core-foundation" -version = "0.9.1" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" +checksum = "6888e10551bb93e424d8df1d07f1a8b4fceb0001a3a4b048bfc47554946f47b3" dependencies = [ - "core-foundation-sys 0.8.2", + "core-foundation-sys 0.8.3", "libc", ] @@ -363,9 +474,9 @@ checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" [[package]] name = "core-foundation-sys" -version = "0.8.2" +version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea221b5284a47e40033bf9b66f35f984ec0ea2931eb03505246cd27a963f981b" +checksum = "5827cebf4670468b8772dd191856768aedcb1b0278a04f989f7766351917b9dc" [[package]] name = "core-graphics" @@ -386,7 +497,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "269f35f69b542b80e736a20a89a05215c0ce80c2c03c514abb2e318b78379d86" dependencies = [ "bitflags", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "core-graphics-types", "foreign-types", "libc", @@ -399,7 +510,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a68b68b3446082644c91ac778bf50cd4104bfb002b5a6a7c44cca5a2c70788b" dependencies = [ "bitflags", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "foreign-types", "libc", ] @@ -417,6 +528,50 @@ dependencies = [ "objc", ] +[[package]] +name = "coreaudio-rs" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11894b20ebfe1ff903cbdc52259693389eea03b94918a2def2c30c3bf227ad88" +dependencies = [ + "bitflags", + "coreaudio-sys", +] + +[[package]] +name = "coreaudio-sys" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b7e3347be6a09b46aba228d6608386739fb70beff4f61e07422da87b0bb31fa" +dependencies = [ + "bindgen", +] + +[[package]] +name = "cpal" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "98f45f0a21f617cd2c788889ef710b63f075c949259593ea09c826f1e47a2418" +dependencies = [ + "alsa", + "core-foundation-sys 0.8.3", + "coreaudio-rs", + "jni", + "js-sys", + "lazy_static", + "libc", + "mach", + "ndk 0.3.0", + "ndk-glue 0.3.0", + "nix 0.20.0", + "oboe", + "parking_lot", + "stdweb", + "thiserror", + "web-sys", + "winapi", +] + [[package]] name = "crc32fast" version = "1.2.1" @@ -501,7 +656,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2daefd788d1e96e0a9d66dee4b828b883509bc3ea9ce30665f04c3246372690c" dependencies = [ "bitflags", - "libloading 0.7.0", + "libloading 0.7.1", "winapi", ] @@ -561,6 +716,26 @@ dependencies = [ "syn", ] +[[package]] +name = "dirs" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30baa043103c9d0c2a57cf537cc2f35623889dc0d405e6c3cccfadbc81c71309" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03d86534ed367a67548dc68113a0f5db55432fdfbb6e6f9d77704397d95d5780" +dependencies = [ + "libc", + "redox_users", + "winapi", +] + [[package]] name = "dispatch" version = "0.2.0" @@ -582,7 +757,7 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac1b7517328c04c2aa68422fc60a41b92208182142ed04a25879c26c8f878794" dependencies = [ - "libloading 0.7.0", + "libloading 0.7.1", ] [[package]] @@ -697,9 +872,9 @@ dependencies = [ [[package]] name = "gif" -version = "0.11.2" +version = "0.11.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a668f699973d0f573d15749b7002a9ac9e1f9c6b220e7b165601334c173d8de" +checksum = "c3a7187e78088aead22ceedeee99779455b23fc231fe13ec443f99bb71694e5b" dependencies = [ "color_quant", "weezl", @@ -744,11 +919,50 @@ dependencies = [ "web-sys", ] +[[package]] +name = "glyph_brush" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3e3f00b8574a76fb6c50890c48da03946ca50e4372a2778737922666a2238221" +dependencies = [ + "glyph_brush_draw_cache", + "glyph_brush_layout", + "log", + "ordered-float", + "rustc-hash", + "twox-hash", +] + +[[package]] +name = "glyph_brush_draw_cache" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac2c82074cafb68b9e459c50c655f7eedcb92d6ee7166813802934bc6fc29fa3" +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.0", + "xi-unicode", +] + [[package]] name = "gpu-alloc" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8524eac5fc9d05625c891adf78fcf64dc0ee9f8d0882874b9f220f42b442bf" +checksum = "0e64cbb8d36508d3e19da95e56e196a84f674fc190881f2cc010000798838aa6" dependencies = [ "bitflags", "gpu-alloc-types", @@ -813,6 +1027,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" +[[package]] +name = "hound" +version = "3.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a164bb2ceaeff4f42542bdb847c41517c78a60f5649671b2a07312b6e117549" + [[package]] name = "humantime" version = "2.1.0" @@ -834,7 +1054,7 @@ dependencies = [ "bytemuck", "byteorder", "color_quant", - "gif 0.11.2", + "gif 0.11.3", "jpeg-decoder", "num-iter", "num-rational", @@ -863,9 +1083,9 @@ checksum = "90953f308a79fe6d62a4643e51f848fbfddcd05975a38e69fdf4ab86a7baf7ca" [[package]] name = "instant" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bee0328b1209d157ef001c94dd85b4f8f64139adb0eac2659f4b08382b2f474d" +checksum = "716d3d89f35ac6a34fd0eed635395f4c3b76fa889338a4632e5231a8684216bd" dependencies = [ "cfg-if 1.0.0", "js-sys", @@ -879,12 +1099,35 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b71991ff56294aa922b450139ee08b3bfc70982c6b2c7562771375cf73542dd4" +[[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-sys" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8eaf4bc02d17cbdd7ff4c7438cafcdf7fb9a4613313ad11b4f8fefe7d3fa0130" +[[package]] +name = "jobserver" +version = "0.1.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af25a77299a7f711a01975c35a6a424eb6862092cc2d6c72c4ed6cbc56dfc1fa" +dependencies = [ + "libc", +] + [[package]] name = "jpeg-decoder" version = "0.1.22" @@ -910,7 +1153,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" dependencies = [ "libc", - "libloading 0.7.0", + "libloading 0.7.1", ] [[package]] @@ -919,11 +1162,28 @@ 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 = "lewton" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "777b48df9aaab155475a83a7df3070395ea1ac6902f5cd062b8f2b028075c030" +dependencies = [ + "byteorder", + "ogg", + "tinyvec", +] + [[package]] name = "libc" -version = "0.2.102" +version = "0.2.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2a5ac8f984bfcf3a823267e5fde638acc3325f6496633a5da6bb6eb2171e103" +checksum = "dd8f7255a17a627354f321ef0055d63b898c6fb27eff628af4d1b66b7331edf6" [[package]] name = "libloading" @@ -937,14 +1197,20 @@ dependencies = [ [[package]] name = "libloading" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f84d96438c15fcd6c3f244c8fce01d1e2b9c6b5623e9c711dc9286d8fc92d6a" +checksum = "c0cf036d15402bea3c5d4de17b3fce76b3e4a56ebc1f577be0e7a72f7c607cf0" dependencies = [ "cfg-if 1.0.0", "winapi", ] +[[package]] +name = "linked-hash-map" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" + [[package]] name = "lock_api" version = "0.4.5" @@ -969,6 +1235,15 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7d947cbb889ed21c2a84be6ffbaebf5b4e0f4340638cba0444907e38b56be084" +[[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" @@ -987,12 +1262,6 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" - [[package]] name = "memchr" version = "2.4.1" @@ -1033,9 +1302,29 @@ dependencies = [ [[package]] name = "minimal-lexical" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c835948974f68e0bd58636fc6c5b1fbff7b297e3046f11b3b3c18bbac012c6d" +checksum = "9c64630dcdd71f1a64c435f54885086a0de5d6a12d104d69b165fb7d5286d677" + +[[package]] +name = "minimp3" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "985438f75febf74c392071a975a29641b420dd84431135a6e6db721de4b74372" +dependencies = [ + "minimp3-sys", + "slice-deque", + "thiserror", +] + +[[package]] +name = "minimp3-sys" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e21c73734c69dc95696c9ed8926a2b393171d98b3f5f5935686a26a487ab9b90" +dependencies = [ + "cc", +] [[package]] name = "miniz_oxide" @@ -1092,9 +1381,9 @@ dependencies = [ [[package]] name = "naga" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "032288733590c094012e5f1dec15848be90015bb9b3fd16743d84ea582c4154a" +checksum = "eda66d09f712e1f0a6ab436137da4fac312f78301f6d4ac7cb8bfe96e988734f" dependencies = [ "bit-set", "bitflags", @@ -1123,6 +1412,19 @@ dependencies = [ "thiserror", ] +[[package]] +name = "ndk" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d64d6af06fde0e527b1ba5c7b79a6cc89cfc46325b0b2887dffe8f70197e0c3c" +dependencies = [ + "bitflags", + "jni-sys", + "ndk-sys", + "num_enum", + "thiserror", +] + [[package]] name = "ndk-glue" version = "0.3.0" @@ -1132,7 +1434,21 @@ dependencies = [ "lazy_static", "libc", "log", - "ndk", + "ndk 0.3.0", + "ndk-macro", + "ndk-sys", +] + +[[package]] +name = "ndk-glue" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e9e94628f24e7a3cb5b96a2dc5683acd9230bf11991c2a1677b87695138420" +dependencies = [ + "lazy_static", + "libc", + "log", + "ndk 0.4.0", "ndk-macro", "ndk-sys", ] @@ -1180,6 +1496,16 @@ dependencies = [ "libc", ] +[[package]] +name = "nom" +version = "5.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" +dependencies = [ + "memchr", + "version_check", +] + [[package]] name = "nom" version = "7.0.0" @@ -1200,6 +1526,17 @@ dependencies = [ "winapi", ] +[[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", +] + [[package]] name = "num-integer" version = "0.1.44" @@ -1292,19 +1629,69 @@ dependencies = [ "cc", ] +[[package]] +name = "oboe" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e15e22bc67e047fe342a32ecba55f555e3be6166b04dd157cd0f803dfa9f48e1" +dependencies = [ + "jni", + "ndk 0.4.0", + "ndk-glue 0.4.0", + "num-derive", + "num-traits", + "oboe-sys", +] + +[[package]] +name = "oboe-sys" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "338142ae5ab0aaedc8275aa8f67f460e43ae0fca76a695a742d56da0a269eadc" +dependencies = [ + "cc", +] + +[[package]] +name = "ogg" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6951b4e8bf21c8193da321bcce9c9dd2e13c858fe078bf9054a288b419ae5d6e" +dependencies = [ + "byteorder", +] + [[package]] name = "once_cell" version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56" +[[package]] +name = "ordered-float" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97c9d06878b3a851e8026ef94bf7fef9ba93062cd412601da4d9cf369b1cc62d" +dependencies = [ + "num-traits", +] + [[package]] name = "owned_ttf_parser" version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" dependencies = [ - "ttf-parser", + "ttf-parser 0.6.2", +] + +[[package]] +name = "owned_ttf_parser" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60ac8dda2e5cc09bf6480e3b3feff9783db251710c922ae9369a429c51efdeb0" +dependencies = [ + "ttf-parser 0.12.3", ] [[package]] @@ -1332,6 +1719,12 @@ dependencies = [ "winapi", ] +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + [[package]] name = "percent-encoding" version = "2.1.0" @@ -1356,9 +1749,9 @@ checksum = "8d31d11c69a6b52a174b42bdc0c30e5e11670f90788b2c471c31c1d17d449443" [[package]] name = "pkg-config" -version = "0.3.19" +version = "0.3.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3831453b3449ceb48b6d9c7ad7c96d5ea673e9b470a1dc578c2ce6521230884c" +checksum = "7c9b1041b4387893b91ee6746cddfc28516aff326a3519fb2adf820932c5e6cb" [[package]] name = "png" @@ -1378,6 +1771,24 @@ version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bb20dcc30536a1508e75d47dd0e399bb2fe7354dcf35cda9127f2bf1ed92e30e" +[[package]] +name = "pong" +version = "0.1.0" +dependencies = [ + "anyhow", + "bytemuck", + "cgmath", + "fs_extra", + "glob", + "pollster", + "rand", + "rodio", + "shaderc", + "wgpu", + "wgpu_glyph", + "winit", +] + [[package]] name = "pp-rs" version = "0.2.1" @@ -1387,6 +1798,12 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "ppv-lite86" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3ca011bd0129ff4ae15cd04c4eef202cadf6c51c21e47aba319b4e0501db741" + [[package]] name = "proc-macro-crate" version = "0.1.5" @@ -1408,9 +1825,9 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f5105d4fdaab20335ca9565e106a5d9b82b6219b5ba735731124ac6711d23d" +checksum = "edc3358ebc67bc8b7fa0c007f945b0b18226f78437d61bec735a9eb96b61ee70" dependencies = [ "unicode-xid", ] @@ -1423,13 +1840,53 @@ checksum = "87dfd5592a8eed7e74f56ad7b125f8234763b805c30f0c7c95c486920026a6ec" [[package]] name = "quote" -version = "1.0.9" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7" +checksum = "38bc8cc6a5f2e3655e0899c1b848643b2562f853f114bfec7be120678e3ace05" dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e7573632e6454cf6b99d7aac4ccca54be06da05aca2ef7423d22d27d4d4bcd8" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", + "rand_hc", +] + +[[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.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d34f1408f55294453790c48b2f1ebbb1c5b4b7563eb1f418bcfcfdbb06ebb4e7" +dependencies = [ + "getrandom", +] + +[[package]] +name = "rand_hc" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d51e9f596de227fda2ea6c84607f5558e196eeaf43c986b724ba4fb8fdf497e7" +dependencies = [ + "rand_core", +] + [[package]] name = "range-alloc" version = "0.1.2" @@ -1485,6 +1942,16 @@ dependencies = [ "bitflags", ] +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom", + "redox_syscall 0.2.10", +] + [[package]] name = "regex" version = "1.5.4" @@ -1517,6 +1984,19 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" +[[package]] +name = "rodio" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d98f5e557b61525057e2bc142c8cd7f0e70d75dc32852309bec440e6e046bf9" +dependencies = [ + "claxon", + "cpal", + "hound", + "lewton", + "minimp3", +] + [[package]] name = "ron" version = "0.6.5" @@ -1528,6 +2008,12 @@ dependencies = [ "serde", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rusttype" version = "0.9.2" @@ -1535,7 +2021,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" dependencies = [ "ab_glyph_rasterizer", - "owned_ttf_parser", + "owned_ttf_parser 0.6.0", ] [[package]] @@ -1624,13 +2110,30 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.3" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740223c51853f3145fe7c90360d2d4232f2b62e3449489c207eccde818979982" +checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" + +[[package]] +name = "slice-deque" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31ef6ee280cdefba6d2d0b4b78a84a1c1a3f3a4cec98c2d4231c8bc225de0f25" +dependencies = [ + "libc", + "mach", + "winapi", +] + [[package]] name = "slotmap" version = "1.0.6" @@ -1642,9 +2145,9 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.6.1" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" +checksum = "1ecab6c735a6bb4139c0caafd0cc3635748bbb3acf4550e8138122099251f309" [[package]] name = "smithay-client-toolkit" @@ -1675,6 +2178,18 @@ dependencies = [ "num-traits", ] +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "stdweb" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef5430c8e36b713e13b48a9f709cc21e046723fe44ce34587b73a830203b533e" + [[package]] name = "strsim" version = "0.9.3" @@ -1683,9 +2198,9 @@ checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" [[package]] name = "syn" -version = "1.0.76" +version = "1.0.80" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6f107db402c2c2055242dbf4d2af0e69197202e9faacbef9571bbe47f5a1b84" +checksum = "d010a1623fbd906d51d650a9916aaefc05ffa0e4053ff7fe601167f3e715d194" dependencies = [ "proc-macro2", "quote", @@ -1703,18 +2218,18 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "602eca064b2d83369e2b2f34b09c70b605402801927c65c11071ac911d299b88" +checksum = "854babe52e4df1653706b98fcfc05843010039b406875930a70e4d9644e5c417" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.29" +version = "1.0.30" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bad553cc2c78e8de258400763a647e80e6d1b31ee237275d756f6836d204494c" +checksum = "aa32fd3f627f367fe16f893e2597ae3c05020f8bba2666a4e6ea73d377e5714b" dependencies = [ "proc-macro2", "quote", @@ -1752,6 +2267,21 @@ dependencies = [ "weezl", ] +[[package]] +name = "tinyvec" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83b2a3d4d9091d0abd7eba4dc2710b1718583bd4d8992e2190720ea38f391f7" +dependencies = [ + "tinyvec_macros", +] + +[[package]] +name = "tinyvec_macros" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" + [[package]] name = "tobj" version = "2.0.4" @@ -1764,7 +2294,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "267a53ebc1139c69d3feedc33a381c382b2e3b0c47f44f48679e90c4a69b8dac" dependencies = [ - "ahash 0.7.4", + "ahash 0.7.5", ] [[package]] @@ -1778,9 +2308,9 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f96e095c0c82419687c20ddf5cb3eadb61f4e1405923c9dc8e53a1adacbda8" +checksum = "375a639232caf30edfc78e8d89b2d4c375515393e7af7e16f01cd96917fb2105" dependencies = [ "cfg-if 1.0.0", "pin-project-lite", @@ -1789,9 +2319,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.20" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46125608c26121c81b0c6d693eab5a420e416da7e43c426d2e8f7df8da8a3acf" +checksum = "1f4ed65637b8390770814083d20756f87bfa2c21bf2f110babdc5438351746e4" dependencies = [ "lazy_static", ] @@ -1819,9 +2349,9 @@ dependencies = [ [[package]] name = "tracing-subscriber" -version = "0.2.24" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdd0568dbfe3baf7048b7908d2b32bca0d81cd56bec6d2a8f894b01d74f86be3" +checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" dependencies = [ "ansi_term", "chrono", @@ -1845,6 +2375,12 @@ version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" +[[package]] +name = "ttf-parser" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ae2f58a822f08abdaf668897e96a5656fe72f5a9ce66422423e8849384872e6" + [[package]] name = "tutorial1-window" version = "0.1.0" @@ -2063,6 +2599,17 @@ dependencies = [ "winit", ] +[[package]] +name = "twox-hash" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f559b464de2e2bdabcac6a210d12e9b5a5973c251e102c44c585c71d51bd78e" +dependencies = [ + "cfg-if 1.0.0", + "rand", + "static_assertions", +] + [[package]] name = "unicode-width" version = "0.1.9" @@ -2301,9 +2848,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.11.0" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a412af0f34ad8065d2bb56183df11ccf68aec87d4ca674d7fd2387e7705eb7a6" +checksum = "11095a81f4406b1e594dab7dc35d6508409d364e62458f2e5b07b3edc7aca517" dependencies = [ "arrayvec", "ash", @@ -2320,7 +2867,7 @@ dependencies = [ "inplace_it", "js-sys", "khronos-egl", - "libloading 0.7.0", + "libloading 0.7.1", "log", "metal", "naga", @@ -2361,6 +2908,18 @@ dependencies = [ "serde", ] +[[package]] +name = "wgpu_glyph" +version = "0.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c78d49f4d168b245882ce000ee94fc67e744b33760c0119b0dbf8cb3caf20de5" +dependencies = [ + "bytemuck", + "glyph_brush", + "log", + "wgpu", +] + [[package]] name = "winapi" version = "0.3.9" @@ -2413,7 +2972,7 @@ checksum = "79610794594d5e86be473ef7763f604f2159cbac8c94debd00df8fb41e86c2f8" dependencies = [ "bitflags", "cocoa", - "core-foundation 0.9.1", + "core-foundation 0.9.2", "core-graphics 0.22.2", "core-video-sys", "dispatch", @@ -2423,8 +2982,8 @@ dependencies = [ "log", "mio", "mio-misc", - "ndk", - "ndk-glue", + "ndk 0.3.0", + "ndk-glue 0.3.0", "ndk-sys", "objc", "parking_lot", @@ -2439,13 +2998,12 @@ dependencies = [ [[package]] name = "x11-dl" -version = "2.19.0" +version = "2.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eab1e810da9042813865ebe3477261aa77d1f2241f6be747ef8c0e442bc1fa3" +checksum = "ea26926b4ce81a6f5d9d0f3a0bc401e5a37c6ae14a1bfaa8ff6099ca80038c59" dependencies = [ "lazy_static", "libc", - "maybe-uninit", "pkg-config", ] @@ -2455,14 +3013,23 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "463705a63313cd4301184381c5e8042f0a7e9b4bb63653f216311d4ae74690b7" dependencies = [ - "nom", + "nom 7.0.0", ] [[package]] name = "xdg" -version = "2.2.0" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a23fe958c70412687039c86f578938b4a0bb50ec788e96bce4d6ab00ddd5803" +dependencies = [ + "dirs", +] + +[[package]] +name = "xi-unicode" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d089681aa106a86fade1b0128fb5daf07d5867a509ab036d99988dec80429a57" +checksum = "a67300977d3dc3f8034dae89778f502b6ba20b269527b3223ba59c0cf393bb8a" [[package]] name = "xml-rs" diff --git a/Cargo.toml b/Cargo.toml index 6a082246..3ad6d7e8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,5 +12,5 @@ members = [ ] exclude = [ "code/showcase/imgui-demo", - "code/showcase/pong", + # "code/showcase/pong", ] \ No newline at end of file diff --git a/code/beginner/tutorial2-surface/Cargo.toml b/code/beginner/tutorial2-surface/Cargo.toml index 4442cfb0..3df739f1 100644 --- a/code/beginner/tutorial2-surface/Cargo.toml +++ b/code/beginner/tutorial2-surface/Cargo.toml @@ -14,7 +14,7 @@ env_logger = "0.9" log = "0.4" wgpu = "0.11" # wgpu = { version = "0.11", features=["trace"]} -# wgpu = { git = "https://github.com/gfx-rs/wgpu/"} +# wgpu = { git = "https://github.com/gfx-rs/wgpu/" } # wgpu = { git = "https://github.com/gfx-rs/wgpu/", features=["trace"]} pollster = "0.2" diff --git a/code/beginner/tutorial2-surface/src/main.rs b/code/beginner/tutorial2-surface/src/main.rs index a6ea8abd..73f7a99d 100644 --- a/code/beginner/tutorial2-surface/src/main.rs +++ b/code/beginner/tutorial2-surface/src/main.rs @@ -24,7 +24,7 @@ impl State { let surface = unsafe { instance.create_surface(window) }; let adapter = instance .request_adapter(&wgpu::RequestAdapterOptions { - power_preference: wgpu::PowerPreference::default(), + power_preference: wgpu::PowerPreference::HighPerformance, compatible_surface: Some(&surface), force_fallback_adapter: false, }) @@ -167,7 +167,7 @@ fn main() { Err(e) => eprintln!("{:?}", e), } } - Event::MainEventsCleared => { + Event::RedrawEventsCleared => { // RedrawRequested will only trigger once, unless we manually // request it. window.request_redraw(); diff --git a/code/showcase/pong/Cargo.toml b/code/showcase/pong/Cargo.toml index ab5de8b1..ae58866d 100644 --- a/code/showcase/pong/Cargo.toml +++ b/code/showcase/pong/Cargo.toml @@ -12,7 +12,7 @@ bytemuck = { version = "1.4", features = [ "derive" ] } cgmath = "0.18" pollster = "0.2" wgpu = { version = "0.11", features = ["spirv"]} -wgpu_glyph = "0.14" +wgpu_glyph = "0.15" rand = "0.8" rodio = "0.14" diff --git a/code/showcase/pong/src/render/mod.rs b/code/showcase/pong/src/render/mod.rs index 5769c4f9..14928083 100644 --- a/code/showcase/pong/src/render/mod.rs +++ b/code/showcase/pong/src/render/mod.rs @@ -139,7 +139,7 @@ impl Render { match self.surface.get_current_texture() { Ok(frame) => { - let view = frame.output.texture.create_view(&Default::default()); + let view = frame.texture.create_view(&Default::default()); let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { label: Some("Main Render Pass"), color_attachments: &[wgpu::RenderPassColorAttachment { @@ -192,6 +192,7 @@ impl Render { self.staging_belt.finish(); self.queue.submit(iter::once(encoder.finish())); + frame.present(); } Err(wgpu::SurfaceError::Outdated) => { self.surface.configure(&self.device, &self.config); diff --git a/docs/beginner/tutorial2-surface/README.md b/docs/beginner/tutorial2-surface/README.md index 9eb4630a..f1047238 100644 --- a/docs/beginner/tutorial2-surface/README.md +++ b/docs/beginner/tutorial2-surface/README.md @@ -330,6 +330,7 @@ Now we can actually get to clearing the screen (long time coming). We need to us }); } + // submit will accept anything that implements IntoIter self.queue.submit(std::iter::once(encoder.finish())); output.present(); From e010f745c92c7fcc5af421c98f93ee0ed57a759a Mon Sep 17 00:00:00 2001 From: Ben Hansen Date: Fri, 15 Oct 2021 13:45:20 -0600 Subject: [PATCH 3/3] updated news for 0.11 --- docs/news/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/news/README.md b/docs/news/README.md index 49cb4b67..4243e202 100644 --- a/docs/news/README.md +++ b/docs/news/README.md @@ -1,5 +1,25 @@ # News +## 0.11 further changes to Surface + +`SwapchainFrame` is no longer a thing. Instead `get_current_texture` will return a `SurfaceTexture` directly. This means that getting a frame to draw to looks somethings like this: + +```rust +let output = self.surface.get_current_texture()?; +let view = output + .texture + .create_view(&wgpu::TextureViewDescriptor::default()); +``` + +Another change is that you must call `SurfaceTexture::present()` after you submit your render command buffers to the `queue`. It goes something like this: + +```rust +self.queue.submit(iter::once(encoder.finish())); +output.present(); +``` + +There a good deal of internal changes such as WebGL support (which I really need to cover). You can check out more on wgpu's [changelog](https://github.com/gfx-rs/wgpu/blob/master/CHANGELOG.md#wgpu-011-2021-10-07). + ## Pong is fixed for 0.10 It wasn't actually that hard of a fix. I only really use the swapchain directly in the render module, and the only other change required me to include the `spirv` feature to wgpu in Cargo.toml.