From 8c06066f50166c08d94afb76017319a803eaa49a Mon Sep 17 00:00:00 2001 From: Kevin Reid Date: Wed, 25 Oct 2023 13:20:54 -0700 Subject: [PATCH] Update `wgpu` dependency from 0.17.1 to 0.18.0. --- Cargo.lock | 180 +++++++++++++----- Cargo.toml | 2 +- all-is-cubes-gpu/src/in_wgpu.rs | 17 +- all-is-cubes-gpu/src/in_wgpu/bloom.rs | 4 +- all-is-cubes-gpu/src/in_wgpu/frame_texture.rs | 2 +- all-is-cubes-gpu/src/in_wgpu/postprocess.rs | 4 +- .../src/in_wgpu/shader_testing.rs | 5 +- all-is-cubes-gpu/src/in_wgpu/space.rs | 3 +- 8 files changed, 151 insertions(+), 66 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 14710087b..c1ccee3be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2016,6 +2016,18 @@ dependencies = [ "num-traits", ] +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "futures-core", + "futures-sink", + "nanorand", + "spin 0.9.8", +] + [[package]] name = "fnv" version = "1.0.7" @@ -2241,6 +2253,17 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" +[[package]] +name = "gl_generator" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a95dfc23a2b4a9a2f5ab41d194f8bfda3cabec42af4e39f08c339eb2a0c124d" +dependencies = [ + "khronos_api", + "log", + "xml-rs", +] + [[package]] name = "glam" version = "0.22.0" @@ -2276,9 +2299,9 @@ dependencies = [ [[package]] name = "glow" -version = "0.12.3" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca0fe580e4b60a8ab24a868bc08e2f03cbcb20d3d676601fa909386713333728" +checksum = "886c2a30b160c4c6fec8f987430c26b526b7988ca71f664e6a699ddf6f9601e4" dependencies = [ "js-sys", "slotmap", @@ -2324,6 +2347,15 @@ dependencies = [ "serde_json", ] +[[package]] +name = "glutin_wgl_sys" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c8098adac955faa2d31079b65dc48841251f69efd3ac25477903fc424362ead" +dependencies = [ + "gl_generator", +] + [[package]] name = "gpu-alloc" version = "0.6.0" @@ -2345,15 +2377,16 @@ dependencies = [ [[package]] name = "gpu-allocator" -version = "0.22.0" +version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce95f9e2e11c2c6fadfce42b5af60005db06576f231f5c92550fdded43c423e8" +checksum = "40fe17c8a05d60c38c0a4e5a3c802f2f1ceb66b76c67d96ffb34bef0475a7fad" dependencies = [ "backtrace", "log", + "presser", "thiserror", "winapi", - "windows 0.44.0", + "windows 0.51.1", ] [[package]] @@ -2782,15 +2815,21 @@ dependencies = [ [[package]] name = "khronos-egl" -version = "4.1.0" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c2352bd1d0bceb871cb9d40f24360c8133c11d7486b68b5381c1dd1a32015e3" +checksum = "6aae1df220ece3c0ada96b8153459b67eebe9ae9212258bb0134ae60416fdf76" dependencies = [ "libc", - "libloading 0.7.4", + "libloading 0.8.0", "pkg-config", ] +[[package]] +name = "khronos_api" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2db585e1d738fc771bf08a151420d3ed193d9d895a36df7f6f8a9456b911ddc" + [[package]] name = "kira" version = "0.8.4" @@ -3017,9 +3056,9 @@ dependencies = [ [[package]] name = "metal" -version = "0.26.0" +version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "623b5e6cefd76e58f774bd3cc0c6f5c7615c58c03a97815245a25c3c9bdee318" +checksum = "c43f73953f8cbe511f021b58f18c3ce1c3d1ae13fe953293e13345bf83217f25" dependencies = [ "bitflags 2.3.3", "block", @@ -3104,15 +3143,15 @@ checksum = "bc0287524726960e07b119cebd01678f852f147742ae0d925e6a520dca956126" [[package]] name = "naga" -version = "0.13.0" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1ceaaa4eedaece7e4ec08c55c640ba03dbb73fb812a6570a59bcf1930d0f70e" +checksum = "61d829abac9f5230a85d8cc83ec0879b4c09790208ae25b5ea031ef84562e071" dependencies = [ "bit-set", "bitflags 2.3.3", "codespan-reporting", "hexf-parse", - "indexmap 1.9.3", + "indexmap 2.0.0", "log", "num-traits", "rustc-hash", @@ -3122,6 +3161,15 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "nanorand" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a51313c5820b0b02bd422f4b44776fbf47961755c74ce64afc73bfad10226c3" +dependencies = [ + "getrandom 0.2.10", +] + [[package]] name = "ndarray" version = "0.15.6" @@ -3525,7 +3573,7 @@ dependencies = [ "libc", "redox_syscall 0.3.5", "smallvec", - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -3716,6 +3764,12 @@ version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" +[[package]] +name = "presser" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8cf8e6a8aa66ce33f63993ffc4ea4271eb5b0530a9002db8455ea6050c77bfa" + [[package]] name = "pretty_assertions" version = "1.4.0" @@ -4414,7 +4468,7 @@ dependencies = [ "cc", "libc", "once_cell", - "spin", + "spin 0.5.2", "untrusted", "web-sys", "winapi", @@ -4891,6 +4945,15 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] + [[package]] name = "spirv" version = "0.2.0+1.5.4" @@ -5708,12 +5771,13 @@ dependencies = [ [[package]] name = "wgpu" -version = "0.17.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed547920565c56c7a29afb4538ac5ae5048865a5d2f05bff3ad4fbeb921a9a2c" +checksum = "30e7d227c9f961f2061c26f4cb0fbd4df0ef37e056edd0931783599d6c94ef24" dependencies = [ "arrayvec", "cfg-if", + "flume", "js-sys", "log", "naga", @@ -5732,9 +5796,9 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecf7454d9386f602f7399225c92dd2fbdcde52c519bc8fb0bd6fbeb388075dc2" +checksum = "837e02ddcdc6d4a9b56ba4598f7fd4202a7699ab03f6ef4dcdebfad2c966aea6" dependencies = [ "arrayvec", "bit-vec", @@ -5755,9 +5819,9 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6654a13885a17f475e8324efb46dc6986d7aaaa98353330f8de2077b153d0101" +checksum = "1e30b9a8155c83868e82a8c5d3ce899de6c3961d2ef595de8fc168a1677fc2d8" dependencies = [ "android_system_properties", "arrayvec", @@ -5768,6 +5832,7 @@ dependencies = [ "core-graphics-types", "d3d12", "glow", + "glutin_wgl_sys", "gpu-alloc", "gpu-allocator", "gpu-descriptor", @@ -5780,6 +5845,7 @@ dependencies = [ "metal", "naga", "objc", + "once_cell", "parking_lot", "profiling", "range-alloc", @@ -5796,9 +5862,9 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "0.17.0" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee64d7398d0c2f9ca48922c902ef69c42d000c759f3db41e355f4a570b052b67" +checksum = "0d5ed5f0edf0de351fe311c53304986315ce866f394a2e6df0c4b3c70774bcdd" dependencies = [ "bitflags 2.3.3", "js-sys", @@ -5853,20 +5919,30 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.44.0" +version = "0.46.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e745dab35a0c4c77aa3ce42d595e13d2003d6902d6b08c9ef5fc326d08da12b" +checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" dependencies = [ "windows-targets 0.42.2", ] [[package]] name = "windows" -version = "0.46.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" dependencies = [ - "windows-targets 0.42.2", + "windows-core", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets 0.48.5", ] [[package]] @@ -5884,7 +5960,7 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.48.1", + "windows-targets 0.48.5", ] [[package]] @@ -5904,17 +5980,17 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.48.1" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] @@ -5925,9 +6001,9 @@ checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_msvc" @@ -5937,9 +6013,9 @@ checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_i686_gnu" @@ -5949,9 +6025,9 @@ checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_msvc" @@ -5961,9 +6037,9 @@ checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_x86_64_gnu" @@ -5973,9 +6049,9 @@ checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnullvm" @@ -5985,9 +6061,9 @@ checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_msvc" @@ -5997,9 +6073,9 @@ checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "winit" diff --git a/Cargo.toml b/Cargo.toml index 80c5a870e..5cbfae1ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -82,7 +82,7 @@ trycmd = "0.14.1" # keep in sync with `snapbox` unicode-segmentation = { version = "1.10.1", default-features = false } wasm-bindgen-futures = "0.4.34" # Note: "expose_ids" feature is not needed globally but is enabled to avoid compiling two versions -wgpu = { version = "0.17.0", features = ["expose-ids"] } +wgpu = { version = "0.18.0", features = ["expose-ids"] } yield-progress = { version = "0.1.4", default-features = false } [profile.dev] diff --git a/all-is-cubes-gpu/src/in_wgpu.rs b/all-is-cubes-gpu/src/in_wgpu.rs index 36d188eff..c3a8196fb 100644 --- a/all-is-cubes-gpu/src/in_wgpu.rs +++ b/all-is-cubes-gpu/src/in_wgpu.rs @@ -221,8 +221,11 @@ impl EverythingRenderer { pub fn device_descriptor() -> wgpu::DeviceDescriptor<'static> { wgpu::DeviceDescriptor { features: wgpu::Features::empty(), - limits: wgpu::Limits::downlevel_webgl2_defaults() - .using_resolution(wgpu::Limits::default()), + limits: wgpu::Limits { + max_inter_stage_shader_components: 32, // number used by blocks-and-lines shader + ..wgpu::Limits::downlevel_webgl2_defaults() + .using_resolution(wgpu::Limits::default()) + }, label: None, } } @@ -598,7 +601,10 @@ impl EverythingRenderer { }, // We need to store the depth buffer if and only if we are going to do // the lines pass. - self.lines_vertex_count > 0, + match self.lines_vertex_count > 0 { + true => wgpu::StoreOp::Store, + false => wgpu::StoreOp::Discard, + }, )? } else { SpaceDrawInfo::default() @@ -614,10 +620,11 @@ impl EverythingRenderer { view: depth_texture_view, depth_ops: Some(wgpu::Operations { load: wgpu::LoadOp::Load, - store: false, // nothing uses the depth buffer after this + store: wgpu::StoreOp::Discard, // nothing uses the depth buffer after this }), stencil_ops: None, }), + ..Default::default() }); render_pass.set_pipeline(&self.pipelines.lines_render_pipeline); render_pass.set_bind_group(0, sr.camera_bind_group(), &[]); @@ -644,7 +651,7 @@ impl EverythingRenderer { } else { wgpu::LoadOp::Load }, - false, // nothing uses the ui depth buffer + wgpu::StoreOp::Discard, // nothing uses the ui depth buffer )? } else { SpaceDrawInfo::default() diff --git a/all-is-cubes-gpu/src/in_wgpu/bloom.rs b/all-is-cubes-gpu/src/in_wgpu/bloom.rs index 6749f05dd..9c6e99dd4 100644 --- a/all-is-cubes-gpu/src/in_wgpu/bloom.rs +++ b/all-is-cubes-gpu/src/in_wgpu/bloom.rs @@ -277,10 +277,10 @@ impl BloomResources { resolve_target: None, ops: wgpu::Operations { load: wgpu::LoadOp::Clear(wgpu::Color::BLACK), - store: true, + store: wgpu::StoreOp::Store, }, })], - depth_stencil_attachment: None, + ..Default::default() }); render_pass.execute_bundles([bundle]); } diff --git a/all-is-cubes-gpu/src/in_wgpu/frame_texture.rs b/all-is-cubes-gpu/src/in_wgpu/frame_texture.rs index 08a905472..0137b8935 100644 --- a/all-is-cubes-gpu/src/in_wgpu/frame_texture.rs +++ b/all-is-cubes-gpu/src/in_wgpu/frame_texture.rs @@ -283,7 +283,7 @@ impl FramebufferTextures { resolve_target: self.linear_scene_resolved_view.as_ref(), ops: wgpu::Operations { load: color_load_op, - store: true, + store: wgpu::StoreOp::Store, }, } } diff --git a/all-is-cubes-gpu/src/in_wgpu/postprocess.rs b/all-is-cubes-gpu/src/in_wgpu/postprocess.rs index 9514ba0e6..5a0b55c55 100644 --- a/all-is-cubes-gpu/src/in_wgpu/postprocess.rs +++ b/all-is-cubes-gpu/src/in_wgpu/postprocess.rs @@ -187,10 +187,10 @@ pub(crate) fn postprocess( resolve_target: None, ops: wgpu::Operations { load: wgpu::LoadOp::Load, - store: true, + store: wgpu::StoreOp::Store, }, })], - depth_stencil_attachment: None, + ..Default::default() }); render_pass.set_pipeline(&ev.postprocess_render_pipeline); diff --git a/all-is-cubes-gpu/src/in_wgpu/shader_testing.rs b/all-is-cubes-gpu/src/in_wgpu/shader_testing.rs index 196bf3933..bb2d659a6 100644 --- a/all-is-cubes-gpu/src/in_wgpu/shader_testing.rs +++ b/all-is-cubes-gpu/src/in_wgpu/shader_testing.rs @@ -189,7 +189,7 @@ where { // TODO: not using all of fbt's services let mut render_pass = encoder.begin_render_pass(&wgpu::RenderPassDescriptor { - label: None, + label: Some("shader test render pass"), // Clear with a nonzero color so that if something goes wrong and the full screen // triangle isn't drawn, we know that we're not just reading zeroed memory or a zero // result. @@ -200,10 +200,11 @@ where view: &fbt.depth_texture_view, depth_ops: Some(wgpu::Operations { load: wgpu::LoadOp::Clear(1.0), - store: false, + store: wgpu::StoreOp::Discard, }), stencil_ops: None, }), + ..Default::default() }); render_pass.set_bind_group(0, &camera_buffer.bind_group, &[]); render_pass.set_bind_group(1, &space_bind_group, &[]); diff --git a/all-is-cubes-gpu/src/in_wgpu/space.rs b/all-is-cubes-gpu/src/in_wgpu/space.rs index 9fbdd6d66..69c740aa0 100644 --- a/all-is-cubes-gpu/src/in_wgpu/space.rs +++ b/all-is-cubes-gpu/src/in_wgpu/space.rs @@ -287,7 +287,7 @@ impl SpaceRenderer { pipelines: &Pipelines, camera: &Camera, color_load_op: wgpu::LoadOp, - store_depth: bool, + store_depth: wgpu::StoreOp, ) -> Result { let start_time = I::now(); @@ -326,6 +326,7 @@ impl SpaceRenderer { }), stencil_ops: None, }), + ..Default::default() }); render_pass.set_bind_group(0, &self.camera_buffer.bind_group, &[]); if let Some(space_bind_group) = self.space_bind_group.get() {