From c48cb4c7c93a1160195d41becbe87f8377f7ec36 Mon Sep 17 00:00:00 2001 From: Timon Date: Sun, 25 Oct 2026 18:52:53 +0000 Subject: [PATCH] Update wgpu to 30 (#4810) --- .devcontainer/devcontainer.json | 2 +- .github/workflows/build.yml | 6 +- .nix/dev.nix | 2 +- .nix/pkgs/graphite.nix | 2 +- Cargo.lock | 146 +++++++++--------- Cargo.toml | 12 +- desktop/src/render/state.rs | 1 + desktop/ui/src/frames/import/d3d11.rs | 16 +- desktop/ui/src/frames/import/dmabuf.rs | 8 +- desktop/ui/src/frames/import/iosurface.rs | 3 +- desktop/ui/src/frames/surface.rs | 2 +- libraries/wgpu-sync/src/lib.rs | 2 +- node-graph/libraries/canvas-utils/src/wasm.rs | 1 + .../libraries/wgpu-executor/src/context.rs | 1 + .../wgpu-executor/src/texture_conversion.rs | 2 +- .../nodes/brush/src/basic_brush/pipeline.rs | 2 +- tools/cargo-run/src/requirements.rs | 4 +- 17 files changed, 114 insertions(+), 98 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6ea127f049..5d7ceb78b7 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -12,7 +12,7 @@ }, // NOTICE: keep these tool versions in sync with `.github/workflows/build.yml`, `.nix/dev.nix` and `.nix/pkgs/graphite.nix` (wasm-bindgen-cli), `tools/cargo-run/src/requirements.rs` (wasm-bindgen-cli, cargo-about), `tools/cargo-run/src/requirements/wasm_opt.rs` (Binaryen), and the `wasm-bindgen` crate in `Cargo.toml` "containerEnv": { - "WASM_BINDGEN_CLI_VERSION": "0.2.121", + "WASM_BINDGEN_CLI_VERSION": "0.2.127", "CARGO_ABOUT_VERSION": "0.9.2", "BINARYEN_VERSION": "130", "CARGO_BINSTALL_VERSION": "1.23.0" diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b5516312b7..c0a40c7803 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,7 +60,7 @@ jobs: # sccache deletes the oldest files in its folder once past its size cap, so it gets a folder apart from rust-gpu's codegen backend and Binaryen SCCACHE_DIR: /var/lib/github-actions/.cache/sccache # NOTICE: keep these tool versions in sync with the other jobs in this file, `.devcontainer/devcontainer.json`, `.nix/dev.nix` and `.nix/pkgs/graphite.nix` (wasm-bindgen-cli), `tools/cargo-run/src/requirements.rs` (wasm-bindgen-cli, cargo-about), `tools/cargo-run/src/requirements/wasm_opt.rs` (Binaryen), and the `wasm-bindgen` crate in `Cargo.toml` - WASM_BINDGEN_CLI_VERSION: "0.2.121" + WASM_BINDGEN_CLI_VERSION: "0.2.127" BINARYEN_VERSION: "130" steps: - name: 📥 Clone repository @@ -305,7 +305,7 @@ jobs: env: # NOTICE: keep these tool versions in sync with the other jobs in this file, `.devcontainer/devcontainer.json`, `.nix/dev.nix` and `.nix/pkgs/graphite.nix` (wasm-bindgen-cli), `tools/cargo-run/src/requirements.rs` (wasm-bindgen-cli, cargo-about), `tools/cargo-run/src/requirements/wasm_opt.rs` (Binaryen), and the `wasm-bindgen` crate in `Cargo.toml` - WASM_BINDGEN_CLI_VERSION: "0.2.121" + WASM_BINDGEN_CLI_VERSION: "0.2.127" BINARYEN_VERSION: "130" CARGO_ABOUT_VERSION: "0.9.2" CARGO_BINSTALL_VERSION: "1.23.0" @@ -502,7 +502,7 @@ jobs: env: # NOTICE: keep these tool versions in sync with the other jobs in this file, `.devcontainer/devcontainer.json`, `.nix/dev.nix` and `.nix/pkgs/graphite.nix` (wasm-bindgen-cli), `tools/cargo-run/src/requirements.rs` (wasm-bindgen-cli, cargo-about), `tools/cargo-run/src/requirements/wasm_opt.rs` (Binaryen), and the `wasm-bindgen` crate in `Cargo.toml` - WASM_BINDGEN_CLI_VERSION: "0.2.121" + WASM_BINDGEN_CLI_VERSION: "0.2.127" BINARYEN_VERSION: "130" CARGO_ABOUT_VERSION: "0.9.2" CARGO_BINSTALL_VERSION: "1.23.0" diff --git a/.nix/dev.nix b/.nix/dev.nix index 935b606ad6..3266fe16bd 100644 --- a/.nix/dev.nix +++ b/.nix/dev.nix @@ -22,7 +22,7 @@ let pkgs.lld pkgs.nodejs pkgs.binaryen - pkgs.wasm-bindgen-cli_0_2_121 + pkgs.wasm-bindgen-cli_0_2_127 pkgs.cargo-about pkgs.rustc diff --git a/.nix/pkgs/graphite.nix b/.nix/pkgs/graphite.nix index eebd531f6c..04a87b98f6 100644 --- a/.nix/pkgs/graphite.nix +++ b/.nix/pkgs/graphite.nix @@ -84,7 +84,7 @@ deps.crane.lib.buildPackage ( pkgs.lld pkgs.nodejs pkgs.binaryen - pkgs.wasm-bindgen-cli_0_2_121 + pkgs.wasm-bindgen-cli_0_2_127 pkgs.cargo-about pkgs.removeReferencesTo pkgs.importNpmLock.npmConfigHook diff --git a/Cargo.lock b/Cargo.lock index 167227ca46..52ebc52d86 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -257,9 +257,9 @@ dependencies = [ [[package]] name = "bit-set" -version = "0.9.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34ddef2995421ab6a5c779542c81ee77c115206f4ad9d5a8e05f4ff49716a3dd" +checksum = "09ec2f926cc3060f09db9ebc5b52823d85268d24bb917e472c0c4bea35780a7d" dependencies = [ "bit-vec 0.9.1", ] @@ -2019,26 +2019,6 @@ dependencies = [ "windows 0.62.2", ] -[[package]] -name = "gpu-descriptor" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b89c83349105e3732062a895becfc71a8f921bb71ecbbdd8ff99263e3b53a0ca" -dependencies = [ - "bitflags 2.13.2", - "gpu-descriptor-types", - "hashbrown 0.15.5", -] - -[[package]] -name = "gpu-descriptor-types" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdf242682df893b86f33a73828fb09ca4b2d3bb6cc95249707fc684d27484b91" -dependencies = [ - "bitflags 2.13.2", -] - [[package]] name = "graph-craft" version = "0.0.0" @@ -2603,12 +2583,6 @@ version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc0fef456e4baa96da950455cd02c081ca953b141298e41db3fc7e36b1da849c" -[[package]] -name = "hexf-parse" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfa686283ad6dd069f105e5ab091b04c62850d3e4cf5d67debad1933f55023df" - [[package]] name = "html5ever" version = "0.36.1" @@ -3190,13 +3164,12 @@ checksum = "00810f1d8b74be64b13dbf3db89ac67740615d6c891f0e7b6179326533011a07" [[package]] name = "js-sys" -version = "0.3.98" +version = "0.3.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67df7112613f8bfd9150013a0314e196f4800d3201ae742489d999db2f979f08" +checksum = "0e0c1080212aad755ea003d18543e8768dd432c48819efd73a7bf1e39b7a5a3a" dependencies = [ "cfg-if", "futures-util", - "once_cell", "wasm-bindgen", ] @@ -3569,22 +3542,22 @@ dependencies = [ [[package]] name = "naga" -version = "29.0.3" +version = "30.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd91265cc2454558f659b3b4b9640f0ddb8cc6521277f166b8a8c181c898079" +checksum = "a616d2fb8c89516ac2723a581f69d6c18576046bed761bd6b305e5618e6ae130" dependencies = [ "arrayvec", - "bit-set 0.9.1", + "bit-set 0.10.0", "bitflags 2.13.2", "cfg-if", "cfg_aliases", "codespan-reporting", "half", - "hashbrown 0.16.0", - "hexf-parse", + "hashbrown 0.17.1", "indexmap", "libm", "log", + "naga-types", "num-traits", "once_cell", "petgraph 0.8.2", @@ -3594,6 +3567,18 @@ dependencies = [ "unicode-ident", ] +[[package]] +name = "naga-types" +version = "30.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "590afbf58a6f4f62873cd5cff4468061844bafa1cdf399cc954537c22d768d49" +dependencies = [ + "hashbrown 0.17.1", + "indexmap", + "rustc-hash 1.1.0", + "thiserror 2.0.18", +] + [[package]] name = "ndarray" version = "0.16.1" @@ -3863,8 +3848,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e022c9d066895efa1345f8e33e584b9f958da2fd4cd116792e15e07e4720a807" dependencies = [ "bitflags 2.13.2", + "dispatch2", "libc", + "objc2", "objc2-core-foundation", + "objc2-io-surface", ] [[package]] @@ -3933,6 +3921,7 @@ dependencies = [ "bitflags 2.13.2", "objc2", "objc2-core-foundation", + "objc2-core-graphics", "objc2-foundation", "objc2-metal", ] @@ -6647,9 +6636,9 @@ dependencies = [ [[package]] name = "vello" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af76ceb17b2869be23598baef40a9c8db4de86b87c60510c3bc245559275a617" +checksum = "913abde56cab6131b62c0cc69b1a93b671d3c34b3097beb3714fd1dc93be8115" dependencies = [ "bytemuck", "futures-intrusive", @@ -6666,9 +6655,9 @@ dependencies = [ [[package]] name = "vello_encoding" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e31cd622201690d8dfe9fd8fea8d1ae59db1bfeea414856a617d1d03438418c" +checksum = "b1fb9548d2b46b0f79137b5b1d208ecbd76d432f74e7a2ba838615d117f11532" dependencies = [ "bytemuck", "guillotiere", @@ -6679,9 +6668,9 @@ dependencies = [ [[package]] name = "vello_shaders" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf943bd2920bfd22928a9c1bad39866f7ffcc1109b6ed924ab52773e3868a83" +checksum = "2e653222cee49f2571729c3e4b0fa99bc4f826c6bb9487dbb88b825d552b3a27" dependencies = [ "bytemuck", "log", @@ -6732,9 +6721,9 @@ dependencies = [ [[package]] name = "wasm-bindgen" -version = "0.2.121" +version = "0.2.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49ace1d07c165b0864824eee619580c4689389afa9dc9ed3a4c75040d82e6790" +checksum = "1b70935747edd64d89de3efa29d73789b806c15798f8e7dca4d8ac356b50ce70" dependencies = [ "cfg-if", "once_cell", @@ -6745,9 +6734,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-futures" -version = "0.4.71" +version = "0.4.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96492d0d3ffba25305a7dc88720d250b1401d7edca02cc3bcd50633b424673b8" +checksum = "6b7777d5cc23d0e91404e53ce2d5e8ec7acae3026b16233dba62cd3246457950" dependencies = [ "js-sys", "wasm-bindgen", @@ -6755,9 +6744,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.121" +version = "0.2.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e68e6f4afd367a562002c05637acb8578ff2dea1943df76afb9e83d177c8578" +checksum = "77775f8f3f7217702089053b94958f8f54061a3f663417df76e19cbdcca29bc1" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -6765,9 +6754,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.121" +version = "0.2.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95a9ec35c64b2a7cb35d3fead40c4238d0940c86d107136999567a4703259f2" +checksum = "e11d33f857dc2fb11b8bc75aee111aa9cbeb12cd9f25efd3d4c2a3dd4e235284" dependencies = [ "bumpalo", "proc-macro2", @@ -6778,9 +6767,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-shared" -version = "0.2.121" +version = "0.2.127" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4e0100b01e9f0d03189a92b96772a1fb998639d981193d7dbab487302513441" +checksum = "7ef64dbcc55df09c7e5a46182d181c2cfa3e925f3da937ea764728b4bbb9dcbf" dependencies = [ "unicode-ident", ] @@ -6938,9 +6927,9 @@ dependencies = [ [[package]] name = "web-sys" -version = "0.3.98" +version = "0.3.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b572dff8bcf38bad0fa19729c89bb5748b2b9b1d8be70cf90df697e3a8f32aa" +checksum = "c435338968042f4f59a557f690a253676d47ce13ceb55d70100e7facf6620a30" dependencies = [ "js-sys", "wasm-bindgen", @@ -6994,9 +6983,9 @@ checksum = "a751b3277700db47d3e574514de2eced5e54dc8a5436a3bf7a0b248b2cee16f3" [[package]] name = "wgpu" -version = "29.0.3" +version = "30.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb3feacc458f7bee8bc1737149b42b6c731aa461039a4264a67bb6681646b250" +checksum = "527ccdf43dd5b2e8676eed9984ce00e2bbb0a1b85b70c1969dcb6cd2eb55ab9e" dependencies = [ "arrayvec", "bitflags 2.13.2", @@ -7004,7 +6993,7 @@ dependencies = [ "cfg-if", "cfg_aliases", "document-features", - "hashbrown 0.16.0", + "hashbrown 0.17.1", "js-sys", "log", "naga", @@ -7024,21 +7013,22 @@ dependencies = [ [[package]] name = "wgpu-core" -version = "29.0.3" +version = "30.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02da3ad1b568337f25513b317870960ef87073ea0945502e44b864b67a8c77b7" +checksum = "14c018fce9b6270aa203c2fdd56f3cce996713534bd757e4ea58c8560b121f14" dependencies = [ "arrayvec", - "bit-set 0.9.1", + "bit-set 0.10.0", "bit-vec 0.9.1", "bitflags 2.13.2", "bytemuck", "cfg_aliases", "document-features", - "hashbrown 0.16.0", + "hashbrown 0.17.1", "indexmap", "log", "naga", + "naga-types", "once_cell", "parking_lot", "portable-atomic", @@ -7057,27 +7047,27 @@ dependencies = [ [[package]] name = "wgpu-core-deps-apple" -version = "29.0.3" +version = "30.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62e51b5447e144b3dbba4feb01f80f4fa21696fa0cd99afb2c3df1affd6fdb28" +checksum = "061f3d319a40d39d00b1ecc2c33b89fe21d4e6fe01859df3500a3a8ecccd6b68" dependencies = [ "wgpu-hal", ] [[package]] name = "wgpu-core-deps-emscripten" -version = "29.0.3" +version = "30.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3487cd6293a963bc5c0c0396f6a2192043c50003c07f4efdccbad3d90ec9d819" +checksum = "d98b86cf4abf524a902dd35f18ca6a3f08fc2ae9847c8f10b48e30491b1f0b86" dependencies = [ "wgpu-hal", ] [[package]] name = "wgpu-core-deps-windows-linux-android" -version = "29.0.3" +version = "30.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb01076d0aa08b0ba9bd741e178b5cc440f5abe99d9581323a4c8b5d1a1916" +checksum = "7586165fd5f6d881cb9ce4bb71f40d6caab2c0f1837e3fc1d9788a197fb6004f" dependencies = [ "wgpu-hal", ] @@ -7104,14 +7094,14 @@ dependencies = [ [[package]] name = "wgpu-hal" -version = "29.0.3" +version = "30.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31f8e1a9e7a8512f276f7c62e018c7fa8d60954303fed2e5750114332049193f" +checksum = "b6b7fb58561a792bc237628ba0792e332de418fefe145f13b5ed8201e6d52f58" dependencies = [ "android_system_properties", "arrayvec", "ash", - "bit-set 0.9.1", + "bit-set 0.10.0", "bitflags 2.13.2", "block2", "bytemuck", @@ -7120,17 +7110,18 @@ dependencies = [ "glow", "glutin_wgl_sys", "gpu-allocator", - "gpu-descriptor", - "hashbrown 0.16.0", + "hashbrown 0.17.1", "js-sys", "khronos-egl", "libc", "libloading 0.8.8", "log", "naga", + "naga-types", "ndk-sys", "objc2", "objc2-core-foundation", + "objc2-core-graphics", "objc2-foundation", "objc2-metal", "objc2-quartz-core", @@ -7145,6 +7136,7 @@ dependencies = [ "raw-window-metal", "renderdoc-sys", "smallvec", + "static_assertions", "thiserror 2.0.18", "wasm-bindgen", "wayland-sys", @@ -7158,9 +7150,9 @@ dependencies = [ [[package]] name = "wgpu-naga-bridge" -version = "29.0.3" +version = "30.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59c654c483f058800972c3645e95388a7eca31bf9fe1933bc20e036588a0be02" +checksum = "d2f62e73117bb7a62bfd9c5a5841438a823f6566c6442a808ee269d2d055c081" dependencies = [ "naga", "wgpu-types", @@ -7175,15 +7167,17 @@ dependencies = [ [[package]] name = "wgpu-types" -version = "29.0.3" +version = "30.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9bcc31518a0e9735aefebedb5f7a9ef3ed1c42549c9f4c882fa9060ceaac639" +checksum = "99dad6f1fbdbbdb4c278a6508b059d44688f5cebddf78d005a46a31340269286" dependencies = [ "bitflags 2.13.2", "bytemuck", "js-sys", "log", + "naga-types", "raw-window-handle", + "static_assertions", "web-sys", ] diff --git a/Cargo.toml b/Cargo.toml index 5e93443cef..a2e3ada320 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -143,17 +143,17 @@ quote = "1.0" chrono = "0.4" ron = "0.12" fastnoise-lite = "1.1" -wgpu = { version = "29.0", features = [ +wgpu = { version = "30.0", features = [ # We don't have wgpu on multiple threads (yet) https://github.com/gfx-rs/wgpu/blob/trunk/CHANGELOG.md#wgpu-types-now-send-sync-on-wasm "fragile-send-sync-non-atomic-wasm", "spirv", "strict_asserts", ] } once_cell = "1.13" # Remove and replace with `core::cell::LazyCell` () -wasm-bindgen = "=0.2.121" # NOTICE: keep in sync with the `wasm-bindgen-cli` version pinned in `.github/workflows/build.yml`, `.devcontainer/devcontainer.json`, `.nix/dev.nix`, `.nix/pkgs/graphite.nix`, and `tools/cargo-run/src/requirements.rs`. We pin this version because wasm-bindgen upgrades may break various things. +wasm-bindgen = "=0.2.127" # NOTICE: keep in sync with the `wasm-bindgen-cli` version pinned in `.github/workflows/build.yml`, `.devcontainer/devcontainer.json`, `.nix/dev.nix`, `.nix/pkgs/graphite.nix`, and `tools/cargo-run/src/requirements.rs`. We pin this version because wasm-bindgen upgrades may break various things. wasm-bindgen-futures = "0.4" -js-sys = "=0.3.98" -web-sys = { version = "=0.3.98", features = [ +js-sys = "=0.3.104" +web-sys = { version = "=0.3.104", features = [ "Document", "DomRect", "Element", @@ -177,8 +177,8 @@ url = "2.5" tokio = { version = "1.29", features = ["fs", "macros", "io-std", "rt", "rt-multi-thread"] } # Linebender ecosystem (BEGIN) kurbo = { version = "0.13", features = ["serde"] } -vello = "0.10" -vello_encoding = "0.10" +vello = "0.11" +vello_encoding = "0.11" usvg = "0.47" simplecss = "0.2" parley = { version = "0.9", default-features = false, features = ["std"] } diff --git a/desktop/src/render/state.rs b/desktop/src/render/state.rs index c3395c16a4..6fcb68cf11 100644 --- a/desktop/src/render/state.rs +++ b/desktop/src/render/state.rs @@ -36,6 +36,7 @@ impl RenderState { let config = wgpu::SurfaceConfiguration { usage: wgpu::TextureUsages::RENDER_ATTACHMENT, format: surface_format, + color_space: wgpu::SurfaceColorSpace::Auto, width: size.width, height: size.height, present_mode: present_mode.unwrap_or(surface_caps.present_modes[0]), diff --git a/desktop/ui/src/frames/import/d3d11.rs b/desktop/ui/src/frames/import/d3d11.rs index 64bf574a25..716ed2483c 100644 --- a/desktop/ui/src/frames/import/d3d11.rs +++ b/desktop/ui/src/frames/import/d3d11.rs @@ -67,7 +67,13 @@ impl D3D11Importer { Ok::<_, TextureImportError>(hal_texture) }?; - let texture = unsafe { device.create_texture_from_hal::(hal_texture, &texture_descriptor(self.width, self.height, self.format, "CEF D3D11→D3D12 Shared Texture")?) }; + let texture = unsafe { + device.create_texture_from_hal::( + hal_texture, + &texture_descriptor(self.width, self.height, self.format, "CEF D3D11 -> D3D12 Shared Texture")?, + wgpu::TextureUses::UNINITIALIZED, + ) + }; Ok(texture) } @@ -108,7 +114,13 @@ impl D3D11Importer { Ok::<_, TextureImportError>(hal_texture) }?; - let texture = unsafe { device.create_texture_from_hal::(hal_texture, &texture_descriptor(self.width, self.height, self.format, "CEF D3D11 Shared Texture")?) }; + let texture = unsafe { + device.create_texture_from_hal::( + hal_texture, + &texture_descriptor(self.width, self.height, self.format, "CEF D3D11 Shared Texture")?, + wgpu::TextureUses::UNINITIALIZED, + ) + }; Ok(texture) } diff --git a/desktop/ui/src/frames/import/dmabuf.rs b/desktop/ui/src/frames/import/dmabuf.rs index 5a72376cea..de5968d7bb 100644 --- a/desktop/ui/src/frames/import/dmabuf.rs +++ b/desktop/ui/src/frames/import/dmabuf.rs @@ -84,7 +84,13 @@ impl DmaBufImporter { Ok::<_, TextureImportError>(hal_texture) }?; - let texture = unsafe { device.create_texture_from_hal::(hal_texture, &texture_descriptor(self.width, self.height, self.format, "CEF DMA-BUF Texture")?) }; + let texture = unsafe { + device.create_texture_from_hal::( + hal_texture, + &texture_descriptor(self.width, self.height, self.format, "CEF DMA-BUF Texture")?, + wgpu::TextureUses::UNINITIALIZED, + ) + }; Ok(texture) } diff --git a/desktop/ui/src/frames/import/iosurface.rs b/desktop/ui/src/frames/import/iosurface.rs index a315871e2f..9e6e2b88e7 100644 --- a/desktop/ui/src/frames/import/iosurface.rs +++ b/desktop/ui/src/frames/import/iosurface.rs @@ -81,6 +81,7 @@ impl IOSurfaceImporter { height: texture_desc.size.height, depth: texture_desc.array_layer_count(), }, + None, ); Ok::<_, TextureImportError>(hal_tex) @@ -88,6 +89,6 @@ impl IOSurfaceImporter { texture }; - Ok(unsafe { device.create_texture_from_hal::(hal_tex, &texture_desc) }) + Ok(unsafe { device.create_texture_from_hal::(hal_tex, &texture_desc, wgpu::TextureUses::UNINITIALIZED) }) } } diff --git a/desktop/ui/src/frames/surface.rs b/desktop/ui/src/frames/surface.rs index cf45a0eb15..c4a883381d 100644 --- a/desktop/ui/src/frames/surface.rs +++ b/desktop/ui/src/frames/surface.rs @@ -254,7 +254,7 @@ mod blank_check { match self.receiver.try_recv() { Ok(Ok(())) => { let slice = self.buffer.slice(..u64::from(self.width) * 4); - slice.get_mapped_range().chunks_exact(4).all(|texel| texel[3] == 0) + slice.get_mapped_range().is_ok_and(|view| view.as_chunks::<4>().0.iter().all(|texel| texel[3] == 0)) } _ => false, } diff --git a/libraries/wgpu-sync/src/lib.rs b/libraries/wgpu-sync/src/lib.rs index cce1d0f240..8987099b2a 100644 --- a/libraries/wgpu-sync/src/lib.rs +++ b/libraries/wgpu-sync/src/lib.rs @@ -188,7 +188,7 @@ pub struct SurfaceTextureGuard<'a> { impl SurfaceTextureGuard<'_> { pub fn present(self) { - self.raw.present(); + self.queue.present(self.raw); } } diff --git a/node-graph/libraries/canvas-utils/src/wasm.rs b/node-graph/libraries/canvas-utils/src/wasm.rs index 8b0d490ae0..0f3726222e 100644 --- a/node-graph/libraries/canvas-utils/src/wasm.rs +++ b/node-graph/libraries/canvas-utils/src/wasm.rs @@ -106,6 +106,7 @@ impl CanvasSurface for CanvasSurfaceHandle { &wgpu::SurfaceConfiguration { usage: wgpu::TextureUsages::RENDER_ATTACHMENT | wgpu::TextureUsages::COPY_DST, format: wgpu::TextureFormat::Rgba8Unorm, + color_space: wgpu::SurfaceColorSpace::Auto, width: size.width, height: size.height, present_mode: surface_caps.present_modes[0], diff --git a/node-graph/libraries/wgpu-executor/src/context.rs b/node-graph/libraries/wgpu-executor/src/context.rs index e959af5d48..a0f6a0a241 100644 --- a/node-graph/libraries/wgpu-executor/src/context.rs +++ b/node-graph/libraries/wgpu-executor/src/context.rs @@ -89,6 +89,7 @@ impl ContextBuilder { power_preference: wgpu::PowerPreference::HighPerformance, compatible_surface: None, force_fallback_adapter: false, + apply_limit_buckets: false, }; instance.request_adapter(&request_adapter_options).await.ok() } diff --git a/node-graph/libraries/wgpu-executor/src/texture_conversion.rs b/node-graph/libraries/wgpu-executor/src/texture_conversion.rs index d94372bd51..588cbb1628 100644 --- a/node-graph/libraries/wgpu-executor/src/texture_conversion.rs +++ b/node-graph/libraries/wgpu-executor/src/texture_conversion.rs @@ -106,7 +106,7 @@ impl RasterGpuToRasterCpuConverter { receiver.await.expect("Failed to receive map result")?; - let view = buffer_slice.get_mapped_range(); + let view = buffer_slice.get_mapped_range().expect("Failed to get mapped range"); let row_stride = self.padded_bytes_per_row as usize; let row_bytes = self.unpadded_bytes_per_row as usize; diff --git a/node-graph/nodes/brush/src/basic_brush/pipeline.rs b/node-graph/nodes/brush/src/basic_brush/pipeline.rs index 01430293bb..401e6c816f 100644 --- a/node-graph/nodes/brush/src/basic_brush/pipeline.rs +++ b/node-graph/nodes/brush/src/basic_brush/pipeline.rs @@ -186,7 +186,7 @@ impl Scatter { module: &shader, entry_point: Some("vs_main"), compilation_options: options.clone(), - buffers: &[instance_layout], + buffers: &[Some(instance_layout)], }, fragment: Some(wgpu::FragmentState { module: &shader, diff --git a/tools/cargo-run/src/requirements.rs b/tools/cargo-run/src/requirements.rs index dabd48db6c..10265874fd 100644 --- a/tools/cargo-run/src/requirements.rs +++ b/tools/cargo-run/src/requirements.rs @@ -55,8 +55,8 @@ fn requirements(task: &Task) -> Vec { args: &["--version"], name: "Wasm Bindgen", // NOTICE: keep in sync with the `wasm-bindgen` crate in `Cargo.toml` and the `wasm-bindgen-cli` version pinned in `.github/workflows/build.yml`, `.devcontainer/devcontainer.json`, `.nix/dev.nix`, and `.nix/pkgs/graphite.nix` - version: Some("=0.2.121"), - install: "cargo install -f wasm-bindgen-cli@0.2.121".into(), + version: Some("=0.2.127"), + install: "cargo install -f wasm-bindgen-cli@0.2.127".into(), skip: Some(&|task| matches!(task.target, Target::Cli)), ..Default::default() },